Exemplo n.º 1
0
        protected void GetParameter()
        {
            A2ZGLPARAMETERDTO dto = A2ZGLPARAMETERDTO.GetParameterValue();

            txtBegMonth.Text  = Converter.GetString(dto.FinancialMonth);
            txtGLPLCode.Text  = Converter.GetString(dto.PLCode);
            txtLYrPLCode.Text = Converter.GetString(dto.UDPLCode);
        }
Exemplo n.º 2
0
 protected void btnExit_Click(object sender, EventArgs e)
 {
     A2ZGLPARAMETERDTO.UpdateSingleUserFlag(0);
     if (CtrlProcFlag.Text == "0" || CtrlProcFlag.Text == "")
     {
         Response.Redirect("A2ZERPModule.aspx");
     }
     else
     {
         Response.Redirect("A2ZStartUp.aspx");
     }
 }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    lblUserName.Text = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_NAME));

                    var p = A2ZERPSYSPRMDTO.GetParameterValue();
                    lblCompanyName.Text = p.PrmUnitName;

                    GetMenuData();

                    A2ZGLPARAMETERDTO dto = A2ZGLPARAMETERDTO.GetParameterValue();
                    lblProcessDate.Text = Converter.GetString(dto.ProcessDate.ToLongDateString());

                    //if (DataAccessLayer.Utility.Converter.GetSmallInteger(SessionStore.GetValue(Params.SYS_USER_PERMISSION)) == 10)
                    //{
                    //    lblUserPermission.Text = "Permission :" + "Input";
                    //}
                    //if (DataAccessLayer.Utility.Converter.GetSmallInteger(SessionStore.GetValue(Params.SYS_USER_PERMISSION)) == 20)
                    //{
                    //    lblUserPermission.Text = "Permission :" + "Checked and Verify";
                    //}
                    //if (DataAccessLayer.Utility.Converter.GetSmallInteger(SessionStore.GetValue(Params.SYS_USER_PERMISSION)) == 30)
                    //{
                    //    lblUserPermission.Text = "Permission :" + "Approved";
                    //}

                    hdnCashCode.Value = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_GLCASHCODE));
                    string    qry = "SELECT GLAccDesc FROM A2ZCGLMST where GLAccNo='" + hdnCashCode.Value + "'";
                    DataTable dt  = DataAccessLayer.BLL.CommonManager.Instance.GetDataTableByQuery(qry, "A2ZGLMCUS");
                    if (dt.Rows.Count > 0)
                    {
                        lblBoothNo.Text   = hdnCashCode.Value;
                        lblBoothName.Text = Converter.GetString(dt.Rows[0]["GLAccDesc"]);
                    }
                }
                else
                {
                    this.Page.MaintainScrollPositionOnPostBack = true;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemplo n.º 4
0
        protected void BtnUpdate_Click(object sender, EventArgs e)
        {
            A2ZGLPARAMETERDTO objDTO = new A2ZGLPARAMETERDTO();

            objDTO.FinancialMonth = Converter.GetSmallInteger(txtBegMonth.Text);
            objDTO.PLCode         = Converter.GetInteger(txtGLPLCode.Text);
            objDTO.UDPLCode       = Converter.GetInteger(txtLYrPLCode.Text);

            int roweffect = A2ZGLPARAMETERDTO.UpdateInformation(objDTO);

            if (roweffect > 0)
            {
                ClearInfo();
                Sucessfull();
            }
        }
        protected void txtTranDate_TextChanged(object sender, EventArgs e)
        {
            A2ZGLPARAMETERDTO dto     = A2ZGLPARAMETERDTO.GetParameterValue();
            DateTime          opdate2 = Converter.GetDateTime(dto.ProcessDate);
            int Begyear = Converter.GetInteger(dto.FinancialBegYear);


            DateTime opdate1 = DateTime.ParseExact(txtTranDate.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);

            int Iyear  = opdate1.Year;
            int Imonth = opdate1.Month;

            if (Iyear < Begyear)
            {
                InvalidFinDateMSG();
                txtTranDate.Text = string.Empty;
                txtTranDate.Text = CtrlTrnDate.Text;
                txtTranDate.Focus();
            }

            if (Iyear == Begyear && Imonth < 7)
            {
                InvalidFinDateMSG();
                txtTranDate.Text = string.Empty;
                txtTranDate.Text = CtrlTrnDate.Text;
                txtTranDate.Focus();
            }

            if (opdate1 > opdate2)
            {
                InvalidDateMSG();
                txtTranDate.Text = string.Empty;
                txtTranDate.Text = CtrlTrnDate.Text;
                txtTranDate.Focus();
            }

            if (opdate1 == opdate2)
            {
                InvalidCurrentMSG();
                txtTranDate.Text = string.Empty;
                txtTranDate.Text = CtrlTrnDate.Text;
                txtTranDate.Focus();
            }
        }
Exemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                hdnPrmValue.Text = Request.QueryString["a%b"];
                string b = hdnPrmValue.Text;
                HdnModule.Text = b;

                lblCashCode.Text = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_GLCASHCODE));

                A2ZGLPARAMETERDTO dto  = A2ZGLPARAMETERDTO.GetParameterValue();
                DateTime          dt   = Converter.GetDateTime(dto.ProcessDate);
                string            date = dt.ToString("dd/MM/yyyy");
                CtrlTrnDate.Text = date;

                txtVoucherNo.Focus();
                BtnDelete.Visible = false;
                BtnCancel.Visible = false;
            }
        }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    var dt = A2ZGLPARAMETERDTO.GetParameterValue();
                    txtBegYear.Text = Converter.GetString(dt.FinancialBegYear);
                    txtEndYear.Text = Converter.GetString(dt.FinancialEndYear);
                    A2ZERPSYSPRMDTO dto = A2ZERPSYSPRMDTO.GetParameterValue();
                    hdndatapath.Text = Converter.GetString(dto.PrmDataPath);

                    //btnProcess.Enabled = false;
                }
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.Page_Load Problem');</script>");
                //throw ex;
            }
        }
Exemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    lblUserName.Text = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_NAME));

                    var p = A2ZERPSYSPRMDTO.GetParameterValue();
                    lblCompanyName.Text = p.PrmUnitName;

                    //    GetMenuData();

                    A2ZGLPARAMETERDTO dto = A2ZGLPARAMETERDTO.GetParameterValue();
                    lblProcessDate.Text = DataAccessLayer.Utility.Converter.GetString(dto.ProcessDate.ToLongDateString());

                    //if (DataAccessLayer.Utility.Converter.GetSmallInteger(SessionStore.GetValue(Params.SYS_USER_PERMISSION)) == 10)
                    //{
                    //    lblUserPermission.Text = "Permission :" + "Input";
                    //}
                    //if (DataAccessLayer.Utility.Converter.GetSmallInteger(SessionStore.GetValue(Params.SYS_USER_PERMISSION)) == 20)
                    //{
                    //    lblUserPermission.Text = "Permission :" + "Checked and Verify";
                    //}
                    //if (DataAccessLayer.Utility.Converter.GetSmallInteger(SessionStore.GetValue(Params.SYS_USER_PERMISSION)) == 30)
                    //{
                    //    lblUserPermission.Text = "Permission :" + "Approved";
                    //}
                }
                else
                {
                    this.Page.MaintainScrollPositionOnPostBack = true;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemplo n.º 9
0
        protected void CashGLAccBalance()
        {
            ValidityFlag.Text = "0";

            var prm = new object[3];

            A2ZGLPARAMETERDTO dto   = A2ZGLPARAMETERDTO.GetParameterValue();
            DateTime          date  = Converter.GetDateTime(dto.ProcessDate);
            string            Tdate = date.ToString("dd/MM/yyyy");


            int Code = Converter.GetInteger(lblCashCode.Text);

            prm[0] = Code;
            prm[1] = Converter.GetDateToYYYYMMDD(Tdate);

            prm[2] = 0;
            //prm[3] = UId;
            DataTable dt = CommonManager.Instance.GetDataTableBySpWithParams("SpM_GlAccountBalanceSingle", prm, "A2ZGLMCUS");

            if (dt.Rows.Count > 0)
            {
                lblGLAccBal.Text = Converter.GetString(String.Format("{0:0,0.00}", Converter.GetDecimal(dt.Rows[0]["GLOpBal"])));

                lblGLBalanceType.Text = Converter.GetString(dt.Rows[0]["GLBalanceType"]);

                double AvailAmt = Converter.GetDouble(lblGLAccBal.Text);
                double InputAmt = Converter.GetDouble(lblVchAmt.Text);

                if (lblGLBalanceType.Text != "1" && InputAmt > AvailAmt)
                {
                    ValidityFlag.Text = "2";
                    return;
                }
            }
        }
Exemplo n.º 10
0
        protected void CashGLAccBalance()
        {
            ValidityFlag.Text = "0";

            var prm = new object[4];

            A2ZGLPARAMETERDTO dto   = A2ZGLPARAMETERDTO.GetParameterValue();
            DateTime          date  = Converter.GetDateTime(dto.ProcessDate);
            string            Tdate = date.ToString("dd/MM/yyyy");

            int Code = Converter.GetInteger(lblCashCode.Text);
            int UId  = Converter.GetInteger(hdnID.Text);

            prm[0] = Code;
            prm[1] = Converter.GetDateToYYYYMMDD(Tdate);
            prm[2] = Converter.GetDateToYYYYMMDD(Tdate);
            prm[3] = UId;

            int result = Converter.GetInteger(CommonManager.Instance.GetScalarValueBySp("Sp_GlGenerateAccountBalanceSingle", prm, "A2ZGLMCUS"));

            A2ZCGLMSTDTO glObj = A2ZCGLMSTDTO.GetInformation(Code);

            if (glObj.GLAccNo > 0)
            {
                lblGLAccBal.Text      = Converter.GetString(String.Format("{0:0,0.00}", glObj.GLClBal));
                lblGLBalanceType.Text = Converter.GetString(glObj.GLBalanceType);
                double AvailAmt = Converter.GetDouble(lblGLAccBal.Text);
                double InputAmt = Converter.GetDouble(lblVchAmt.Text);

                if (lblGLBalanceType.Text != "1" && InputAmt > AvailAmt)
                {
                    ValidityFlag.Text = "2";
                    return;
                }
            }
        }
Exemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    int userPermission = Converter.GetInteger(SessionStore.GetValue(Params.SYS_USER_PERMISSION));

                    //if (userPermission != 30)
                    //{
                    //    string notifyMsg = "?txtOne=" + Converter.GetString(SessionStore.GetValue(Params.SYS_USER_NAME)) + "&txtTwo=" + "You Don't Have Permission for Approve" +
                    //                       "&txtThree=" + "Contact Your Super User" + "&PreviousMenu=A2ZERPModule.aspx";
                    //    Server.Transfer("Notify.aspx" + notifyMsg);
                    //}

                    int checkAllUser = DataAccessLayer.DTO.A2ZSYSIDSDTO.CountForSingleUserPurpose(Converter.GetSmallInteger(SessionStore.GetValue(Params.SYS_USER_ID)), "A2ZGLMCUS");

                    if (checkAllUser > 0)
                    {
                        string strQuery = "SELECT IdsNo, IdsName, EmpCode, IdsFlag, IdsLogInFlag FROM A2ZSYSIDS WHERE IdsLogInFlag <> 0";
                        gvUserInfo = DataAccessLayer.BLL.CommonManager.Instance.FillGridViewList(strQuery, gvUserInfo, "A2ZGLMCUS");

                        //btnProcess.BackColor = Color.Black;
                        btnProcess.Enabled = false;


                        //string msg = "Can not Process Period End - System Not In Single User";

                        //String csname1 = "PopupScript";
                        //Type cstype = GetType();
                        //ClientScriptManager cs = Page.ClientScript;

                        //if (!cs.IsStartupScriptRegistered(cstype, csname1))
                        //{
                        //    String cstext1 = "alert('" + msg + "');";
                        //    cs.RegisterStartupScript(cstype, csname1, cstext1, true);
                        //}
                        ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Can not Process Period End - System Not In Single User');", true);
                        return;
                    }


                    var      dt          = A2ZGLPARAMETERDTO.GetParameterValue();
                    DateTime processDate = dt.ProcessDate;
                    string   date1       = processDate.ToString("dd/MM/yyyy");
                    lblProcDate.Text = date1;

                    lblNewYear.Text = Converter.GetString(dt.CurrentYear);

                    txtDayEnd.Focus();


                    txtToDaysDate.Text = Converter.GetString(String.Format("{0:D}", processDate));


                    A2ZERPSYSPRMDTO dto = A2ZERPSYSPRMDTO.GetParameterValue();
                    hdndatapath.Text = Converter.GetString(dto.PrmDataPath);

                    lblEndOfMonth.Visible = false;
                    //lblYearEnd.Visible = false;

                    lblYearClose.Text = "0";

                    int lastDay = DateTime.DaysInMonth(processDate.Year, processDate.Month);

                    if (processDate.Day == lastDay)
                    {
                        lblEndOfMonth.Visible = true;

                        if (dt.ProcessDate.Month == 12)
                        {
                            lblYearEnd.Visible = true;
                        }
                        if (dt.ProcessDate.Month == 6)
                        {
                            lblYearClose.Text = "1";
                        }
                    }

                    A2ZGLPARAMETERDTO.UpdateSingleUserFlag(1);
                }
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.Page_Load Problem');</script>");
                //throw ex;
            }
        }
