public static List <ATTOrganizationCaseType> GetOrgByCaseType(int caseTypeID, string active, int defaultFlag)
        {
            List <ATTOrganizationCaseType> OrgCaseTypeList = new List <ATTOrganizationCaseType>();

            try
            {
                foreach (DataRow row in DLLOrganizationCaseType.GetOrgCaseType(null, caseTypeID, active).Rows)
                {
                    ATTOrganizationCaseType attOCT = new ATTOrganizationCaseType
                                                     (
                        int.Parse(row["ORG_ID"].ToString()),
                        int.Parse(row["CASE_TYPE_ID"].ToString()),
                        row["ACTIVE"].ToString()
                                                     );
                    attOCT.OrgName = row["ORG_NAME"].ToString();
                    attOCT.LstRegistrationDiary = BLLRegistrationDiary.GetRegistrationDiary(int.Parse(row["ORG_ID"].ToString()), caseTypeID, null, null, 0, 0, 0);
                    OrgCaseTypeList.Add(attOCT);
                }

                if (defaultFlag > 0)
                {
                    OrgCaseTypeList.Insert(0, new ATTOrganizationCaseType(0, 0, "छान्नुहोस"));
                }
                return(OrgCaseTypeList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
    protected void grdOrganization_SelectedIndexChanged(object sender, EventArgs e)
    {
        List <ATTOrganizationCaseType> orgCaseTypeLst = (List <ATTOrganizationCaseType>)Session["CloneOrganisations"];
        ATTOrganizationCaseType        organisation   = orgCaseTypeLst[grdOrganization.SelectedIndex];

        txtRegistrationDiaryName.Text = "";
        txtRegistrationDiaryCode.Text = "";

        grdRegistrationDiary.DataSource = organisation.LstRegistrationDiary;
        grdRegistrationDiary.DataBind();
        grdRegistrationDiary.SelectedIndex = -1;

        txtCaseSubject.Text = "";
        chkSubject.Checked  = true;

        grdCaseSubject.DataSource = null;
        grdCaseSubject.DataBind();
        grdCaseSubject.SelectedIndex = -1;

        txtCaseName.Text            = "";
        txtCaseNameDescription.Text = "";
        chkName.Checked             = true;

        grdCaseName.DataSource = null;
        grdCaseName.DataBind();
        grdCaseName.SelectedIndex = -1;
    }
        //public static bool SaveOrgCaseType(List<ATTOrganizationCaseType> lstOrgCaseType)
        //{
        //    try
        //    {
        //        return DLLOrganizationCaseType.SaveOrgCaseType(lstOrgCaseType);
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        public static List <ATTOrganizationCaseType> GetOrgCaseType(int?orgID, int?caseTypeID, string active, int defaultFlag, int regDiaryDV, int regSubDV, int regNameDV)
        {
            List <ATTOrganizationCaseType> OrgCaseTypeList = new List <ATTOrganizationCaseType>();

            try
            {
                foreach (DataRow row in DLLOrganizationCaseType.GetOrgCaseType(orgID, caseTypeID, active).Rows)
                {
                    ATTOrganizationCaseType attOCT = new ATTOrganizationCaseType
                                                     (
                        int.Parse(row["ORG_ID"].ToString()),
                        int.Parse(row["CASE_TYPE_ID"].ToString()),
                        row["ACTIVE"].ToString()
                                                     );
                    attOCT.CaseTypeName = row["CASE_TYPE_NAME"].ToString();

                    attOCT.LstRegistrationDiary = BLLRegistrationDiary.GetRegistrationDiary(int.Parse(row["ORG_ID"].ToString()), int.Parse(row["CASE_TYPE_ID"].ToString()), null, null, regDiaryDV, regSubDV, regNameDV);

                    attOCT.OrgCaseRegistrationTypeLST = BLLOrgCaseRegistrationType.GetOrgCaseRegType(int.Parse(row["ORG_ID"].ToString()), int.Parse(row["CASE_TYPE_ID"].ToString()), null, "Y", 1);

                    OrgCaseTypeList.Add(attOCT);
                }

                if (defaultFlag > 0)
                {
                    ATTOrganizationCaseType obj = new ATTOrganizationCaseType(0, 0, "");
                    obj.CaseTypeName = "छान्नुहोस";
                    OrgCaseTypeList.Insert(0, obj);
                }
                return(OrgCaseTypeList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #4
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        try
        {
            ATTCaseType attCT = new ATTCaseType(int.Parse(hdnCaseTypeID.Value), txtCaseTypeName_RQD.Text,
                                                txtAppellant.Text, txtRespondant.Text, chkActive.Checked == true ? "Y" : "N");
            attCT.EntryBy = strUser;

            foreach (GridViewRow row in grdOrganization.Rows)
            {
                CheckBox cbSelect = (CheckBox)(row.Cells[0].FindControl("chkSelect"));
                if (cbSelect.Checked == true && row.Cells[3].Text == "")
                {
                    ATTOrganizationCaseType objOrgCaseType = new ATTOrganizationCaseType(
                        int.Parse(row.Cells[1].Text), int.Parse(hdnCaseTypeID.Value), "Y");
                    objOrgCaseType.EntryBy = strUser;
                    objOrgCaseType.Action  = "A";
                    attCT.OrganisationCaseTypesLIST.Add(objOrgCaseType);
                }
                else if (cbSelect.Checked == false && row.Cells[3].Text == "Y")
                {
                    ATTOrganizationCaseType objOrgCaseType = new ATTOrganizationCaseType(
                        int.Parse(row.Cells[1].Text), int.Parse(hdnCaseTypeID.Value), "N");
                    objOrgCaseType.EntryBy = strUser;
                    objOrgCaseType.Action  = "E";
                    attCT.OrganisationCaseTypesLIST.Add(objOrgCaseType);
                }
                else if (cbSelect.Checked == true && row.Cells[3].Text == "N")
                {
                    ATTOrganizationCaseType objOrgCaseType = new ATTOrganizationCaseType(
                        int.Parse(row.Cells[1].Text), int.Parse(hdnCaseTypeID.Value), "Y");
                    objOrgCaseType.EntryBy = strUser;
                    objOrgCaseType.Action  = "E";
                    attCT.OrganisationCaseTypesLIST.Add(objOrgCaseType);
                }
            }
            List <ATTCaseType> LstCaseType = (List <ATTCaseType>)Session["OrgCaseType"];
            BLLCaseType.AddEditDeleteCaseType(attCT);

            foreach (GridViewRow row in grdOrganization.Rows)
            {
                CheckBox cbSelect = (CheckBox)(row.Cells[0].FindControl("chkSelect"));
                if (cbSelect.Checked == true && row.Cells[3].Text == "Y")
                {
                    ATTOrganizationCaseType objOrgCaseType = new ATTOrganizationCaseType(
                        int.Parse(row.Cells[1].Text), int.Parse(hdnCaseTypeID.Value), "Y");
                    objOrgCaseType.EntryBy = strUser;
                    attCT.OrganisationCaseTypesLIST.Add(objOrgCaseType);
                }
            }

            if (grdCaseType.SelectedIndex > -1)
            {
                LstCaseType[grdCaseType.SelectedIndex].CaseTypeID   = attCT.CaseTypeID;
                LstCaseType[grdCaseType.SelectedIndex].CaseTypeName = attCT.CaseTypeName;
                LstCaseType[grdCaseType.SelectedIndex].Appellant    = attCT.Appellant;
                LstCaseType[grdCaseType.SelectedIndex].Respondant   = attCT.Respondant;
                LstCaseType[grdCaseType.SelectedIndex].Active       = attCT.Active;
                LstCaseType[grdCaseType.SelectedIndex].OrganisationCaseTypesLIST = attCT.OrganisationCaseTypesLIST;
            }
            else
            {
                LstCaseType.Add(attCT);
            }
            grdCaseType.DataSource = LstCaseType;
            grdCaseType.DataBind();

            ClearControls();

            this.lblStatusMessage.Text = "Successfully Saved";
            this.programmaticModalPopup.Show();

            Session["OrgCaseType"] = LstCaseType;
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message;
            this.programmaticModalPopup.Show();
        }
    }