fork(2) download
  1. namespace WR_ID
  2. {
  3. public class WUID : tw.com.dsc.easyflowDotNet.kernelBasePage.TEIBasePage
  4. {
  5. string s_plants = "";
  6. string commstring = "";
  7. public string WR_UID(string S_FORMID, string S_SHEETNO, string P_Name)
  8. {
  9.  
  10.  
  11. string DB_String;
  12. DB_String = objEFPara.EF_getCompanyParameterData("EF_DBName").ToString().Trim();
  13. string S_EF_DBName = string.Format("{0}", DB_String);
  14. string[] S_EF_END = S_EF_DBName.Split(new char[] { ';' });
  15. string EF_1 = S_EF_END[0];
  16. string EF_2 = S_EF_END[1];
  17. string EF_3 = S_EF_END[2];
  18. string EF_4 = S_EF_END[3];
  19.  
  20. SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
  21. builder.DataSource = EF_1.Trim();
  22. builder.InitialCatalog = EF_2.Trim();
  23. builder.UserID = EF_3.Trim();
  24. builder.Password = EF_4.Trim();
  25.  
  26. SqlConnection connn = new SqlConnection(builder.ConnectionString);
  27. SqlConnection conn = new SqlConnection(builder.ConnectionString);
  28. SqlConnection conn_splant = new SqlConnection(builder.ConnectionString);
  29.  
  30. StringBuilder tSql = new StringBuilder();
  31. StringBuilder tSq2 = new StringBuilder();
  32. StringBuilder tSq3 = new StringBuilder();
  33. connn.Open();
  34. tSq2.AppendFormat("SELECT resda016 FROM resda ");
  35. tSq2.AppendFormat(" WHERE resda001 ='{0}' AND resda002 = '{1}'", formID, SheetNo);
  36. SqlCommand tCommand = new SqlCommand(tSq2.ToString(), connn);
  37. SqlDataReader rd = tCommand.ExecuteReader();//read uid
  38. if (rd.Read())
  39. {
  40. commstring = rd["resda016"].ToString();
  41. // Session["log"] = commstring.ToString();
  42. // Response.Redirect("log.aspx");
  43.  
  44. tSql.Remove(0, tSql.Length);
  45. // try
  46. {
  47. conn.Open();
  48. tSql.AppendFormat("UPDATE {0} SET IDNUMBER = '{1}'", P_Name, commstring);
  49. tSql.AppendFormat(" WHERE {0}002 = '{1}' ", P_Name, SheetNo);
  50. SqlCommand tCommand_wte = new SqlCommand(tSql.ToString(), conn);
  51. tCommand_wte.ExecuteNonQuery();
  52.  
  53.  
  54. conn_splant.Open();
  55. tSq3.AppendFormat("SELECT resak301 FROM resak ");
  56. tSq3.AppendFormat(" WHERE resak001 = '{0}'", commstring.ToString());
  57. SqlCommand tCommand_ruid = new SqlCommand(tSq3.ToString(), conn_splant);
  58. SqlDataReader rid = tCommand_ruid.ExecuteReader();//read uid
  59. if (rid.Read())
  60. {
  61. s_plants = rid["resak301"].ToString();
  62. }
  63.  
  64.  
  65. }
  66. // catch (Exception ex)
  67. {
  68. //throw new Exception(ex.tSql);
  69. }
  70. // finally
  71. {
  72. conn.Close();
  73. conn.Dispose();
  74. conn_splant.Close();
  75. conn_splant.Dispose();
  76.  
  77. }
  78.  
  79. }
  80. connn.Close();
  81. connn.Dispose();
  82.  
  83. return s_plants;
  84. }
  85. }
  86. }
  87.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(3,25): error CS0246: The type or namespace name `tw' could not be found. Are you missing a using directive or an assembly reference?
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty