Example #1
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(hdBranchID.Value))
     {
         BranchDAL oBranchDAL = new BranchDAL();
         Result    oResult    = (Result)oBranchDAL.Detete(hdBranchID.Value);
         if (oResult.Status)
         {
             this.LoadList();
             ClearTextValue();
             hdBranchID.Value = "";
             ucMessage.OpenMessage(Constants.MSG_SUCCESS_DELETE, Constants.MSG_TYPE_SUCCESS);
         }
         else
         {
             if (oResult.Message.Equals(Constants.TABLE_MAIN))
             {
                 ucMessage.OpenMessage(Constants.MSG_APPROVED_DELETE_DATA, Constants.MSG_TYPE_ERROR);
             }
             else
             {
                 ucMessage.OpenMessage(Constants.MSG_ERROR_DELETE, Constants.MSG_TYPE_ERROR);
             }
         }
     }
     else
     {
         ucMessage.OpenMessage(Constants.MSG_ERROR_DELETE, Constants.MSG_TYPE_ERROR);
     }
 }
Example #2
0
    public void LoadList()
    {
        Branch oBranch = new Branch();
        Config oConfig = (Config)Session[Constants.SES_USER_CONFIG];

        if (oConfig != null)
        {
            BranchDAL oBranchDAL = new BranchDAL();
            Result    oResult    = oBranchDAL.LoadUnapprovedList(oConfig.UserName, false);

            if (oResult.Status)
            {
                DataTable dtTmpBranchList = (DataTable)oResult.Return;
                if (dtTmpBranchList.Rows.Count > 0)
                {
                    dtTmpBranchList.Columns.Remove("MakerID");

                    gvBranchList.DataSource = dtTmpBranchList;
                    gvBranchList.DataBind();

                    Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpBranchList;
                }
                else
                {
                    gvBranchList.DataSource = null;
                    gvBranchList.DataBind();
                }
            }
            else
            {
                ucMessage.OpenMessage(Constants.MSG_ERROR_NOT_FOUND, Constants.MSG_TYPE_ERROR);
            }
        }
    }
Example #3
0
        private static (List <VM_Branch> branches, List <BranchMeter> branchMeters) getBranchesAndBranchMeter(int PID)
        {
            //读取所有仪表
            var meters = MeterDAL.GetViewListByPID(PID);
            //读取所有支路
            var branches     = BranchDAL.GetViewListByPID(PID);
            var branchMeters = ModelLink.BranchMeterLink(branches, meters);

            return(branches, branchMeters);
        }
Example #4
0
        public Boolean Delete(SqlInt32 BranchID)
        {
            BranchDAL branchDAL = new BranchDAL();

            if (branchDAL.Delete(BranchID))
            {
                return(true);
            }
            else
            {
                this.Message = branchDAL.Message;
                return(false);
            }
        }
Example #5
0
        public Boolean Update(BranchENT entBranch)
        {
            BranchDAL branchDAL = new BranchDAL();

            if (branchDAL.Update(entBranch))
            {
                return(true);
            }
            else
            {
                this.Message = branchDAL.Message;
                return(false);
            }
        }
Example #6
0
    private void LoadDataByID(string sBranchID)
    {
        Branch    oBranch    = new Branch(sBranchID);
        BranchDAL oBranchDAL = new BranchDAL();
        Result    oResult    = new Result();

        oResult = oBranchDAL.LoadByID(oBranch);
        if (oResult.Status)
        {
            oBranch = (Branch)oResult.Return;

            txtBranchID.Text     = oBranch.BranchID.Trim();
            txtBranchID.ReadOnly = true;
            txtBranchName.Text   = oBranch.BranchName;
            txtBdBankCode.Text   = oBranch.BbCode;
            txtAddress.Text      = oBranch.Address;
            txtZipCode.Text      = oBranch.ZipCode;
            txtPhoneNumber.Text  = oBranch.Phone;
            txtEmailID.Text      = oBranch.Email;
            txtFaxNumber.Text    = oBranch.Fax;
            if (string.IsNullOrEmpty(hdDataType.Value))
            {
                //When Loading from Approver End
                UserDetails userDetails = ucUserDet.UserDetail;
                userDetails.MakerID  = oBranch.UserDetails.MakerID;
                userDetails.MakeDate = oBranch.UserDetails.MakeDate;
                ucUserDet.UserDetail = userDetails;
            }
            else if (hdDataType.Value.Equals("T"))
            {
                //When loading from temp table
                UserDetails userDetails = ucUserDet.UserDetail;
                userDetails.CheckDate      = oBranch.UserDetails.CheckDate;
                userDetails.CheckerID      = oBranch.UserDetails.CheckerID;
                userDetails.CheckDate      = oBranch.UserDetails.CheckDate;
                userDetails.CheckerComment = oBranch.UserDetails.CheckerComment;
                ucUserDet.UserDetail       = userDetails;
            }

            DDListUtil.Assign(ddlCountryName, oBranch.Country.ToString());
            hdBranchID.Value = sBranchID;
        }
        else
        {
            ucMessage.OpenMessage(Constants.MSG_ERROR_NOT_FOUND, Constants.MSG_TYPE_ERROR);
        }
    }
Example #7
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            CustomerType oCustomerType = new CustomerType();
            Result       oResult       = new Result();

            if (Type.Equals("BankSearch"))
            {
                BankDAL oBDAL = new BankDAL();
                oResult = oBDAL.AppSearchList(txtID.Text, txtName.Text);
            }
            else if (Type.Equals("DivisionSearch"))
            {
                DivisionDAL oDivisionDAL = new DivisionDAL();
                oResult = oDivisionDAL.AppSearchList(txtID.Text, txtName.Text);
            }
            else if (Type.Equals("CurrencySearch"))
            {
                CurrencyDAL oCurrencyDAL = new CurrencyDAL();
                oResult = oCurrencyDAL.AppSearchList(txtID.Text, txtName.Text);
            }
            else if (Type.Equals("BranchSearch"))
            {
                BranchDAL oBranchDAL = new BranchDAL();
                oResult = oBranchDAL.AppSearchList(txtID.Text, txtName.Text);
            }

            ScriptManager.RegisterStartupScript(this.upGv, typeof(string), Constants.POPUP_WINDOW, " HideProgressStatus('ctl00_cphDet_ucSearchConfComm_lblProgress') ", true);
            if (oResult.Status)
            {
                DataTable dtTmpCustomerTypeList = (DataTable)oResult.Return;
                if (dtTmpCustomerTypeList.Rows.Count > 0)
                {
                    gvSearchList.DataSource = dtTmpCustomerTypeList;
                    gvSearchList.DataBind();
                }
                else
                {
                    gvSearchList.DataSource = null;
                    gvSearchList.DataBind();
                }
                Session[Constants.SES_CONFIG_APPROVE_DATA] = dtTmpCustomerTypeList;
            }

            ScriptManager.RegisterStartupScript(this.upGv, typeof(string), Constants.POPUP_WINDOW, " HideProgressStatus('ctl00_cphDet_ucSearchConfComm_lblProgress') ", true);
        }
