Esempio n. 1
0
 protected void TxtAccountName_TextChanged(object sender, EventArgs e)
 {
     try
     {
         DataTable DtAccountName = new DataTable();
         DtAccountName = ACCOUNTS_MASLogicLayer.GetAllACCOUNTDetialsByComapnyAndBranch(compcode, Branchcode);
         if (TxtAccountName.Text != string.Empty)
         {
             DataView Dv = new DataView(DtAccountName);
             Dv.RowFilter = "ANAME='" + TxtAccountName.Text.Trim() + "'";
             DataTable DtView = Dv.ToTable();
             if (DtView.Rows.Count > 0)
             {
                 HfACODE.Value = DtView.Rows[0]["ACODE"].ToString();
             }
         }
         else
         {
             HfACODE.Value = null;
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
        public void FillTxtAccountName()
        {
            try
            {
                DataTable DtFilter = new DataTable();

                DtFilter = ACCOUNTS_MASLogicLayer.GetACCOUNTNameForCashBankBook(Session["COMP_CODE"].ToString(), HfGroupCode.Value.ToString());
                if (DtFilter.Rows.Count > 0)
                {
                    DataView DvAccount = new DataView(DtFilter);
                    DvAccount.RowFilter = "ACODE>0";
                    DataTable Dt = DvAccount.ToTable();
                    HfACODE.Value = Dt.Rows[0]["ACODE"].ToString();
                    if (Convert.ToInt32(HfACODE.Value) > 0)
                    {
                        TxtAccountName.Text = Dt.Rows[0]["ANAME"].ToString();
                        HfACODE.Value       = Dt.Rows[0]["ACODE"].ToString();
                    }

                    else
                    {
                        TxtAccountName.Text = string.Empty;
                        HfACODE.Value       = string.Empty;
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        protected void TxtAccountNameOnMasterGrid_TextChanged(object sender, EventArgs e)
        {
            #region Fill MASTER Grid On ACODE

            try
            {
                DataTable Dt = new DataTable();

                Dt = ACCOUNTS_MASLogicLayer.GetAllACCOUNTWiseComapnyAndBranchForInvoice(compcode, Branchcode);


                if (TxtAccountNameOnMasterGrid.Text != string.Empty)
                {
                    DataView Dv = new DataView(Dt);
                    Dv.RowFilter = "ANAME='" + TxtAccountNameOnMasterGrid.Text.Trim() + "'";
                    DataTable DtView = Dv.ToTable();
                    if (DtView.Rows.Count > 0)
                    {
                        HfAccountCodeOnMasterGrid.Value = DtView.Rows[0]["ACODE"].ToString();
                    }
                    else
                    {
                        HfAccountCodeOnMasterGrid.Value = null;
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }

            #endregion
        }
 public void FillDdlAccountName()
 {
     try
     {
         DataTable Dt = ACCOUNTS_MASLogicLayer.GetAllACCOUNTS_MASDetialsWIiseCompanyFor_DDL(Session["COMP_CODE"].ToString());
         DdlAccountName.DataSource     = Dt;
         DdlAccountName.DataValueField = "ACODE";
         DdlAccountName.DataTextField  = "ANAME";
         DdlAccountName.DataBind();
     }
     catch (Exception)
     {
         throw;
     }
 }
 public void FillDdlAccountName()
 {
     try
     {
         string    COMPCODE = HfCompCode.Value;
         DataTable Dt       = ACCOUNTS_MASLogicLayer.GetAllACCOUNTS_MASDetialsWIiseCompanyFor_DDL(COMPCODE);
         DdlAccountName.DataSource     = Dt;
         DdlAccountName.DataValueField = "ACODE";
         DdlAccountName.DataTextField  = "ANAME";
         DdlAccountName.DataBind();
     }
     catch (Exception)
     {
         throw;
     }
 }
 public void FillLblAccountGroupName()
 {
     try
     {
         string    ACODE = DdlAccountName.SelectedValue;
         DataTable Dt    = ACCOUNTS_MASLogicLayer.GetIDWiseGROUP_NAMEFor_AccountBal(ACODE);
         if (Dt.Rows.Count > 0)
         {
             lblAccountGroupName.Text = Dt.Rows[0]["GROUP_NAME"].ToString();
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 7
0
 public void FillDdlBranchReceivedDebitAC()
 {
     try
     {
         HfCompCode.Value = Session["COMP_CODE"].ToString();
         string    COMPCODE = HfCompCode.Value;
         DataTable Dt       = ACCOUNTS_MASLogicLayer.GetAllACCOUNTS_MASDetialsWIiseCompanyFor_DDL(COMPCODE);
         DdlBranchReceivedDebitAC.DataSource     = Dt;
         DdlBranchReceivedDebitAC.DataValueField = "ACODE";
         DdlBranchReceivedDebitAC.DataTextField  = "ANAME";
         DdlBranchReceivedDebitAC.DataBind();
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 8
0
        //protected void TxtAccountName_TextChanged(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        DataTable DtAccountName = new DataTable();
        //        DtAccountName = ACCOUNTS_MASLogicLayer.GetAllACCOUNTDetialsByComapnyAndBranch(compcode, Branchcode);
        //        if (TxtAccountName.Text != string.Empty)
        //        {
        //            DataView Dv = new DataView(DtAccountName);
        //            Dv.RowFilter = "ANAME='" + TxtAccountName.Text.Trim() + "'";
        //            DataTable DtView = Dv.ToTable();
        //            if (DtView.Rows.Count > 0)
        //            {
        //                HfACODE.Value = DtView.Rows[0]["ACODE"].ToString();
        //            }

        //        }
        //        else
        //        {
        //            HfACODE.Value = null;
        //        }
        //    }
        //    catch (Exception)
        //    {

        //        throw;
        //    }
        //}

        protected void TxtAccountsName_TextChanged(object sender, EventArgs e)
        {
            try
            {
                TextBox     txt = (TextBox)sender;
                GridViewRow row = (GridViewRow)txt.Parent.Parent;
                int         idx = row.RowIndex;

                HiddenField HfACODEGrid = (HiddenField)row.Cells[0].FindControl("HfACODEGrid");

                CheckBox ChkSelectAccounts = (CheckBox)row.Cells[0].FindControl("ChkSelectAccounts");
                //  TextBox TxtAccountsNameGrid = (TextBox)row.Cells[1].FindControl("TxtAccountsNameGrid");

                DataTable DtAccountName = new DataTable();

                DtAccountName = ACCOUNTS_MASLogicLayer.GetAllACCOUNTDetialsByComapnyAndBranch(compcode, Branchcode);

                if (txt.Text != string.Empty)
                {
                    DataView Dv = new DataView(DtAccountName);
                    Dv.RowFilter = "ANAME='" + txt.Text.Trim() + "'";
                    DataTable DtView = Dv.ToTable();
                    if (DtView.Rows.Count > 0)
                    {
                        HfACODEGrid.Value         = DtView.Rows[0]["ACODE"].ToString();
                        ChkSelectAccounts.Checked = true;
                        ChkSelectAccounts.Enabled = false;
                    }
                }
                else
                {
                    HfACODEGrid.Value         = null;
                    ChkSelectAccounts.Checked = false;
                    ChkSelectAccounts.Enabled = true;
                }
            }

            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 9
0
        public void FillDdlAccountName(string Id)
        {
            try
            {
                string Comp_Code = Session["COMP_CODE"].ToString();

                DataTable Dt = new DataTable();
                Dt = ACCOUNTS_MASLogicLayer.GetAllACCOUNTS_MASDetialsWIiseCompanyFor_DDL(Comp_Code);


                if (HfACODE.Value.ToString() != "0")
                {
                    DataView Dv = new DataView(Dt);
                    Dv.RowFilter = "ACODE=" + Id;
                    DataTable DtView = Dv.ToTable();
                    TxtAccountName.Text = DtView.Rows[0]["ANAME"].ToString();
                    HfACODE.Value       = DtView.Rows[0]["ACODE"].ToString();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["USERCODE"] != null &&
                Session["USERNAME"] != null &&
                Session["USERTYPE"] != null &&
                Session["COMP_CODE"] != null &&
                Session["COMP_NAME"] != null &&
                Session["BRANCH_CODE"] != null &&
                Session["BRANCH_NAME"] != null &&
                Session["BRANCH_TYPE"] != null &&
                Session["FIN_YEAR"] != null &&
                Session["FIN_YEAR_END"] != null &&
                Session["MAC"] != null &&
                Session["PC"] != null &&
                Session["INSERT"] != null &&
                Session["UPDATE"] != null &&
                Session["DELETE"] != null)

            {
                if (!Page.IsPostBack)
                {
                    DivEntry.Visible = false;
                    DivView.Visible  = true;
                    FillDdlCompanyName();



                    if (!string.IsNullOrWhiteSpace(Request.QueryString["ACODE"]) && !string.IsNullOrWhiteSpace(Request.QueryString["COMP_CODE"]))
                    {
                        HfCompCode.Value = HttpUtility.UrlDecode(Decrypt(Request.QueryString["COMP_CODE"]));
                        HfACODE.Value    = HttpUtility.UrlDecode(Decrypt(Request.QueryString["ACODE"]));


                        lblAccountNameOfParty_relate.Visible = true;
                        tblaccname.Visible = false;
                        //  tblcompname.Visible = false;
                        DivEntry.Visible = true;
                        DivView.Visible  = false;

                        clear();
                        ControllerEnable();
                        UserRights();
                        Btncalldel.Visible = false;
                        btnSave.Enabled    = true;
                        btnSave.Visible    = true;
                        DivEntry.Visible   = false;
                        DivView.Visible    = true;

                        if (!string.IsNullOrWhiteSpace(Request.QueryString["Flag"]))
                        {
                            if (Request.QueryString["Flag"].ToString() == "1")
                            {
                                btnSave.Visible = false;
                                ControllerDisable();
                            }
                        }

                        DataTable Dt = ACCOUNTS_MASLogicLayer.GetAllIDWiseACCOUNTDetials(HfACODE.Value);
                        if (Dt.Rows.Count > 0)
                        {
                            lblAccountNameOfParty.Text = Dt.Rows[0]["ANAME"].ToString();
                        }
                        FillDdlAccountName();
                    }
                    else
                    {
                        HfCompCode.Value = Session["COMP_CODE"].ToString();
                        HfACODE.Value    = string.Empty;
                        //  DdlComapnyName.Visible = true;
                        DdlAccountName.Visible = true;
                        FillDdlAccountName();
                        lblAccountNameOfParty_relate.Visible = false;
                    }
                    FillGrid(HfACODE.Value);
                }
            }

            else
            {
                Response.Redirect("../Login.aspx");
            }
        }