Пример #1
0
 protected CaseProfiles MapCaseProfilesDTO()
 {
     CaseProfiles objCaseProfiles = new CaseProfiles();
     objCaseProfiles.FirstName = txtFirstName.Text;
     objCaseProfiles.MiddleName = txtMiddleName.Text;
     objCaseProfiles.LastName = txtLastName.Text;
     objCaseProfiles.DistrictID = Convert.ToInt32(ddlDistrict.SelectedValue);
     objCaseProfiles.VDCID = Convert.ToInt32(ddlVDC.SelectedValue);
     objCaseProfiles.CreatedBy = UserAuthentication.GetUserId(this.Page);
     return objCaseProfiles;
 }
Пример #2
0
 public int UpdateCaseProfile(CaseProfiles objCaseProfiles)
 {
     int rowsaffected = -1;
     BeginTransaction();
     try
     {
         String[] UpdateProperties = new String[] { "FirstName", "MiddleName", "LastName", "DistrictID", "VDCID"};
         rowsaffected = Update(objCaseProfiles, UpdateProperties);
         CommitTransaction();
     }
     catch (Exception e)
     {
         RollBackTransaction();
         rowsaffected = -1;
     }
     return rowsaffected;
 }
Пример #3
0
        public int InsertCaseProfile(CaseProfiles objCaseProfiles, Cases objCases, List<EvidencesPerCase> lstEvidencesPerCase)
        {
            objCases.CaseID = 1;
            BeginTransaction();

            try
            {
                objCaseProfiles.CaseProfileNumber = GenerateCaseProfileNumber(objCaseProfiles.DistrictID);
                objCaseProfiles.CaseProfileID = Insert(objCaseProfiles);
                objCases.CaseProfileID = objCaseProfiles.CaseProfileID;


                objCases.CaseID = Insert(objCases);
                foreach (EvidencesPerCase objEvidencesPerCase in lstEvidencesPerCase)
                {
                    objEvidencesPerCase.CaseID = objCases.CaseID;
                    Insert(objEvidencesPerCase);
                }
                CommitTransaction();
            }
            catch (Exception ex)
            {
                RollBackTransaction();
                objCases.CaseID = -1;
            }

            return objCases.CaseID;
        }
Пример #4
0
 public static int UpdateCaseProfile(CaseProfiles objCaseProfiles)
 {
     objCaseProfiles.UpdatedDate = DateTime.Now;
     return new CaseDAO().UpdateCaseProfile(objCaseProfiles);
 }
Пример #5
0
 public static int InsertCaseProfile(CaseProfiles objCaseProfiles,Cases objCases, List<EvidencesPerCase> lstEvidencesPerCase)
 {
     objCaseProfiles.CreatedDate = DateTime.Now;
     objCases.CreatedDate = DateTime.Now;
     return new CaseDAO().InsertCaseProfile(objCaseProfiles,objCases, lstEvidencesPerCase);
 }
Пример #6
0
        public static CaseProfiles GetCaseProfile(int CaseProfileID)
        {
            CaseProfiles objCaseProfiles = new CaseProfiles();
            return (CaseProfiles)(new CaseDAO().FillDTO(objCaseProfiles, "CaseProfileID=" + CaseProfileID));

        }