public static int UpdateCaseFollowUp(CaseReferralHistory objCaseReferralHistory)
 {
     Cases objCases = new Cases();
     objCases.CaseID = objCaseReferralHistory.CaseID;
     objCases.PartnerID = objCaseReferralHistory.NewPartnerID;
     objCases.UpdatedBy = objCaseReferralHistory.UpdatedBy;
     objCases.UpdatedDate = DateTime.Now;
     objCaseReferralHistory.UpdatedDate = DateTime.Now;
     return new CaseReferralHistoryDAO().UpdateCaseFollowUpHistory(objCaseReferralHistory, objCases);
 }
        public static int DeleteCaseReferralHistory(int CaseReferralHistoryID, int UserID)
        {
            CaseReferralHistory objCaseReferralHistory = GetCaseReferralHistory(CaseReferralHistoryID);
            Cases objCases = new Cases();
            objCases.CaseID = objCaseReferralHistory.CaseID;
            objCases.PartnerID = objCaseReferralHistory.PreviousPartnerID;
            objCases.UpdatedBy = UserID;
            objCases.UpdatedDate = DateTime.Now;

            return new CaseReferralHistoryDAO().DeleteCaseReferralHistory(CaseReferralHistoryID, objCases);
        }
        public int InsertCaseReferralHistory(CaseReferralHistory objCaseReferralHistory, Cases objCases)
        {
            objCaseReferralHistory.CaseReferralHistoryID = 1;
            BeginTransaction();

            try
            {
                objCaseReferralHistory.CaseReferralHistoryID = Insert(objCaseReferralHistory);
                String[] UpdateProperties = new String[] { "PartnerID", "UpdatedBy", "UpdatedDate"};
                Update(objCases, UpdateProperties);
                CommitTransaction();
            }
            catch (Exception ex)
            {
                RollBackTransaction();
                objCaseReferralHistory.CaseReferralHistoryID = -1;
            }

            return objCaseReferralHistory.CaseReferralHistoryID;
        }
Exemple #4
0
 protected Cases MapCasesDTO()
 {
     Cases objCases = new Cases();
     objCases.CaseProfileID = Convert.ToInt32(Request.QueryString.Get("ID"));
     objCases.CaseTypeID = Convert.ToInt32(ddlTypeOfCase.SelectedValue);
     objCases.Description = txtCaseDesc.Text;
     objCases.CaseNumber = txtCaseNumber.Text.Trim();
     objCases.NameOfOpponent = txtNameOfOpponent.Text.Trim();
     objCases.CaseRegistrarID = Convert.ToInt32(ddlCaseRegistrar.SelectedValue);
     objCases.ResponsibleStaff = txtResponsibleStaff.Text.Trim();
     objCases.CaseRegisteredDate = Convert.ToDateTime(txtCaseRegisteredDate.Text);
     objCases.CaseStatusTypeID = Convert.ToInt32(ddlCaseStatusType.SelectedValue);
     if (UserAuthentication.GetUserType(this.Page) == "CASEUSR")
     {
         objCases.PartnerID = UserAuthentication.GetPartnerId(this.Page); //Convert.ToInt32(ddlStackeHolder.SelectedValue);
     }
     else if(UserAuthentication.GetUserType(this.Page) == "ADMIN")
     {
         objCases.PartnerID = Convert.ToInt32(ddlStackeHolder.SelectedValue);
     }
     objCases.CreatedBy = UserAuthentication.GetUserId(this.Page);
     return objCases;
 }
        public int UpdateCaseFollowUpHistory(CaseReferralHistory objCaseReferralHistory, Cases objCases)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                String[] UpdateProperties = new String[] { "PreviousPartnerID", "NewPartnerID", "ReferralDate"
                                                            , "Remarks","UpdatedBy", "UpdatedDate"
                                                            };
                rowsaffected = Update(objCaseReferralHistory, UpdateProperties);

                UpdateProperties = new String[] { "PartnerID", "UpdatedBy", "UpdatedDate"};
                rowsaffected = Update(objCases, UpdateProperties);

                CommitTransaction();
            }
            catch (Exception e)
            {
                RollBackTransaction();
                rowsaffected = -1;
            }
            return rowsaffected;

        }
        public int DeleteCaseReferralHistory(int CaseReferralHistoryID, Cases objCases)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                Delete("CaseReferralHistoryID=" + CaseReferralHistoryID);
                String[] UpdateProperties = new String[] { "PartnerID", "UpdatedBy", "UpdatedDate" };
                rowsaffected = Update(objCases, UpdateProperties);

                CommitTransaction();
            }
            catch (Exception e)
            {
                RollBackTransaction();
                rowsaffected = -1;
            }
            return rowsaffected;

        }