Exemplo n.º 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    int userPermission = Converter.GetInteger(SessionStore.GetValue(Params.SYS_USER_PERMISSION));

                    lblID.Text = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_ID));

                    int checkAllUser = DataAccessLayer.DTO.A2ZSYSIDSDTO.CountForSingleUserPurpose(Converter.GetSmallInteger(SessionStore.GetValue(Params.SYS_USER_ID)), "A2ZGLMCUS");

                    if (checkAllUser > 0)
                    {
                        //string strQuery = "SELECT IdsNo, IdsName, EmpCode, IdsFlag, IdsLogInFlag FROM A2ZSYSIDS WHERE IdsLogInFlag <> 0";
                        //gvUserInfo = DataAccessLayer.BLL.CommonManager.Instance.FillGridViewList(strQuery, gvUserInfo, "A2ZGLMCUS");


                        btnProcess.Enabled = false;


                        ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Can not Process Period End - System Not In Single User');", true);
                        return;
                    }

                    lblCashCode.Text = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_GLCASHCODE));

                    var      dt          = A2ZGLPARAMETERDTO.GetParameterValue();
                    DateTime processDate = dt.ProcessDate;
                    string   date        = processDate.ToString("dd/MM/yyyy");
                    lblProcDate.Text = date;


                    lblNewYear.Text = Converter.GetString(dt.CurrentYear);

                    txtDayEnd.Focus();


                    txtToDaysDate.Text = Converter.GetString(String.Format("{0:D}", processDate));

                    A2ZERPSYSPRMDTO dto = A2ZERPSYSPRMDTO.GetParameterValue();
                    hdndatapath.Text = Converter.GetString(dto.PrmDataPath);

                    lblEndOfMonth.Visible = false;
                    //lblYearEnd.Visible = false;

                    //int lastDay = DateTime.DaysInMonth(processDate.Year, processDate.Month);

                    //if (processDate.Day == lastDay)
                    //{
                    //    lblEndOfMonth.Visible = true;

                    //    if (dt.ProcessDate.Month == 12)
                    //    {
                    //        lblYearEnd.Visible = true;
                    //    }
                    //}

                    //A2ZGLPARAMETERDTO.UpdateSingleUserFlag(1);

                    CheckDebitCreditTransaction();
                }
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.Page_Load Problem');</script>");
                //throw ex;
            }
        }
Exemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (IsPostBack)
                {
                }
                else
                {
                    hdnID.Value      = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_ID));
                    hdnCashCode.Text = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_GLCASHCODE));
                    SumValue();
                    CtrlPrmValue.Text = Request.QueryString["a%b"];
                    string b = CtrlPrmValue.Text;
                    CtrlTrnType.Text = b.Substring(0, 1);
                    CtrlTrnMode.Text = b.Substring(1, 1);
                    CtrlModule.Text  = b.Substring(2, 1);

                    FunctionName();
                    BtnUpdate.Visible = false;


                    if (CtrlTrnType.Text == "1")
                    {
                        lblContra.Visible  = false;
                        txtContra.Visible  = false;
                        ddlContra.Visible  = false;
                        lblMode.Visible    = false;
                        ddlTrnMode.Visible = false;
                    }


                    if (CtrlTrnMode.Text == "0")
                    {
                        lblDebit.Visible    = false;
                        txtDrAmount.Visible = false;
                    }

                    if (CtrlTrnMode.Text == "1")
                    {
                        lblCredit.Visible   = false;
                        txtCrAmount.Visible = false;
                    }

                    if (CtrlTrnType.Text == "1")
                    {
                        txtTrnsactionCode.Focus();
                    }
                    else
                    {
                        DisableInfo();
                        ddlTrnMode.Focus();
                    }


                    string sqlQueryAcc = "SELECT GLAccNo,GLAccDesc FROM dbo.A2ZCGLMST WHERE GLPrtPos = 6";
                    ddlTrnsactionCode = CommonManager.Instance.FillDropDownList(sqlQueryAcc, ddlTrnsactionCode, "A2ZGLMCUS");

                    string sqlQueryContra = "SELECT GLAccNo,GLAccDesc FROM dbo.A2ZCGLMST WHERE GLPrtPos = 6";
                    ddlContra = CommonManager.Instance.FillDropDownList(sqlQueryContra, ddlContra, "A2ZGLMCUS");

                    A2ZGLPARAMETERDTO dto  = A2ZGLPARAMETERDTO.GetParameterValue();
                    DateTime          dt   = Converter.GetDateTime(dto.ProcessDate);
                    string            date = dt.ToString("dd/MM/yyyy");
                    txtVchDate.Text   = date;
                    CtrlProcDate.Text = date;

                    string strQuery1 = @"DELETE FROM dbo.WFGLTrannsaction WHERE UserID='" + hdnID.Value + "'";
                    int    status1   = Converter.GetSmallInteger(DataAccessLayer.BLL.CommonManager.Instance.ExecuteNonQuery(strQuery1, "A2ZGLMCUS"));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (IsPostBack)
                {
                }
                else
                {
                    string PFlag = (string)Session["ProgFlag"];
                    CtrlProgFlag.Text = PFlag;

                    if (CtrlProgFlag.Text != "1")
                    {
                        hdnPrmValue.Text = Request.QueryString["a%b"];
                        string b = hdnPrmValue.Text;
                        HdnModule.Text = b;


                        A2ZGLPARAMETERDTO dto  = A2ZGLPARAMETERDTO.GetParameterValue();
                        DateTime          dt   = Converter.GetDateTime(dto.ProcessDate);
                        string            date = dt.ToString("dd/MM/yyyy");
                        txtfdate.Text = Converter.GetString(date);
                        txttdate.Text = Converter.GetString(date);
                        txtGLCode.Focus();

                        HeaderDropdown();
                    }
                    else
                    {
                        string RHdnModule = (string)Session["SHdnModule"];

                        string RtxtGLCode = (string)Session["StxtGLCode"];
                        string RddlGLCode = (string)Session["SddlGLCode"];

                        string RhdnTranCode = (string)Session["ShdnTranCode"];

                        string Rtxtfdate = (string)Session["Stxtfdate"];
                        string Rtxttdate = (string)Session["Stxttdate"];

                        string RrbtGLAccStatement         = (string)Session["SrbtGLAccStatement"];
                        string RrbtGLAccStVchConsolated   = (string)Session["SrbtGLAccStVchConsolated"];
                        string RrbtGLAccStDailyConsolated = (string)Session["SrbtGLAccStDailyConsolated"];

                        string RhdnTranHead2 = (string)Session["ShdnTranHead2"];
                        string RhdnTranHead3 = (string)Session["ShdnTranHead3"];
                        string RhdnTranHead4 = (string)Session["ShdnTranHead4"];

                        HdnModule.Text = RHdnModule;


                        txtfdate.Text = Rtxtfdate;
                        txttdate.Text = Rtxttdate;

                        if (RrbtGLAccStatement == "1")
                        {
                            rbtGLAccStatement.Checked = true;
                        }
                        else
                        {
                            rbtGLAccStatement.Checked = false;
                        }

                        if (RrbtGLAccStVchConsolated == "1")
                        {
                            rbtGLAccStVchConsolated.Checked = true;
                        }
                        else
                        {
                            rbtGLAccStVchConsolated.Checked = false;
                        }

                        if (RrbtGLAccStDailyConsolated == "1")
                        {
                            rbtGLAccStDailyConsolated.Checked = true;
                        }
                        else
                        {
                            rbtGLAccStDailyConsolated.Checked = false;
                        }

                        if (HdnModule.Text != "6")
                        {
                            hdnTranHead2.Text = RhdnTranHead2;
                            hdnTranHead3.Text = RhdnTranHead3;
                            hdnTranHead4.Text = RhdnTranHead4;

                            txtGLCode.Text = RtxtGLCode;
                            GLCodeDropdown();
                            ddlGLCode.SelectedValue = Converter.GetString(txtGLCode.Text);
                            hdnTranCode.Text        = Converter.GetString(ddlGLCode.SelectedValue);
                            TranCodeDropDown();
                        }
                    }


                    if (HdnModule.Text == "6")
                    {
                        lblCashCode.Text = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_GLCASHCODE));

                        txtGLCode.Text = lblCashCode.Text;
                        GLCodeDropdown();
                        ddlGLCode.SelectedValue = Converter.GetString(txtGLCode.Text);
                        //txtGLCode.Enabled = false;
                        ddlGLCode.Enabled = false;
                        btnBack2.Enabled  = false;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ScriptManager.RegisterStartupScript(Page, this.GetType(), "ScrollPage", "ResetScrollPosition();", true);

            if (!IsPostBack)
            {
                lblRepFlag.Text = (string)Session["SlblRepFlag"];

                if (lblRepFlag.Text != "1" && lblRepFlag.Text != "2" && lblRepFlag.Text != "3" && lblRepFlag.Text != "4")
                {
                    txtfdate.Text = (string)Session["Stxtfdate"];
                    txttdate.Text = (string)Session["Stxttdate"];

                    lblReportOpt.Text = (string)Session["SReportOpt"];


                    lblID.Text = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_ID));
                    gvHeader();

                    gvHeaderInfo.Visible       = true;
                    gvSubHeaderInfo.Visible    = false;
                    gvSubHeaderDtlInfo.Visible = false;
                    gvStatementInfo.Visible    = false;

                    BtnBack.Visible = false;
                    //BtnPrint.Visible = false;

                    gvHead1.Visible = false;
                    gvHead2.Visible = false;
                    gvHead3.Visible = false;


                    A2ZGLPARAMETERDTO dto = A2ZGLPARAMETERDTO.GetParameterValue();

                    int      iMonthNo = dto.CurrentMonth;
                    DateTime dtDate   = new DateTime(dto.CurrentYear, iMonthNo, 1);
                }
                else
                {
                    txtfdate.Text     = (string)Session["Stxtfdate"];
                    txttdate.Text     = (string)Session["Stxttdate"];
                    lblReportOpt.Text = (string)Session["SReportOpt"];

                    lblGLHeadNumber.Text    = (string)Session["SlblGLHeadNumber"];
                    lblGLSubHeadNumber.Text = (string)Session["SlblGLSubHeadNumber"];
                    lblGLStatement.Text     = (string)Session["SlblGLStatement"];

                    lblGLDesc.Text = (string)Session["SlblGLDesc"];

                    lblGLHead.Text    = (string)Session["SlblGLHead"];
                    lblGLSubHead.Text = (string)Session["SlblGLSubHead"];
                }

                if (lblRepFlag.Text == "1")
                {
                    gvHead1.Visible = false;
                    gvHead1Detail();
                    gvHead2.Visible = false;

                    gvHead3.Visible = false;


                    gvHeaderInfo.Visible       = true;
                    gvSubHeaderInfo.Visible    = false;
                    gvSubHeaderDtlInfo.Visible = false;
                    gvStatementInfo.Visible    = false;

                    BtnBack.Visible = false;

                    gvHeader();
                }


                if (lblRepFlag.Text == "2")
                {
                    gvHead1.Visible = true;
                    gvHead1Detail();
                    gvHead2.Visible = false;

                    gvHead3.Visible = false;


                    gvHeaderInfo.Visible       = false;
                    gvSubHeaderInfo.Visible    = true;
                    gvSubHeaderDtlInfo.Visible = false;
                    gvStatementInfo.Visible    = false;

                    BtnBack.Visible = true;

                    gvSubHeader();
                }

                if (lblRepFlag.Text == "3")
                {
                    gvHead1.Visible = true;
                    gvHead1Detail();
                    gvHead2.Visible = true;
                    gvHead2Detail();

                    gvHead3.Visible = false;

                    gvHeaderInfo.Visible       = false;
                    gvSubHeaderInfo.Visible    = false;
                    gvSubHeaderDtlInfo.Visible = true;
                    gvStatementInfo.Visible    = false;

                    BtnBack.Visible = true;

                    gvSubHeaderDetail();
                }

                if (lblRepFlag.Text == "4")
                {
                    gvHead1.Visible = true;
                    gvHead1Detail();
                    gvHead2.Visible = true;
                    gvHead2Detail();
                    gvHead3.Visible = true;
                    gvHead3Detail();

                    gvHeaderInfo.Visible       = false;
                    gvSubHeaderInfo.Visible    = false;
                    gvSubHeaderDtlInfo.Visible = false;
                    gvStatementInfo.Visible    = true;

                    GenerateGLStatement();
                }
            }
        }