Example #8
0
        public ResultBM GetBranch(int branchId)
        {
            try
            {
                AddressBLL addressBll    = new AddressBLL();
                ResultBM   addressResult = null;
                BranchDAL  branchDal     = new BranchDAL();
                BranchDTO  branchDto     = branchDal.GetBranch(branchId);
                BranchBM   branchBm      = null;

                //Si la sede existe, debería existir la dirección
                if (branchDto != null)
                {
                    addressResult = addressBll.GetAddress(branchDto.addressId);

                    if (addressResult.IsValid())
                    {
                        if (addressResult.GetValue() != null)
                        {
                            branchBm = new BranchBM(branchDto, addressResult.GetValue <AddressBM>());
                        }
                        else
                        {
                            return(new ResultBM(ResultBM.Type.EXCEPTION, SessionHelper.GetTranslation("RETRIEVING_ERROR")));
                        }
                    }
                    else
                    {
                        return(addressResult);
                    }
                }

                return(new ResultBM(ResultBM.Type.OK, "Operación exitosa.", branchBm));
            }
            catch (Exception exception)
            {
                return(new ResultBM(ResultBM.Type.EXCEPTION, SessionHelper.GetTranslation("RETRIEVING_ERROR") + " " + exception.Message, exception));
            }
        }
Example #9
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Branch    oBranch    = new Branch();
        BranchDAL oBranchDAL = new BranchDAL();

        oBranch.BranchID   = Request[txtBranchID.UniqueID].Trim().ToUpper();
        txtBranchID.Text   = Request[txtBranchID.UniqueID].Trim().ToUpper();
        oBranch.BranchName = txtBranchName.Text.ToUpper();
        oBranch.BbCode     = txtBdBankCode.Text;
        oBranch.Address    = txtAddress.Text;
        oBranch.ZipCode    = txtZipCode.Text;
        oBranch.Phone      = txtPhoneNumber.Text;
        if (!string.IsNullOrEmpty(ddlCountryName.SelectedItem.Value))
        {
            oBranch.Country = ddlCountryName.SelectedItem.Value;
        }
        oBranch.Email = txtEmailID.Text;
        oBranch.Fax   = txtFaxNumber.Text;

        oBranch.UserDetails          = ucUserDet.UserDetail;
        oBranch.UserDetails.MakeDate = DateTime.Now;
        ucUserDet.ResetData();
        Result oResult = (Result)oBranchDAL.Save(oBranch);

        if (oResult.Status)
        {
            this.LoadList();
            ClearTextValue();
            hdBranchID.Value = "";

            ucMessage.OpenMessage(Constants.MSG_SUCCESS_SAVE, Constants.MSG_TYPE_SUCCESS);
            // ScriptManager.RegisterStartupScript(this.upData, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("Save"), true);
        }
        else
        {
            ucMessage.OpenMessage(Constants.MSG_ERROR_SAVE, Constants.MSG_TYPE_ERROR);
            // ScriptManager.RegisterStartupScript(this.upData, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("Save"), true);
        }
    }
Example #10
0
    protected void btnReject_Click(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(hdBranchID.Value))
        {
            Branch    oBranch    = new Branch(hdBranchID.Value);
            BranchDAL oBranchDAL = new BranchDAL();
            oBranch.UserDetails = ucUserDet.UserDetail;

            Result oResult = (Result)oBranchDAL.Reject(oBranch);
            if (oResult.Status)
            {
                ucMessage.OpenMessage(Constants.MSG_SUCCESS_REJECT, Constants.MSG_TYPE_SUCCESS);
            }
            else
            {
                ucMessage.OpenMessage(Constants.MSG_ERROR_REJECT, Constants.MSG_TYPE_ERROR);
            }
        }
        else
        {
            ucMessage.OpenMessage(Constants.MSG_ERROR_REJECT, Constants.MSG_TYPE_ERROR);
        }
    }
Example #11
0
    protected void btnApprove_Click(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(hdBranchID.Value))
        {
            Branch    oBranch    = new Branch(hdBranchID.Value);
            BranchDAL oBranchDAL = new BranchDAL();
            oBranch.UserDetails = ucUserDet.UserDetail;

            Result oResult = (Result)oBranchDAL.Approve(oBranch);
            if (oResult.Status)
            {
                ucMessage.OpenMessage(Constants.MSG_SUCCESS_APPROVE, Constants.MSG_TYPE_SUCCESS);
                ucMessage.OpenMessage(Constants.MSG_SUCCESS_APPROVE + " with<BR> <b>Branch Code:&nbsp;" + txtBranchID.Text + "&nbsp;:&nbsp;" + txtBranchName.Text.ToUpper() + "</B>", Constants.MSG_TYPE_SUCCESS);
            }
            else
            {
                ucMessage.OpenMessage(Constants.MSG_ERROR_APPROVE, Constants.MSG_TYPE_ERROR);
            }
        }
        else
        {
            ucMessage.OpenMessage(Constants.MSG_ERROR_APPROVE, Constants.MSG_TYPE_ERROR);
        }
    }
