Exemplo n.º 1
0
 public static WOInformation GetWOInformationForm(string InfoCode)
 {
     var question = new WOInformation();
     using (var con = new SqlConnection(ConnectionUtility.GetConnectionString()))
     {
         con.Open();
         var cmd = new SqlCommand("SpGetWOInfoFormByGridCode", con) { CommandType = CommandType.StoredProcedure };
         cmd.Parameters.AddWithValue("@InfoCode", InfoCode);
         var reader = cmd.ExecuteReader();
         while (reader.Read())
             question.FetchData(question, new SafeDataReader(reader));
         reader.NextResult();
         while (reader.Read())
         {
             var item = new WOInformationForm();
             question.FetchItems(item, new SafeDataReader(reader));
             question.QItems.Add(item);
         }
     }
     return question;
 }
Exemplo n.º 2
0
 private void FetchData(WOInformation woForm, SafeDataReader reader)
 {
     woForm.Id = reader.GetInt32("Id");
     woForm.Name = reader.GetString("Name");
     woForm.InfoCode = reader.GetString("InfoCode");
     woForm.WOCode = reader.GetString("WOCode");
 }