示例#1
0
        public void Save(DataTable dt, BatchDetail batchDet, string sessionid)
        {
            BatchRecordDetail det;
            string            strDate, strTime;
            int iPass = 0, iFail = 0, iBlank = 0, iType = 0;

            foreach (DataRow dr in dt.Rows)
            {
                det = new BatchRecordDetail();
                try
                {
                    if (DataUtils.GetColumnValue(dr, BatchUploadConstants.Name).Length > 0)
                    {
                        det.BatchID       = batchDet.ID;
                        det.CompanyID     = batchDet.CompanyID;
                        strDate           = DataUtils.GetColumnValue(dr, BatchUploadConstants.ReceivedDate);
                        strTime           = DataUtils.GetColumnValue(dr, BatchUploadConstants.ReceivedTime);
                        det.ReceivedDate  = Convert.ToDateTime(strDate);
                        det.CustomerRefNo = DataUtils.GetColumnValue(dr, BatchUploadConstants.CustomerRefNo);
                        det.LeadNo        = GMConvert.GetInt32(DataUtils.GetColumnValue(dr, BatchUploadConstants.LeadNumber));
                        det.CountyID      = GMConvert.GetInt32(DataUtils.GetColumnValue(dr, BatchUploadConstants.CountyID));
                        det.Name          = DataUtils.GetColumnValue(dr, BatchUploadConstants.Name);
                        det.DOB           = Convert.ToDateTime(DataUtils.GetColumnValue(dr, BatchUploadConstants.DOB));
                        iType             = GMConvert.GetInt32(DataUtils.GetColumnValue(dr, BatchUploadConstants.CaseTypeID));
                        if (iType > 0)
                        {
                            det.CaseTypeID = iType;
                        }
                        det.RecordStatusID   = Convert.ToInt32(BatchUploadConstants.EnumRecordStatusType.RESEARCH);
                        det.Years            = GMConvert.GetInt32(DataUtils.GetColumnValue(dr, BatchUploadConstants.Years));
                        det.SSN              = DataUtils.GetColumnValue(dr, BatchUploadConstants.SSN);
                        det.ClientRemarks    = DataUtils.GetColumnValue(dr, BatchUploadConstants.ClientRemarks);
                        det.ClientSplRemarks = DataUtils.GetColumnValue(dr, BatchUploadConstants.ClientSplRemarks);
                        det.ActualCaseType   = DataUtils.GetColumnValue(dr, BatchUploadConstants.ActualCaseType);
                        Save(det);
                        SaveRecordHistory(det.ID, det.RecordStatusID, batchDet.UserID);
                        iPass += 1;
                    }
                    else
                    {
                        iBlank += 1;
                    }
                }
                catch (Exception ex)
                {
                    iFail += 1;
                    m_msg.Add(string.Format(ErrorConstants.BatchSaveFailed, det.Name));
                    Logger.LogException(ex);
                }
            }
            batchDet.FailCount  = iFail;
            batchDet.PassCount  = iPass;
            batchDet.TotalCount = dt.Rows.Count - iBlank;
        }
示例#2
0
 public void Save(BatchRecordDetail det)
 {
     if (det.ID.HasValue)
     {
         det.ModifiedDate = DateTime.Now;
     }
     else
     {
         det.CreatedDate = DateTime.Now;
     }
     if (!det.DOB.HasValue)
     {
         det.DOB = new DateTime(1900, 01, 01);
     }
     m_db.Save(det);
 }
示例#3
0
        public void Save(DCBatchRecord dcbr)
        {
            RecordHistory rh = new RecordHistory();

            try
            {
                BatchRecordDetail detbr = HasID(dcbr.ID)? m_biz.Get(dcbr.ID) : new BatchRecordDetail();
                bool hasrh = (detbr.RecordStatusID != dcbr.RecordStatusID);
                GMUtilities.GMReflectionUtils.Copy(dcbr, detbr);
                m_biz.Save(detbr);
                dcbr.ID = detbr.ID;
                if (hasrh)
                {
                    rh.Save(detbr.ID.Value, detbr.RecordStatusID.Value, dcbr.SessionID);
                }
            }
            catch (Exception exp)
            { throw exp; }
            finally { rh.Dispose(); }
        }
示例#4
0
 public void Save(BatchRecordDetail det)
 {
     Save(det, BatchRecordMap.ProcedureSave);
 }
示例#5
0
		public void Save(BatchRecordDetail det)
		{
			m_db.Save(det);
		}