示例#1
0
        public static List <ATTCaseType> GetCaseType(int?caseTypeID, string active, int FlagForDefault)
        {
            try
            {
                List <ATTCaseType> caseTypeLIST = new List <ATTCaseType>();
                foreach (DataRow drow in DLLCaseType.GetCaseType(caseTypeID, active).Rows)
                {
                    ATTCaseType caseType = new ATTCaseType();

                    caseType.CaseTypeID   = int.Parse(drow["CASE_TYPE_ID"].ToString());
                    caseType.CaseTypeName = drow["CASE_TYPE_NAME"].ToString();
                    caseType.Appellant    = drow["APPELLANT"].ToString();
                    caseType.Respondant   = drow["RESPONDENT"].ToString();
                    caseType.Active       = drow["ACTIVE"].ToString();
                    caseType.Action       = "";

                    caseType.OrganisationCaseTypesLIST = BLLOrganizationCaseType.GetOrgByCaseType(int.Parse(caseType.CaseTypeID.ToString()), null, 0);

                    caseTypeLIST.Add(caseType);
                }
                if (FlagForDefault > 0)
                {
                    caseTypeLIST.Insert(0, new ATTCaseType(0, "छान्नुहोस", "", "", ""));
                }
                return(caseTypeLIST);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#2
0
 public static bool AddEditDeleteCaseType(ATTCaseType caseType)
 {
     try
     {
         return(DLLCaseType.AddEditDeleteCaseType(caseType));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#3
0
        public static bool AddEditDeleteCaseType(ATTCaseType cType)
        {
            string            InsertUpdateDeleteCaseType = "";
            GetConnection     GetConn = new GetConnection();
            OracleConnection  DBConn  = GetConn.GetDbConn(Module.CMS);
            OracleTransaction Tran    = DBConn.BeginTransaction();

            try
            {
                if (cType.CaseTypeID == 0)
                {
                    InsertUpdateDeleteCaseType = "SP_ADD_CASE_TYPE";
                }
                else
                {
                    InsertUpdateDeleteCaseType = "SP_EDIT_CASE_TYPE";
                }

                OracleParameter[] ParamArray = new OracleParameter[6];

                ParamArray[0] = FRAMEWORK.Utilities.GetOraParam(":P_CASE_TYPE_ID", cType.CaseTypeID, OracleDbType.Int64, ParameterDirection.InputOutput);
                ParamArray[1] = FRAMEWORK.Utilities.GetOraParam(":P_CASE_TYPE_NAME", cType.CaseTypeName, OracleDbType.Varchar2, ParameterDirection.Input);
                ParamArray[2] = FRAMEWORK.Utilities.GetOraParam(":P_APPELLANT", cType.Appellant, OracleDbType.Varchar2, ParameterDirection.Input);
                ParamArray[3] = FRAMEWORK.Utilities.GetOraParam(":P_RESPONDENT", cType.Respondant, OracleDbType.Varchar2, ParameterDirection.Input);
                ParamArray[4] = FRAMEWORK.Utilities.GetOraParam(":P_ACTIVE", cType.Active, OracleDbType.Varchar2, ParameterDirection.Input);
                ParamArray[5] = FRAMEWORK.Utilities.GetOraParam(":P_ENTRY_BY", cType.EntryBy, OracleDbType.Varchar2, ParameterDirection.Input);

                SqlHelper.ExecuteNonQuery(Tran, CommandType.StoredProcedure, InsertUpdateDeleteCaseType, ParamArray);
                cType.CaseTypeID = int.Parse(ParamArray[0].Value.ToString());
                int ctID = int.Parse(ParamArray[0].Value.ToString());

                DLLOrganizationCaseType.SaveOrgCaseType(cType.OrganisationCaseTypesLIST, ctID, Tran);

                Tran.Commit();
                return(true);
            }
            catch (Exception ex)
            {
                Tran.Rollback();
                throw ex;
            }
            finally
            {
                GetConn.CloseDbConn();
            }
        }
示例#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();
        }
    }