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; }
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; }
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; }
public static int UpdateCaseProfile(CaseProfiles objCaseProfiles) { objCaseProfiles.UpdatedDate = DateTime.Now; return new CaseDAO().UpdateCaseProfile(objCaseProfiles); }
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); }
public static CaseProfiles GetCaseProfile(int CaseProfileID) { CaseProfiles objCaseProfiles = new CaseProfiles(); return (CaseProfiles)(new CaseDAO().FillDTO(objCaseProfiles, "CaseProfileID=" + CaseProfileID)); }