예제 #1
0
 public bool DeleteSerialBookByBookNumber(string strBook_Number, string strSavedBy, DateTime dtFrom, DateTime dtTo, ref string strResponse)
 {
     bool result = false;
     strResponse = string.Empty;
     using (Promotion.DataModel.SerialResult_BO objSerialResult_BO = new SerialResult_BO())
     {
         DataModel.SerialResult objSerialResult = objSerialResult_BO.GetByBook_numberAndInput_time(strBook_Number, dtFrom, dtTo);
         if (objSerialResult != null)
         {
             string strSerials = objSerialResult.Serials;
             string[] Serials = null;
             if (strSerials.Length > 0)
             {
                 strSerials = strSerials.Substring(0, strSerials.Length - 1);
                 Serials = strSerials.Split("|".ToCharArray());
             }
             else
             {
                 ArrayList arrTmp = new ArrayList();
                 Serials = (string[])arrTmp.ToArray(typeof(string));
             }
             log.Info(strSerials);
             using (Promotion.DataModel.DelSerial_BO objDelSerial_BO = new DelSerial_BO())
             {
                 for (int nIndex = 0; nIndex < Serials.Length; nIndex++)
                 {
                     DelSerial objDelSerial = new DelSerial();
                     objDelSerial.book_number = objSerialResult.book_number;
                     objDelSerial.Serial = Serials[nIndex];
                     objDelSerial.input_time = DateTime.Now;
                     objDelSerial.SavedBy = strSavedBy;
                     objDelSerial_BO.CreateDelSerial(objDelSerial);
                     log.Info(strBook_Number + ": Xóa " + Serials[nIndex]);
                 }
             }
             objSerialResult.DeletedBy = strSavedBy;
             objSerialResult.DeletedDate = DateTime.Now;
             objSerialResult_BO.DeleteSerialResult(objSerialResult);
             result = true;
         }
         else
         {
             strResponse = string.Format("Số sổ {0} không tồn tại.", strBook_Number);
             log.Info(strResponse);
         }
     }
     return result;
 }
예제 #2
0
 public SerialBook GetSerialBookResultByBookNumber(string strBookNumber, DateTime dtFrom, DateTime dtTo)
 {
     SerialBook arr = new SerialBook();
     using (DataModel.SerialResult_BO objSerialResult_BO = new SerialResult_BO())
     {
         DataModel.SerialResult objSerialResult = objSerialResult_BO.GetByBook_numberAndInput_time(strBookNumber, dtFrom, dtTo);
         if (objSerialResult != null)
         {
             arr = ConvertTo(objSerialResult);
         }
         else
         {
             arr = null;
         }
     }
     return arr;
 }