Exemplo n.º 16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string PFlag = (string)Session["ProgFlag"];
                CtrlProgFlag.Text = PFlag;

                if (CtrlProgFlag.Text != "1")
                {
                    CtrlModule.Text  = Request.QueryString["a%b"];
                    hdnCashCode.Text = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_GLCASHCODE));
                    string    qry1 = "SELECT GLAccDesc FROM A2ZCGLMST where GLAccNo='" + hdnCashCode.Text + "'";
                    DataTable dt1  = DataAccessLayer.BLL.CommonManager.Instance.GetDataTableByQuery(qry1, "A2ZGLMCUS");
                    if (dt1.Rows.Count > 0)
                    {
                        lblCashCodeName.Text = Converter.GetString(dt1.Rows[0]["GLAccDesc"]);
                    }

                    A2ZGLPARAMETERDTO dto  = A2ZGLPARAMETERDTO.GetParameterValue();
                    DateTime          dt   = Converter.GetDateTime(dto.ProcessDate);
                    string            date = dt.ToString("dd/MM/yyyy");
                    txtfdate.Text    = Converter.GetString(date);
                    txttdate.Text    = Converter.GetString(date);
                    txtGLPLCode.Text = Converter.GetString(dto.PLCode);

                    txtGLPLCode.Visible = false;
                    txtCashCode.Enabled = false;

                    if (CtrlModule.Text == "6")
                    {
                        ChkAllCashCode.Checked = false;
                        ChkAllCashCode.Visible = false;
                        txtCashCode.Text       = hdnCashCode.Text;
                        lblCodeDesc.Text       = lblCashCodeName.Text;
                        txtCashCode.ReadOnly   = true;
                    }
                }
                else
                {
                    string Rtxtfdate       = (string)Session["Stxtfdate"];
                    string Rtxttdate       = (string)Session["Stxttdate"];
                    string RChkAllCashCode = (string)Session["SChkAllCashCode"];
                    string RtxtCashCode    = (string)Session["StxtCashCode"];
                    string RlblCodeDesc    = (string)Session["SlblCodeDesc"];
                    string RrbtOpt4thLayer = (string)Session["SrbtOpt4thLayer"];
                    string RrbtOpt3rdLayer = (string)Session["SrbtOpt3rdLayer"];

                    string RCtrlModule      = (string)Session["SCtrlModule"];
                    string RhdnCashCode     = (string)Session["ShdnCashCode"];
                    string RlblCashCodeName = (string)Session["SlblCashCodeName"];
                    string RtxtGLPLCode     = (string)Session["StxtGLPLCode"];
                    string RChkShowZero     = (string)Session["SChkShowZero"];

                    CtrlModule.Text = RCtrlModule;

                    if (CtrlModule.Text == "6" || CtrlModule.Text == "7")
                    {
                        ChkAllCashCode.Checked = false;
                        ChkAllCashCode.Visible = false;
                        txtCashCode.Text       = hdnCashCode.Text;
                        lblCodeDesc.Text       = lblCashCodeName.Text;
                        txtCashCode.ReadOnly   = true;
                    }

                    txtfdate.Text = Rtxtfdate;
                    txttdate.Text = Rtxttdate;

                    if (RChkAllCashCode == "1")
                    {
                        ChkAllCashCode.Checked = true;
                    }
                    else
                    {
                        ChkAllCashCode.Checked = false;
                    }
                    txtCashCode.Text = RtxtCashCode;
                    lblCodeDesc.Text = RlblCodeDesc;

                    if (RrbtOpt4thLayer == "1")
                    {
                        rbtOpt4thLayer.Checked = true;
                    }
                    else
                    {
                        rbtOpt4thLayer.Checked = false;
                    }

                    if (RrbtOpt3rdLayer == "1")
                    {
                        rbtOpt3rdLayer.Checked = true;
                    }
                    else
                    {
                        rbtOpt3rdLayer.Checked = false;
                    }
                    if (RChkShowZero == "1")
                    {
                        ChkShowZero.Checked = true;
                    }
                    else
                    {
                        ChkShowZero.Checked = false;
                    }

                    hdnCashCode.Text     = RhdnCashCode;
                    lblCashCodeName.Text = RlblCashCodeName;
                    txtGLPLCode.Text     = RtxtGLPLCode;
                }
            }
        }