Exemple #7
0
        public int InsertCase(Cases objCases, List<EvidencesPerCase> lstEvidencesPerCase)
        {
            objCases.CaseID = 1;
            BeginTransaction();

            try
            {
                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;
        }
Exemple #8
0
        public int UpdateCase(Cases objCases, List<EvidencesPerCase> lstEvidencesPerCase)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                String[] UpdateProperties = new String[] { "CaseTypeID", "CaseNumber", "NameOfOpponent",
                                                            "Description", "PartnerID", "CaseRegistrarID", "ResponsibleStaff",
                                                            "CaseStatusTypeID", "CompensationAmount", "OutputDetails",
                                                            "UpdatedBy", "UpdatedDate", "CaseRegisteredDate"
                                                            };
                rowsaffected = Update(objCases, UpdateProperties);

                Delete("tbl_evidences_per_case", "CaseID = " + objCases.CaseID);
                foreach (EvidencesPerCase objEvidencesPerCase in lstEvidencesPerCase)
                {
                    objEvidencesPerCase.CaseID = objCases.CaseID;
                    Insert(objEvidencesPerCase);
                }

                CommitTransaction();
            }
            catch (Exception e)
            {
                RollBackTransaction();
                rowsaffected = -1;
            }
            return rowsaffected;

        }
Exemple #9
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;
        }
Exemple #10
0
        public static Cases GetCases(int CaseProfileID)
        {
            Cases objCases = new Cases();
            return (Cases)(new CaseDAO().FillDTO(objCases, "CaseProfileID=" + CaseProfileID));

        }
Exemple #11
0
 public static int UpdateCase(Cases objCases, List<EvidencesPerCase> lstEvidencesPerCase)
 {
     return new CaseDAO().UpdateCase(objCases, lstEvidencesPerCase);
 }
Exemple #12
0
 public static int InsertCase(Cases objCases, List<EvidencesPerCase> lstEvidencesPerCase)
 {
     return new CaseDAO().InsertCase(objCases, lstEvidencesPerCase);
 }
Exemple #13
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);
 }
Exemple #14
0
        protected void btnAddOtherCase_Click(object sender, EventArgs e)
        {
            Cases objCases = new Cases();
            objCases.CaseProfileID = Convert.ToInt32(Request.QueryString.Get("ID"));
            objCases.CaseTypeID = Convert.ToInt32(ddlTypeOfCase.SelectedValue);
            objCases.Description = txtCaseDesc.Text;
            objCases.CaseNumber = txtCaseNumber.Text.Trim();
            objCases.NameOfOpponent = txtNameOfOpponent.Text.Trim();
            objCases.CaseRegistrarID = Convert.ToInt32(ddlCaseRegistrar.SelectedValue);
            objCases.ResponsibleStaff = txtResponsibleStaff.Text.Trim();
            objCases.CaseRegisteredDate = Convert.ToDateTime(txtCaseRegisteredDate.Text);
            objCases.CaseStatusTypeID = Convert.ToInt32(ddlCaseStatusType.SelectedValue);
            objCases.PartnerID = Convert.ToInt32(ddlStackeHolder.SelectedValue);

            List<EvidencesPerCase> lstEvidencesPerCase = new List<EvidencesPerCase>();
            if (cblEvidenceTypes.Items.Count > 0)
            {
                for (int j = 0; j < cblEvidenceTypes.Items.Count; j++)
                {
                    if (cblEvidenceTypes.Items[j].Selected == true)
                    {
                        EvidencesPerCase objEvidencesPerCase = new EvidencesPerCase();
                        objEvidencesPerCase.EvidenceTypeID = Convert.ToInt32(cblEvidenceTypes.Items[j].Value);
                        lstEvidencesPerCase.Add(objEvidencesPerCase);
                    }
                }
            }

            if (!string.IsNullOrEmpty(hfCaseID.Value))
            {
                if (rbCompensationYes.Checked)
                {
                    objCases.CompensationAmount = Convert.ToInt32(txtCompensationAmount.Text.Trim());
                }
                else
                    objCases.CompensationAmount = 0;

                objCases.OutputDetails = txtOutputDetails.Text;

                objCases.UpdatedBy = UserAuthentication.GetUserId(this.Page);
                objCases.UpdatedDate = DateTime.Now;
                objCases.CaseID = Convert.ToInt32(hfCaseID.Value);
                CaseBO.UpdateCase(objCases, lstEvidencesPerCase);
            }
            else
            {
                objCases.CreatedBy = UserAuthentication.GetUserId(this.Page);
                objCases.CreatedDate = DateTime.Now;
                CaseBO.InsertCase(objCases, lstEvidencesPerCase);
            }

            ClearCase();
            LoadCasesAndFollowUp(Convert.ToInt32(hfCaseProfileID.Value));


        }