Example #12
0
    protected void createButton_Click(object sender, EventArgs e)
    {
        if (Session["user"] == null)
        {
            Response.Write("<script>alert('please login.');window.location.href='login.aspx';</script>");
            return;
        }

        if (name.Value.Length == 0 || desc.Value.Length == 0)
        {
            Response.Write("<script>alert('emoty data');</script>");
            return;
        }

        //create warehouse
        User         u  = Session["user"] as User;
        Warehouse    w  = new Warehouse();
        WarehouseDAL wd = new WarehouseDAL();

        w.user_id               = u.user_id;
        w.warehouse_name        = name.Value;
        w.warehouse_description = desc.Value;
        if (wd.Insert(ref w))
        {
        }
        else
        {
            Response.Write("<script>alert('error: warehouse insert');</script>");
            return;
        }

        //create first version
        Version    v  = new Version();
        VersionDAL vd = new VersionDAL();

        v.user_id      = u.user_id;
        v.warehouse_id = w.warehouse_id;
        v.version_name = "master";
        v.description  = "master";
        if (vd.Insert(ref v))
        {
            w.master_version_id = v.version_id;
        }
        else
        {
            //delete warehouse
            wd.Delete(ref w);
            Response.Write("<script>alert('error: version insert');</script>");
            return;
        }

        if (wd.Update(ref w))
        {
        }
        else
        {
            //delete warehouse and version
            wd.Delete(ref w);
            vd.Delete(ref v);
            Response.Write("<script>alert('error: warehouse update');</script>");
            return;
        }

        //insert branch
        Branch    b  = new Branch();
        BranchDAL bd = new BranchDAL();

        b.warehouse_id = w.warehouse_id;
        b.user_id      = u.user_id;
        b.start_id     = v.version_id;
        b.end_id       = 0;
        b.branch_name  = "master";
        b.description  = "master";
        if (bd.Insert(ref b))
        {
        }
        else
        {
            Response.Write("<script>alert('error: branch insert');</script>");
            wd.Delete(ref w);
            vd.Delete(ref v);
            return;
        }

        v.branch_id = b.branch_id;
        if (!vd.Update(ref v))
        {
            Response.Write("<script>alert('error: version update');</script>");
            wd.Delete(ref w);
            vd.Delete(ref v);
            bd.Delete(b.branch_id);
            return;
        }

        //crete files
        if (FileSystem.CreateFolder(Server.MapPath("~/") + @"data\" + w.warehouse_id.ToString() + @"\" + v.version_id.ToString()) == false)
        {
            Response.Write("<script>alert('error: file error');</script>");
            wd.Delete(ref w);
            vd.Delete(ref v);
            bd.Delete(b.branch_id);
            return;
        }

        //create success
        Response.Write("<script>alert('create success.');window.location.href='user_page.aspx?uid=" + u.user_id.ToString() + "';</script>");
    }
Example #13
0
 public BranchBO()
 {
     branchDAL = new BranchDAL();
 }
Example #14
0
    protected void createButton_Click(object sender, EventArgs e)
    {
        if (name.Value.Length == 0 || desc.Value.Length == 0)
        {
            //error
            Response.Write("<script>alert('invalid name or desc.');</script>");
            return;
        }
        if (name.Value == "master")
        {
            Response.Write("<script>alert('invalid name.');</script>");
            return;
        }

        Version v2 = new Version();

        v2.version_name = name.Value;
        v2.description  = desc.Value;
        v2.prev_id      = v.version_id;
        v2.next_id      = 0;
        v2.warehouse_id = v.warehouse_id;
        v2.user_id      = v.user_id;
        v2.branch_id    = 0;//warning

        if (!vd.Insert(ref v2))
        {
            Response.Write("<script>alert('insert error 1.');</script>");
            return;
        }

        Branch b = new Branch();

        b.branch_name  = name.Value;
        b.description  = desc.Value;
        b.warehouse_id = v.warehouse_id;
        b.user_id      = v.user_id;
        b.start_id     = v2.version_id;
        b.end_id       = 0;

        bd = new BranchDAL();

        if (!bd.Insert(ref b))
        {
            Response.Write("<script>alert('insert error 2.');</script>");
            vd.Delete(ref v2);
            return;
        }

        v2.branch_id = b.branch_id;
        if (!vd.Update(ref v2))
        {
            Response.Write("<script>alert('update error.');</script>");
            vd.Delete(ref v2);
            bd.Delete(b.branch_id);
            return;
        }

        //create files
        if (!FileSystem.CopyFolder(Server.MapPath("~/") + @"data\" + v.warehouse_id.ToString() + @"\" + v.version_id.ToString(), Server.MapPath("~/") + @"data\" + v.warehouse_id.ToString() + @"\" + v2.version_id.ToString()))
        {
            vd.Delete(ref v2);
            bd.Delete(b.branch_id);
            Response.Write("<script>alert('file error.');</script>");
            return;
        }

        Response.Write("<script>alert('create success.');</script>");
        Response.Redirect("warehouse_page.aspx?vid=" + v.version_id.ToString() + "&wid=" + v.warehouse_id.ToString());
    }
Example #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        wd = new WarehouseDAL();
        vd = new VersionDAL();
        bd = new BranchDAL();

        if (int.TryParse(Request.QueryString["wid"], out wid) == false)
        {
            //error
        }

        if (int.TryParse(Request.QueryString["vid"], out vid) == false)
        {
            //error
        }

        if (wid == 0 || vid == 0)
        {
            //error
        }

        //debug!!!!!!!!!!!!!!!!!!!!!!!
        //wid = 1;
        //vid = 1;
        //User u = new User();
        //u.user_id = 1;
        //UserDAL ud = new UserDAL();
        //ud.SelectByID(ref u);
        //Session["user"] = u;

        w = new Warehouse();
        w.warehouse_id = wid;
        if (!wd.SelectedByID(ref w))
        {
            //error
        }

        v            = new Version();
        v.version_id = vid;
        if (!vd.SelectByID(ref v))
        {
            //error
        }

        b           = new Branch();
        b.branch_id = v.branch_id;
        if (!bd.SelectByID(ref b))
        {
            //error
        }

        //head
        headName.InnerText = w.warehouse_name;
        headDesc.InnerText = w.warehouse_description;

        //current version
        curBran.InnerText = "当前分支:" + b.branch_name;
        curVer.InnerText  = "当前版本:" + v.version_id.ToString();
        curTime.InnerText = "修改时间:" + v.timestamp;
        curDesc.InnerText = "当前版本描述:" + v.description;

        //draw
        if (!DrawGraph())
        {
        }

        //file
        fileInit();
    }
    public void SearchAction()
    {
        string sType = Request.QueryString["pType"];

        gvData.DataSource = null;
        gvData.DataBind();

        if (!string.IsNullOrEmpty(sType))
        {
            Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = new DataTable();

            if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_CONFIG.BRANCH).PadLeft(5, '0')))
            {
                #region BRANCH
                lgText.InnerHtml = "Branch Approval Queue List";
                BranchDAL       oBranchDAL = new BranchDAL();
                TemplateBuilder tbGvData   = new TemplateBuilder();
                tbGvData.AppendLiteralString("No 'Branch' record found");
                gvData.EmptyDataTemplate = tbGvData;

                Result oResult = oBranchDAL.LoadUnapprovedList(null, true);
                if (oResult.Status)
                {
                    DataTable dtTmpList = (DataTable)oResult.Return;
                    if (dtTmpList != null)
                    {
                        if (dtTmpList.Rows.Count > 0)
                        {
                            gvData.DataSource = dtTmpList;
                            gvData.DataBind();

                            Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList;

                            this.gvData.HeaderRow.Cells[1].Text = "Branch ID";
                            this.gvData.HeaderRow.Cells[2].Text = "Branch Name";
                            this.gvData.HeaderRow.Cells[3].Text = "BB Code";
                            this.gvData.HeaderRow.Cells[4].Text = "Address";
                            this.gvData.HeaderRow.Cells[5].Text = "Maker ID";
                            this.gvData.HeaderRow.Cells[6].Text = "Make Date";
                        }
                    }
                }
                #endregion BRANCH
            }
            else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_CONFIG.BD_BANKADDRESS).PadLeft(5, '0')))
            {
                #region Bangladesh Bank Address
                lgText.InnerHtml = "Bangladesh Bank Address Approval Queue List";

                BBAddressDAL    oBBAddressDAL = new BBAddressDAL();
                TemplateBuilder tbGvData      = new TemplateBuilder();
                tbGvData.AppendLiteralString("No 'Bangladesh Bank Address' record found");
                gvData.EmptyDataTemplate = tbGvData;

                Result oResult = oBBAddressDAL.LoadUnapprovedList(null, true);
                if (oResult.Status)
                {
                    DataTable dtTmpList = (DataTable)oResult.Return;
                    if (dtTmpList != null)
                    {
                        if (dtTmpList.Rows.Count > 0)
                        {
                            gvData.DataSource = dtTmpList;
                            gvData.DataBind();

                            Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList;

                            this.gvData.HeaderRow.Cells[1].Text = "SP Type";
                            this.gvData.HeaderRow.Cells[2].Text = "Sales Statemet Address";
                            this.gvData.HeaderRow.Cells[3].Text = "Commission Claim Address";
                            this.gvData.HeaderRow.Cells[4].Text = "Interest Claim Address";
                            this.gvData.HeaderRow.Cells[5].Text = "Encashment Claim Address";
                            this.gvData.HeaderRow.Cells[6].Text = "Reinvestment Address";
                            this.gvData.HeaderRow.Cells[7].Text = "Maker ID";
                            this.gvData.HeaderRow.Cells[8].Text = "Make Date";
                        }
                    }
                }
                #endregion Bangladesh Bank Address
            }
            else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_CONFIG.CURRENCY).PadLeft(5, '0')))
            {
                #region Currency
                lgText.InnerHtml = "Currency Approval Queue List";
                CurrencyDAL     oCurrencyDAL = new CurrencyDAL();
                TemplateBuilder tbGvData     = new TemplateBuilder();
                tbGvData.AppendLiteralString("No 'Currency' record found");
                gvData.EmptyDataTemplate = tbGvData;

                Result oResult = oCurrencyDAL.LoadUnapprovedList(null, true);
                if (oResult.Status)
                {
                    DataTable dtTmpList = (DataTable)oResult.Return;
                    if (dtTmpList != null)
                    {
                        if (dtTmpList.Rows.Count > 0)
                        {
                            gvData.DataSource = dtTmpList;
                            gvData.DataBind();

                            Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList;

                            this.gvData.HeaderRow.Cells[1].Text = "Currency ID";
                            this.gvData.HeaderRow.Cells[2].Text = "Currency Code";
                            this.gvData.HeaderRow.Cells[3].Text = "Currency Symbol";
                            this.gvData.HeaderRow.Cells[4].Text = "Currency Description";
                            this.gvData.HeaderRow.Cells[5].Text = "Maker ID";
                            this.gvData.HeaderRow.Cells[6].Text = "Make Date";
                        }
                    }
                }
                #endregion Currency
            }
            else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_CONFIG.CURRENCY_WISE_ACCOUNT_MAPPING).PadLeft(5, '0')))
            {
                #region Currency Wise Account Mapping
                lgText.InnerHtml = "Currency Wise Account Mapping Approval Queue List";
                CurrencyWiseAccountMappingDAL oCurrencyWiseAccountMappingDAL = new CurrencyWiseAccountMappingDAL();
                TemplateBuilder tbGvData = new TemplateBuilder();
                tbGvData.AppendLiteralString("No 'Currency Wise Account Mapping ' record found");
                gvData.EmptyDataTemplate = tbGvData;

                Result oResult = oCurrencyWiseAccountMappingDAL.LoadUnapprovedList(null, true);
                if (oResult.Status)
                {
                    DataTable dtTmpList = (DataTable)oResult.Return;
                    if (dtTmpList != null)
                    {
                        if (dtTmpList.Rows.Count > 0)
                        {
                            // for adding seperator....
                            alAddSeperatorIndex = new ArrayList();
                            alAddSeperatorIndex.Add(3);
                            alAddSeperatorIndex.Add(4);
                            alAddSeperatorIndex.Add(5);
                            alAddSeperatorIndex.Add(6);
                            alAddSeperatorIndex.Add(7);

                            dtTmpList.Columns.Remove("SuspenseAccName");
                            dtTmpList.Columns.Remove("ForeignExchangeAccName");
                            dtTmpList.Columns.Remove("BranchFxAccName");
                            dtTmpList.Columns.Remove("BranchExFxAccName");
                            dtTmpList.Columns.Remove("BangladesgBankAccName");

                            gvData.DataSource = dtTmpList;
                            gvData.DataBind();

                            Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList;

                            this.gvData.HeaderRow.Cells[1].Text = "Currency ID";
                            this.gvData.HeaderRow.Cells[2].Text = "Currency Code";
                            this.gvData.HeaderRow.Cells[3].Text = "Suspense Acc";
                            this.gvData.HeaderRow.Cells[4].Text = "Foreign Exchange Acc";
                            this.gvData.HeaderRow.Cells[5].Text = "Branch Fx Acc";
                            this.gvData.HeaderRow.Cells[6].Text = "Branch Ex Fx Acc";
                            this.gvData.HeaderRow.Cells[7].Text = "Bangladesg Bank Acc";
                            this.gvData.HeaderRow.Cells[8].Text = "Maker ID";
                            this.gvData.HeaderRow.Cells[9].Text = "Make Date";
                        }
                    }
                }
                #endregion Currency Wise Account Mapping
            }
            else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_CONFIG.CUSTOMER_DETAIL).PadLeft(5, '0')))
            {
                #region Customer Detail
                lgText.InnerHtml = "Customer Detail Approval Queue List";
                CustomerDetailsDAL oCustomerDetailsDAL = new CustomerDetailsDAL();
                TemplateBuilder    tbGvData            = new TemplateBuilder();
                tbGvData.AppendLiteralString("No 'Customer Detail' record found");
                gvData.EmptyDataTemplate = tbGvData;

                Result oResult = oCustomerDetailsDAL.LoadUnapprovedList(null, true);
                if (oResult.Status)
                {
                    DataTable dtTmpList = (DataTable)oResult.Return;
                    if (dtTmpList != null)
                    {
                        if (dtTmpList.Rows.Count > 0)
                        {
                            gvData.DataSource = dtTmpList;
                            gvData.DataBind();

                            Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList;

                            this.gvData.HeaderRow.Cells[1].Text = "Customer ID";
                            this.gvData.HeaderRow.Cells[2].Text = "Customer Name";
                            this.gvData.HeaderRow.Cells[3].Text = "Date of Birth";
                            this.gvData.HeaderRow.Cells[4].Text = "Address";
                            this.gvData.HeaderRow.Cells[5].Text = "Phone";
                            this.gvData.HeaderRow.Cells[6].Text = "Email";
                            this.gvData.HeaderRow.Cells[7].Text = "Maker ID";
                            this.gvData.HeaderRow.Cells[8].Text = "Make Date";
                        }
                    }
                }
                #endregion Customer Detail
            }
            else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_CONFIG.CUSTOMER_TYPE).PadLeft(5, '0')))
            {
                #region Customer Type
                lgText.InnerHtml = "Customer Type Approval Queue List";
                CustomerTypeDAL oCustomerTypeDAL = new CustomerTypeDAL();
                TemplateBuilder tbGvData         = new TemplateBuilder();
                tbGvData.AppendLiteralString("No 'Customer Type' record found");
                gvData.EmptyDataTemplate = tbGvData;

                Result oResult = oCustomerTypeDAL.LoadUnapprovedList(null, true);
                if (oResult.Status)
                {
                    DataTable dtTmpList = (DataTable)oResult.Return;
                    if (dtTmpList != null)
                    {
                        if (dtTmpList.Rows.Count > 0)
                        {
                            gvData.DataSource = dtTmpList;
                            gvData.DataBind();

                            Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList;

                            this.gvData.HeaderRow.Cells[1].Text = "Customer Type ID";
                            this.gvData.HeaderRow.Cells[2].Text = "Customer Type Description";
                            this.gvData.HeaderRow.Cells[3].Text = "Max Members";
                            this.gvData.HeaderRow.Cells[4].Text = "Is Organization";
                            this.gvData.HeaderRow.Cells[5].Text = "Maker ID";
                            this.gvData.HeaderRow.Cells[6].Text = "Make Date";
                        }
                    }
                }
                #endregion Customer Type
            }
            else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_CONFIG.CUSTOMER_TYPE_WISE_SP_LIMIT).PadLeft(5, '0')))
            {
                #region Customer Type wise SP Type Maping
                lgText.InnerHtml = "Customer Type wise SP Type Maping Approval Queue List";

                CustomerTypeWiseSPLimitDAL oCustomerTypeWiseSPLimitDAL = new CustomerTypeWiseSPLimitDAL();
                TemplateBuilder            tbGvData = new TemplateBuilder();
                tbGvData.AppendLiteralString("No 'Customer Type wise Sp Type Maping' record found");
                gvData.EmptyDataTemplate = tbGvData;

                Result oResult = oCustomerTypeWiseSPLimitDAL.LoadUnapprovedList(null, true);
                if (oResult.Status)
                {
                    DataTable dtTmpList = (DataTable)oResult.Return;
                    if (dtTmpList != null)
                    {
                        if (dtTmpList.Rows.Count > 0)
                        {
                            gvData.DataSource = dtTmpList;
                            gvData.DataBind();

                            Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList;

                            this.gvData.HeaderRow.Cells[1].Text = "Customer Type ID";
                            this.gvData.HeaderRow.Cells[2].Text = "Customer Type";
                            this.gvData.HeaderRow.Cells[3].Text = "SP Type";
                            this.gvData.HeaderRow.Cells[4].Text = "Minimum Limit";
                            this.gvData.HeaderRow.Cells[5].Text = "Maximum Limit";
                            this.gvData.HeaderRow.Cells[6].Text = "Maker ID";
                            this.gvData.HeaderRow.Cells[7].Text = "Make Date";
                        }
                    }
                }
                #endregion Customer Type wise SP Type Maping
            }
            else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_CONFIG.DIVISION).PadLeft(5, '0')))
            {
                #region Area Approval
                lgText.InnerHtml = "Area Approval Queue List";
                DivisionDAL     oDivisionDAL = new DivisionDAL();
                TemplateBuilder tbGvData     = new TemplateBuilder();
                tbGvData.AppendLiteralString("No 'Area' record found");
                gvData.EmptyDataTemplate = tbGvData;

                Result oResult = oDivisionDAL.LoadUnapprovedList(null, true);
                if (oResult.Status)
                {
                    DataTable dtTmpList = (DataTable)oResult.Return;
                    if (dtTmpList != null)
                    {
                        if (dtTmpList.Rows.Count > 0)
                        {
                            dtTmpList.Columns.Remove("BranchID");

                            gvData.DataSource = dtTmpList;
                            gvData.DataBind();

                            Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList;

                            this.gvData.HeaderRow.Cells[1].Text = "Area ID";
                            this.gvData.HeaderRow.Cells[2].Text = "BB Code";
                            this.gvData.HeaderRow.Cells[3].Text = "Area Name";
                            this.gvData.HeaderRow.Cells[4].Text = "Address";
                            this.gvData.HeaderRow.Cells[5].Text = "Maker ID";
                            this.gvData.HeaderRow.Cells[6].Text = "Make Date";
                        }
                    }
                }
                #endregion Area Approval
            }
            else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_CONFIG.SP_CERTIFICATE).PadLeft(5, '0')))
            {
                #region Script Mapping Certificate
                lgText.InnerHtml = "Script Mapping Certificate Approval Queue List";
                ScripMappingDAL oScripMappingDAL = new ScripMappingDAL();
                TemplateBuilder tbGvData         = new TemplateBuilder();
                tbGvData.AppendLiteralString("No 'Script Mapping Certificate' record found");
                gvData.EmptyDataTemplate = tbGvData;

                Result oResult = oScripMappingDAL.LoadUnapprovedList(null, true);
                if (oResult.Status)
                {
                    DataTable dtTmpList = (DataTable)oResult.Return;
                    if (dtTmpList != null)
                    {
                        if (dtTmpList.Rows.Count > 0)
                        {
                            dtTmpList = DDListUtil.MapTableWithXML(dtTmpList, "ScriptFormatMapping", "ReportType", "SP", 2);

                            gvData.DataSource = dtTmpList;
                            gvData.DataBind();

                            Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList;

                            this.gvData.HeaderRow.Cells[1].Text = "SP Type";
                            this.gvData.HeaderRow.Cells[2].Text = "Denomination";
                            this.gvData.HeaderRow.Cells[3].Text = "Script Format";
                            this.gvData.HeaderRow.Cells[4].Text = "Maker ID";
                            this.gvData.HeaderRow.Cells[5].Text = "Maker Date";
                        }
                    }
                }
                #endregion Script Mapping Certificate
            }
            else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_CONFIG.SP_POLICY).PadLeft(5, '0')))
            {
                #region SP Policy
                lgText.InnerHtml = "SP Policy Approval Queue List";
                SPPolicyDAL     oSPPolicyDAL = new SPPolicyDAL();
                TemplateBuilder tbGvData     = new TemplateBuilder();
                tbGvData.AppendLiteralString("No 'SP Policy' record found");
                gvData.EmptyDataTemplate = tbGvData;

                Result oResult = oSPPolicyDAL.LoadUnapprovedList(null, true);
                if (oResult != null)
                {
                    DataTable dtTmpList = (DataTable)oResult.Return;
                    if (dtTmpList != null)
                    {
                        if (dtTmpList.Rows.Count > 0)
                        {
                            dtTmpList.Columns.Remove("CheckerID");
                            dtTmpList.Columns.Remove("CheckDate");
                            dtTmpList.Columns.Remove("CheckerComment");
                            dtTmpList.Columns.Remove("PolicyEffectDate");
                            dtTmpList.Columns.Remove("IsSPDurationInMonth");
                            dtTmpList.Columns.Remove("SPInterestType");
                            dtTmpList.Columns.Remove("InterestTypeAfterIntPayment");
                            dtTmpList.Columns.Remove("PreMaturityInterestType");
                            dtTmpList.Columns.Remove("PreMatIntTypeAfterIntPayment");
                            dtTmpList.Columns.Remove("IsNomineePerScripRequired");
                            dtTmpList.Columns.Remove("IsBondHolderRequired");
                            dtTmpList.Columns.Remove("IsFoeignAddressRequired");
                            dtTmpList.Columns.Remove("SupportedSex");
                            dtTmpList.Columns.Remove("PartiallyEncashable");
                            dtTmpList.Columns.Remove("ReinvestmentSuported");
                            dtTmpList.Columns.Remove("InterestReinvestable");
                            dtTmpList.Columns.Remove("PartiallyEncashedReinvestable");
                            dtTmpList.Columns.Remove("MaxNoOfReinvestment");
                            dtTmpList.Columns.Remove("NonOrgCommission");
                            dtTmpList.Columns.Remove("NonOrgCommissionType");
                            dtTmpList.Columns.Remove("OrgCommission");
                            dtTmpList.Columns.Remove("OrgCommissionType");
                            dtTmpList.Columns.Remove("Levi");
                            dtTmpList.Columns.Remove("LeviType");
                            dtTmpList.Columns.Remove("IncomeTax");
                            dtTmpList.Columns.Remove("IncomeTaxType");
                            dtTmpList.Columns.Remove("IncomeTaxApplyAmount");
                            dtTmpList.Columns.Remove("IncomeTaxYearlyYN");
                            dtTmpList.Columns.Remove("IsOrganizationLeviTax");
                            dtTmpList.Columns.Remove("InterestRemuneration");
                            dtTmpList.Columns.Remove("InterestRemunerationType");
                            dtTmpList.Columns.Remove("Remuneration");
                            dtTmpList.Columns.Remove("RemunerationType");

                            gvData.DataSource = dtTmpList;
                            gvData.DataBind();

                            Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList;

                            this.gvData.HeaderRow.Cells[1].Text = "Policy ID";
                            this.gvData.HeaderRow.Cells[2].Text = "SP Type";
                            this.gvData.HeaderRow.Cells[3].Text = "SP Duration";
                            this.gvData.HeaderRow.Cells[4].Text = "No Of Coupons";
                            this.gvData.HeaderRow.Cells[5].Text = "Minimum Age";
                            this.gvData.HeaderRow.Cells[6].Text = "Maximum Age";
                            this.gvData.HeaderRow.Cells[7].Text = "Is Approved";
                            this.gvData.HeaderRow.Cells[8].Text = "Maker ID";
                            this.gvData.HeaderRow.Cells[9].Text = "Make Date";
                        }
                    }
                }
                #endregion SP Policy
            }
            else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_CONFIG.SP_REPORT).PadLeft(5, '0')))
            {
                #region Report Mapping
                lgText.InnerHtml = "Report Mapping Approval Queue List";
                SPReportMappingDAL oSPReportMappingDAL = new SPReportMappingDAL();
                TemplateBuilder    tbGvData            = new TemplateBuilder();
                tbGvData.AppendLiteralString("No 'Report Mapping' record found");
                gvData.EmptyDataTemplate = tbGvData;

                Result oResult = oSPReportMappingDAL.LoadUnapprovedList(null, true);
                if (oResult.Status)
                {
                    DataTable dtTmpList = (DataTable)oResult.Return;
                    if (dtTmpList != null)
                    {
                        if (dtTmpList.Rows.Count > 0)
                        {
                            DataTable dtMappedData = null;

                            dtMappedData = DDListUtil.MapTableWithXML(dtTmpList, "ReportFormatMapping", "ReportType", "SS", 1);
                            dtMappedData = DDListUtil.MapTableWithXML(dtMappedData, "ReportFormatMapping", "ReportType", "CC", 2);
                            dtMappedData = DDListUtil.MapTableWithXML(dtMappedData, "ReportFormatMapping", "ReportType", "IC", 3);
                            dtMappedData = DDListUtil.MapTableWithXML(dtMappedData, "ReportFormatMapping", "ReportType", "EC", 4);

                            gvData.DataSource = dtMappedData;
                            gvData.DataBind();

                            Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtMappedData;

                            this.gvData.HeaderRow.Cells[1].Text = "SP Type";
                            this.gvData.HeaderRow.Cells[2].Text = "Sales Statemet";
                            this.gvData.HeaderRow.Cells[3].Text = "Commission Claim";
                            this.gvData.HeaderRow.Cells[4].Text = "Interest Claim ";
                            this.gvData.HeaderRow.Cells[5].Text = "Encashment Claim";
                            this.gvData.HeaderRow.Cells[6].Text = "Maker ID";
                            this.gvData.HeaderRow.Cells[7].Text = "Maker Date";
                        }
                    }
                }
                #endregion Report Mapping
            }
            else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_CONFIG.SP_TYPE).PadLeft(5, '0')))
            {
                #region Sanchaya Patra Type
                lgText.InnerHtml = "Sanchaya Patra Type Approval Queue List";
                SPTypeDAL       oSPTypeDAL = new SPTypeDAL();
                TemplateBuilder tbGvData   = new TemplateBuilder();
                tbGvData.AppendLiteralString("No 'Sanchaya Patra Type' record found");
                gvData.EmptyDataTemplate = tbGvData;

                Result oResult = oSPTypeDAL.LoadTmpDataTableList();
                if (oResult.Status)
                {
                    DataTable dtTmpList = (DataTable)oResult.Return;
                    if (dtTmpList != null)
                    {
                        if (dtTmpList.Rows.Count > 0)
                        {
                            gvData.DataSource = dtTmpList;
                            gvData.DataBind();

                            Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList;

                            this.gvData.HeaderRow.Cells[1].Text = "SP Type";
                            this.gvData.HeaderRow.Cells[2].Text = "Type Description";
                            this.gvData.HeaderRow.Cells[3].Text = "Currency Code";
                            this.gvData.HeaderRow.Cells[4].Text = "Maker ID";
                            this.gvData.HeaderRow.Cells[5].Text = "Make Date";
                        }
                    }
                }
                #endregion Sanchaya Patra Type
            }
            else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_CONFIG.SP_WISEA_CCOUNT).PadLeft(5, '0')))
            {
                #region Sanchaya Patra wise Account Mapping
                lgText.InnerHtml = "Sanchaya Patra wise Account Mapping Approval Queue List";
                SPTypeWiseAccountMappingDAL oSPTypeWiseAccountMappingDAL = new SPTypeWiseAccountMappingDAL();
                TemplateBuilder             tbGvData = new TemplateBuilder();
                tbGvData.AppendLiteralString("No 'Sanchaya Patra wise Account Mapping' record found");
                gvData.EmptyDataTemplate = tbGvData;

                Result oResult = oSPTypeWiseAccountMappingDAL.LoadUnapprovedList(null, true);
                if (oResult.Status)
                {
                    DataTable dtTmpList = (DataTable)oResult.Return;
                    if (dtTmpList != null)
                    {
                        if (dtTmpList.Rows.Count > 0)
                        {
                            // for adding seperator....
                            alAddSeperatorIndex = new ArrayList();
                            alAddSeperatorIndex.Add(2);
                            alAddSeperatorIndex.Add(3);
                            alAddSeperatorIndex.Add(4);
                            alAddSeperatorIndex.Add(5);
                            alAddSeperatorIndex.Add(6);
                            alAddSeperatorIndex.Add(7);

                            dtTmpList.Columns.Remove("StockInHandAccName");
                            dtTmpList.Columns.Remove("LiabilityOnStockAccName");
                            dtTmpList.Columns.Remove("HoldingAccName");
                            dtTmpList.Columns.Remove("AccruedInterestAccName");
                            dtTmpList.Columns.Remove("AdvAgainstInterestAccName");
                            dtTmpList.Columns.Remove("AdvAgainstPrincipalAccName");
                            dtTmpList.Columns.Remove("CheckerID");
                            dtTmpList.Columns.Remove("CheckDate");
                            dtTmpList.Columns.Remove("CheckerComment");

                            gvData.DataSource = dtTmpList;
                            gvData.DataBind();

                            Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList;

                            this.gvData.HeaderRow.Cells[1].Text = "SPType ID";
                            this.gvData.HeaderRow.Cells[2].Text = "Stock In Hand Acc";
                            this.gvData.HeaderRow.Cells[3].Text = "Liability On  Stock Acc";
                            this.gvData.HeaderRow.Cells[4].Text = "Holding Acc";
                            this.gvData.HeaderRow.Cells[5].Text = "Accrued Interest Acc";
                            this.gvData.HeaderRow.Cells[6].Text = "AdvAgainst Interest Acc";
                            this.gvData.HeaderRow.Cells[7].Text = "Adv Against Principal Acc";
                            this.gvData.HeaderRow.Cells[8].Text = "Maker ID";
                            this.gvData.HeaderRow.Cells[9].Text = "Make Date";
                        }
                    }
                }
                #endregion Sanchaya Patra wise Account Mapping
            }
            else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_CONFIG.SYSTEM_CONFIG).PadLeft(5, '0')))
            {
                #region System Configuration
                lgText.InnerHtml = "System Configuration Approval Queue List";
                SystemConfigurationDAL oSCDAL   = new SystemConfigurationDAL();
                TemplateBuilder        tbGvData = new TemplateBuilder();
                tbGvData.AppendLiteralString("No 'System Configuration' record found");
                gvData.EmptyDataTemplate = tbGvData;

                Result oResult = oSCDAL.LoadUnapprovedList(null, true);
                if (oResult.Status)
                {
                    DataTable dtTmpList = (DataTable)oResult.Return;
                    if (dtTmpList != null)
                    {
                        if (dtTmpList.Rows.Count > 0)
                        {
                            dtTmpList.Columns.Remove("Dr_Code");
                            dtTmpList.Columns.Remove("Cr_Code");

                            gvData.DataSource = dtTmpList;
                            gvData.DataBind();

                            Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList;

                            this.gvData.HeaderRow.Cells[1].Text = "Customer Data File";
                            this.gvData.HeaderRow.Cells[2].Text = "Originator ID";
                            this.gvData.HeaderRow.Cells[3].Text = "Row Type Header";
                            this.gvData.HeaderRow.Cells[4].Text = "Row Type Footer";
                            this.gvData.HeaderRow.Cells[5].Text = "Dr Transaction Code";
                            this.gvData.HeaderRow.Cells[6].Text = "Cr Transaction Code";
                            this.gvData.HeaderRow.Cells[7].Text = "Maker ID";
                            this.gvData.HeaderRow.Cells[8].Text = "Make Date";
                        }
                    }
                }
                #endregion System Configuration
            }

            else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_CONFIG.COMMON_MAPPING).PadLeft(5, '0')))
            {
                #region Common Mapping
                lgText.InnerHtml = "Common Mapping Approval Queue List";
                CommonMappingDAL oCmAL    = new CommonMappingDAL();
                TemplateBuilder  tbGvData = new TemplateBuilder();
                tbGvData.AppendLiteralString("No 'Common Mapping' record found");
                gvData.EmptyDataTemplate = tbGvData;

                Result oResult = oCmAL.LoadUnapprovedList(null, true);
                if (oResult.Status)
                {
                    DataTable dtTmpList = (DataTable)oResult.Return;
                    if (dtTmpList != null)
                    {
                        if (dtTmpList.Rows.Count > 0)
                        {
                            alAddSeperatorIndex = new ArrayList();
                            alAddSeperatorIndex.Add(3);

                            gvData.DataSource = dtTmpList;
                            gvData.DataBind();

                            Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList;

                            this.gvData.HeaderRow.Cells[1].Text = "Currency ID";
                        }
                    }
                }
                #endregion Common Mapping
            }

            else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_CONFIG.BANK).PadLeft(5, '0')))
            {
                #region Common Mapping
                lgText.InnerHtml = "Bank Setup Approval Queue List";
                BankDAL         oBankDAL = new BankDAL();
                TemplateBuilder tbGvData = new TemplateBuilder();
                tbGvData.AppendLiteralString("No 'Bank Setup' record found");
                gvData.EmptyDataTemplate = tbGvData;

                Result oResult = oBankDAL.LoadUnapprovedList(null, true);
                if (oResult.Status)
                {
                    DataTable dtTmpList = (DataTable)oResult.Return;
                    if (dtTmpList != null)
                    {
                        if (dtTmpList.Rows.Count > 0)
                        {
                            gvData.DataSource = dtTmpList;
                            gvData.DataBind();

                            this.gvData.HeaderRow.Cells[1].Text = "Bank ID";
                            this.gvData.HeaderRow.Cells[2].Text = "BB Code";
                            this.gvData.HeaderRow.Cells[3].Text = "Bank Name";
                            this.gvData.HeaderRow.Cells[4].Text = "Branch ID";
                            this.gvData.HeaderRow.Cells[5].Text = "Address";
                            this.gvData.HeaderRow.Cells[6].Text = "Maker ID";
                            this.gvData.HeaderRow.Cells[7].Text = "Make Date";

                            Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList;
                        }
                    }
                }
                #endregion Common Mapping
            }
        }
    }