Exemplo n.º 17
0
        protected void BtnView_Click(object sender, EventArgs e)
        {
            try
            {
                Session["ProgFlag"] = "1";


                Session["Stxtfdate"] = txtfdate.Text;
                Session["Stxttdate"] = txttdate.Text;


                Session["SlblOptFuncFlag"] = lblOptFuncFlag.Text;
                if (rbtOptAfterFunc.Checked == true)
                {
                    Session["SrbtOptAfterFunc"] = "1";
                }
                else
                {
                    Session["SrbtOptAfterFunc"] = "0";
                }

                if (rbtOptBeforeFunc.Checked == true)
                {
                    Session["SrbtOptBeforeFunc"] = "1";
                }
                else
                {
                    Session["SrbtOptBeforeFunc"] = "0";
                }



                if (rbtOpt1stLayer.Checked == true)
                {
                    Session["SrbtOpt1stLayer"] = "1";
                }
                else
                {
                    Session["SrbtOpt1stLayer"] = "0";
                }

                if (rbtOpt2ndLayer.Checked == true)
                {
                    Session["SrbtOpt2ndLayer"] = "1";
                }
                else
                {
                    Session["SrbtOpt2ndLayer"] = "0";
                }

                if (rbtOpt3rdLayer.Checked == true)
                {
                    Session["SrbtOpt3rdLayer"] = "1";
                }
                else
                {
                    Session["SrbtOpt3rdLayer"] = "0";
                }

                if (rbtOpt4thLayer.Checked == true)
                {
                    Session["SrbtOpt4thLayer"] = "1";
                }
                else
                {
                    Session["SrbtOpt4thLayer"] = "0";
                }

                if (ChkShowZero.Checked == true)
                {
                    Session["SChkShowZero"] = "1";
                }
                else
                {
                    Session["SChkShowZero"] = "0";
                }

                if (rbtOptTrialBalance.Checked == true)
                {
                    Session["SrbtOptTrialBalance"] = "1";
                }
                else
                {
                    Session["SrbtOptTrialBalance"] = "0";
                }

                if (rbtOptReceivePayment.Checked == true)
                {
                    Session["SrbtOptReceivePayment"] = "1";
                }
                else
                {
                    Session["SrbtOptReceivePayment"] = "0";
                }

                if (rbtOptIncomeExpenditure.Checked == true)
                {
                    Session["SrbtOptIncomeExpenditure"] = "1";
                }
                else
                {
                    Session["SrbtOptIncomeExpenditure"] = "0";
                }

                if (rbtOptBalanceSheet.Checked == true)
                {
                    Session["SrbtOptBalanceSheet"] = "1";
                }
                else
                {
                    Session["SrbtOptBalanceSheet"] = "0";
                }
                //// Run Store Procedure -  Sp_GlGenerateAccountBalance   [ For Update WFINCEXPREP Table ]

                DateTime fdate = DateTime.ParseExact(txtfdate.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                DateTime tdate = DateTime.ParseExact(txttdate.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);

                // Call Sub functon  ---  GetDateToYYYYMMDD  for    Sp_GlGenerateAccountBalance

                var prm = new object[4];
                prm[0] = Converter.GetDateToYYYYMMDD(txtfdate.Text);
                prm[1] = Converter.GetDateToYYYYMMDD(txttdate.Text);
                prm[2] = 0;

                if (rbtOptBeforeFunc.Checked)
                {
                    prm[2] = 8;
                }

                prm[3] = 0;

                int result = Converter.GetInteger(CommonManager.Instance.GetScalarValueBySp("Sp_GlGenerateAccountBalance", prm, "A2ZGLMCUS"));
                //
                var    p           = A2ZERPSYSPRMDTO.GetParameterValue();
                string comName     = p.PrmUnitName;
                string comAddress1 = p.PrmUnitAdd1;
                SessionStore.SaveToCustomStore(Params.COMPANY_NAME, comName);
                SessionStore.SaveToCustomStore(Params.BRANCH_ADDRESS, comAddress1);
                SessionStore.SaveToCustomStore(DataAccessLayer.Utility.Params.COMMON_FDATE, fdate);
                SessionStore.SaveToCustomStore(DataAccessLayer.Utility.Params.COMMON_TDATE, tdate);


                if (ChkShowZero.Checked == false)
                {
                    string strQuery   = @"DELETE FROM A2ZGLMCUS.DBO.WFINCEXPREP WHERE GLOpBal =  0  AND GLDrSumC =  0 AND GLDrSumT = 0 AND GLCrSumC = 0 AND GLCrSumT = 0 AND GLClBal = 0    ";
                    int    rowEffiect = Converter.GetSmallInteger(DataAccessLayer.BLL.CommonManager.Instance.ExecuteNonQuery(strQuery, "A2ZGLMCUS"));
                }

                // For Report Parameter Value

                if (rbtOptTrialBalance.Checked)
                {
                    SessionStore.SaveToCustomStore(Params.COMMON_NO1, 0);  //   Trial Balance
                }

                if (rbtOptIncomeExpenditure.Checked)
                {
                    SessionStore.SaveToCustomStore(Params.COMMON_NO1, 2);  //   Income Expenditure
                }
                if (rbtOptBalanceSheet.Checked)
                {
                    SessionStore.SaveToCustomStore(Params.COMMON_NO1, 3); //    Balance Sheet
                }



                if (rbtOptTrialBalance.Checked)       //  For Trial Balance Report Header Name
                {
                    if (rbtOpt1stLayer.Checked)
                    {
                        SessionStore.SaveToCustomStore(Params.COMMON_NAME1, " Trial Balance - [1st Layer]");
                    }
                    else if (rbtOpt2ndLayer.Checked)
                    {
                        SessionStore.SaveToCustomStore(Params.COMMON_NAME1, " Trial Balance - [2nd Layer]");
                    }
                    else if (rbtOpt3rdLayer.Checked)
                    {
                        SessionStore.SaveToCustomStore(Params.COMMON_NAME1, " Trial Balance - [3rd Layer]");
                    }
                    else if (rbtOpt4thLayer.Checked)
                    {
                        SessionStore.SaveToCustomStore(Params.COMMON_NAME1, " Trial Balance - [4th Layer]");
                    }
                }

                if (rbtOptIncomeExpenditure.Checked) //  For  Income Expenditure Report Header Name
                {
                    if (rbtOpt1stLayer.Checked)
                    {
                        SessionStore.SaveToCustomStore(Params.COMMON_NAME1, " Income & Expenses - [1st Layer]");
                    }
                    else if (rbtOpt2ndLayer.Checked)
                    {
                        SessionStore.SaveToCustomStore(Params.COMMON_NAME1, " Income & Expenses - [2nd Layer]");
                    }
                    else if (rbtOpt3rdLayer.Checked)
                    {
                        SessionStore.SaveToCustomStore(Params.COMMON_NAME1, " Income & Expenses - [3rd Layer]");
                    }
                    else if (rbtOpt4thLayer.Checked)
                    {
                        SessionStore.SaveToCustomStore(Params.COMMON_NAME1, " Income & Expenses - [4th Layer]");
                    }
                }

                if (rbtOptBalanceSheet.Checked)    //   Balance Sheet Report Header Name
                {
                    A2ZGLPARAMETERDTO dto = A2ZGLPARAMETERDTO.GetParameterValue();
                    lblPLCode.Text = Converter.GetString(dto.PLCode);

                    string PLCode = lblPLCode.Text.Substring(0, 5);

                    string sqlQueryUpdateZero = "UPDATE WFINCEXPREP SET GLDrSumC = 0,GLDrSumT=0,GLCrSumC=0,GLCrSumT=0 WHERE  Left(GLACCNO,5)='" + PLCode + "'";
                    int    status5            = Converter.GetSmallInteger(DataAccessLayer.BLL.CommonManager.Instance.ExecuteNonQuery(sqlQueryUpdateZero, "A2ZGLMCUS"));

                    if (rbtOpt1stLayer.Checked)
                    {
                        SessionStore.SaveToCustomStore(Params.COMMON_NAME1, " Balance Sheet - [1st Layer]");
                    }
                    else if (rbtOpt2ndLayer.Checked)
                    {
                        SessionStore.SaveToCustomStore(Params.COMMON_NAME1, " Balance Sheet - [2nd Layer]");
                    }
                    else if (rbtOpt3rdLayer.Checked)
                    {
                        SessionStore.SaveToCustomStore(Params.COMMON_NAME1, " Balance Sheet - [3rd Layer]");
                    }
                    else if (rbtOpt4thLayer.Checked)
                    {
                        SessionStore.SaveToCustomStore(Params.COMMON_NAME1, " Balance Sheet - [4th Layer]");
                    }
                }


                //  Report

                if (rbtOpt1stLayer.Checked)
                {
                    SessionStore.SaveToCustomStore(DataAccessLayer.Utility.Params.REPORT_FILE_NAME_KEY, "rptTrialBalance1st");
                }

                if (rbtOpt2ndLayer.Checked)
                {
                    SessionStore.SaveToCustomStore(DataAccessLayer.Utility.Params.REPORT_FILE_NAME_KEY, "rptTrialBalance2nd");
                }
                if (rbtOpt3rdLayer.Checked)
                {
                    SessionStore.SaveToCustomStore(Params.COMMON_NO2, 0);
                    SessionStore.SaveToCustomStore(DataAccessLayer.Utility.Params.REPORT_FILE_NAME_KEY, "rptIncomeExpenses3rd");
                }
                if (rbtOpt4thLayer.Checked)
                {
                    SessionStore.SaveToCustomStore(Params.COMMON_NO2, 0);
                    SessionStore.SaveToCustomStore(Params.COMMON_NO3, 0);
                    SessionStore.SaveToCustomStore(DataAccessLayer.Utility.Params.REPORT_FILE_NAME_KEY, "rptIncomeExpenses4th");
                }



                SessionStore.SaveToCustomStore(DataAccessLayer.Utility.Params.REPORT_DATABASE_NAME_KEY, "A2ZGLMCUS");

                Response.Redirect("ReportServer.aspx", false);
            }



            catch (Exception ex)
            {
                throw ex;
            }
        }