Example #17
0
        public DataTable SelectAll()
        {
            BranchDAL dalBranch = new BranchDAL();

            return(dalBranch.SelectAll());
        }
Example #18
0
    protected void createButton_Click(object sender, EventArgs e)
    {
        User u = (User)Session["user"];

        if (u == null)
        {
            Response.Write("<script>alert('invalid user 1.');window.opener=null;window.close();</script>");
            return;
        }

        if (v == null)
        {
            Response.Write("<script>alert('invalid vid in create.');window.opener=null;window.close();</script>");
            return;
        }

        if (u.user_id != v.user_id)
        {
            Response.Write("<script>alert('invalid user.');window.opener=null;window.close();</script>");
            return;
        }

        if (name.Value.Length == 0 || desc.Value.Length == 0)
        {
            //error
            Response.Write("<script>alert('invalid name or desc.');</script>");
            return;
        }

        //new version
        Version v2 = new Version();

        v2.version_name = name.Value;
        v2.description  = desc.Value;
        v2.prev_id      = v.version_id; //!
        v2.next_id      = v.next_id;    //!
        v2.warehouse_id = v.warehouse_id;
        v2.user_id      = v.user_id;
        v2.branch_id    = v.branch_id;

        if (!vd.Insert(ref v2))
        {
            Response.Write("<script>alert('insert error 1.');</script>");
            return;
        }

        Version v3 = new Version();

        v3.branch_id    = v.branch_id;
        v3.description  = v.description;
        v3.next_id      = v2.version_id; //warning
        v3.prev_id      = v.prev_id;     //warning
        v3.timestamp    = v.timestamp;
        v3.user_id      = v.user_id;
        v3.version_id   = v.version_id;
        v3.version_name = v.version_name;
        v3.warehouse_id = v.warehouse_id;
        if (!vd.Update(ref v3))
        {
            Response.Write("<script>alert('error 3.');</script>");
            vd.Delete(ref v2);
            vd.Update(ref v);
            return;
        }

        //create files
        if (!FileSystem.CopyFolder(Server.MapPath("~/") + @"data\" + v.warehouse_id.ToString() + @"\" + v.version_id.ToString(), Server.MapPath("~/") + @"data\" + v.warehouse_id.ToString() + @"\" + v2.version_id.ToString()))
        {
            vd.Delete(ref v2);
            vd.Update(ref v);
            Response.Write("<script>alert('file error.');</script>");
            return;
        }

        //warnning ; bug here
        Branch b = new Branch();

        b.branch_id = v.branch_id;
        bd          = new BranchDAL();
        bd.SelectByID(ref b);
        if (b.branch_name == "master")
        {
            Warehouse w = new Warehouse();
            w.warehouse_id = v.warehouse_id;
            wd             = new WarehouseDAL();
            wd.SelectedByID(ref w);
            if (w.master_version_id == v.version_id)
            {
                w.master_version_id = v2.version_id;
                wd.Update(ref w);
            }
        }

        Response.Write("<script>alert('create success.');window.location.href='warehouse_page.aspx?wid=" + v.warehouse_id + "&vid=" + v2.version_id + "';</script>");
    }
Example #19
0
        public BranchENT SelectByPK(SqlInt32 BranchID)
        {
            BranchDAL dalBranch = new BranchDAL();

            return(dalBranch.SelectByPK(BranchID));
        }
Example #20
0
        public DataTable SelectDropDownList()
        {
            BranchDAL dalBranch = new BranchDAL();

            return(dalBranch.SelectDropDownList());
        }