protected void txtCharAcountCode_TextChanged(object sender, EventArgs e)
    {
        try
        {
            string    AccNO = txtCharAcCommCode.Text + txtCharAcountCode.Text;
            DataTable dt    = new DataTable();
            DataSet   ds    = new DataSet();
            ds = _objBOUtiltiy.CheckAccCodeExitorNot(AccNO, "CharteredAcc");

            ds.Tables.Add(dt);

            if (ds.Tables[0].Rows.Count != 0 || ds.Tables[0].Rows.Count > 0)
            {
                lblaccnoerr.Text       = "Already Exist";
                lblaccnoerr.ForeColor  = System.Drawing.Color.Red;
                txtCharAcCommCode.Text = "";
            }
            else
            {
                lblaccnoerr.Text      = "Available";
                lblaccnoerr.ForeColor = System.Drawing.Color.DarkBlue;
            }
        }
        catch (Exception ex)
        {
            lblMsg.Text = _objBOUtiltiy.ShowMessage("danger", "Danger", ex.Message);
            ExceptionLogging.SendExcepToDB(ex);
        }
    }
예제 #2
0
    //[WebMethod]
    //public string checkAccCode(string AccCode)
    //{
    //    var Result = _objBalMainAcc.IsExitMainAccCode(AccCode);
    //    if (Result != "")
    //    {
    //        Result = " already exit";

    //        lblStatus.Text = ("Already exist");
    //        lblStatus.ForeColor = System.Drawing.Color.Red;
    //    }
    //    return Result.ToString();

    //}


    //protected void txtMainAccCode_TextChanged(object sender, EventArgs e)
    //{
    //    var Result = _objBalMainAcc.IsExitMainAccCode(txtMainAccCode.Text);
    //  //  if (Result != "")
    //  //  {
    //        //lblStatus.Text=("Already exist");
    //       // lblStatus.ForeColor = System.Drawing.Color.Red;
    //  //  }

    //}
    protected void txtMainAccCode_TextChanged(object sender, EventArgs e)
    {
        DataTable dt = new DataTable();
        DataSet   ds = new DataSet();

        ds = _objBOUtiltiy.CheckAccCodeExitorNot(txtMainAccCode.Text, "MainAcc");

        ds.Tables.Add(dt);

        if (ds.Tables[0].Rows.Count != 0 || ds.Tables[0].Rows.Count > 0)
        {
            lblaccnoerr.Text      = "Already Exist";
            lblaccnoerr.ForeColor = System.Drawing.Color.Red;
            txtMainAccCode.Text   = "";
        }
        else
        {
            lblaccnoerr.Text      = "Available";
            lblaccnoerr.ForeColor = System.Drawing.Color.DarkBlue;
        }
    }
예제 #3
0
    private void InsertUpdateBranch()
    {
        try
        {
            _objEMBranch.BranchId   = Convert.ToInt32(hf_BranchId.Value);
            _objEMBranch.BranchName = txtBranchName.Text;
            // _objEMBranch.BranchLogo = txtbranch.Text;
            _objEMBranch.BranchPhoneNo         = txtPhoneno.Text;
            _objEMBranch.BranchAlternativeNo   = txtAlternativeNo.Text;
            _objEMBranch.BranchEmail           = txtEmail.Text;
            _objEMBranch.BranchPhysicalAddress = txtPhysicalAddress.Text;
            _objEMBranch.BranchPostalAddress   = txtPostalAddress.Text;
            _objEMBranch.BranchCountry         = Convert.ToInt32(DDLCountry.SelectedValue);
            _objEMBranch.BranchState           = Convert.ToInt32(DDLProvince.SelectedValue);
            _objEMBranch.BranchCity            = Convert.ToInt32(DDLCity.SelectedValue);

            _objEMBranch.BranchCoRegNo       = txtCoRegNo.Text;
            _objEMBranch.BranchIATARegNo     = txtIATARegNo.Text;
            _objEMBranch.BranchVatRegNo      = txtVatRegNo.Text;
            _objEMBranch.BranchDoCex         = txtDoCex.Text;
            _objEMBranch.BranchMemberOfAsata = Convert.ToInt32(chkMemberOfAsata.Checked);
            _objEMBranch.CompanyId           = 1;
            _objEMBranch.BranchCurrency      = Convert.ToInt32(DDLCurrency.SelectedValue);
            _objEMBranch.BranchIsActive      = Convert.ToInt32(chkIsactive.Checked);

            _objEMBranch.SupplAcountType      = Convert.ToInt32(DDLSupplierMainAccType.SelectedItem.Value);
            _objEMBranch.SupplierMainAcNo     = txtSupplierMainAcNo.Text;
            _objEMBranch.SupplMainAccountName = txtSupplierMainAccName.Text;

            _objEMBranch.ClientAcountType      = Convert.ToInt32(DDLClientaccType.SelectedItem.Value);
            _objEMBranch.ClientMainAcNo        = txtClientMainAcNo.Text;
            _objEMBranch.ClientMainAccountName = txtClientmainAccName.Text;


            _objEMBranch.CreatedBy  = 1;
            _objEMBranch.BranchCode = txtBranchCode.Text;

            string filepath = string.Empty;
            if (hfImageLogo.Value != "")
            {
                if (BranchLogoUpload.HasFile)
                {
                    lblLogo.Text = BranchLogoUpload.FileName;
                }
                else
                {
                    filepath = hfImageLogo.Value.ToString();
                }
            }
            else
            {
                filepath = GetFile(BranchLogoUpload);
            }

            _objEMBranch.BranchLogo     = lblLogo.Text;
            _objEMBranch.BranchLogoPath = filepath;


            int Result = _objBALBranch.InsUpdBranch(_objEMBranch);



            if (Result > 0)
            {
                _objEMBranch.ConfigurationId         = Convert.ToInt32(hf_ConfigurationId.Value);
                _objEMBranch.VatPercentage           = Convert.ToDecimal(txtVatPercentage.Text);
                _objEMBranch.InvStartNo              = Convert.ToInt32(txtInvStartNo.Text);
                _objEMBranch.CreditNoteStartNo       = Convert.ToInt32(txtCreditNoteStartNo.Text);
                _objEMBranch.ZeroCommForSuppliers    = Convert.ToInt32(chkZeroCommForSuppliers.Checked);
                _objEMBranch.ConvertProInvToInv      = Convert.ToInt32(chkConvertProInvToInv.Checked);
                _objEMBranch.ServiceFeeMerge         = Convert.ToInt32(chkServiceFeeMerge.Checked);
                _objEMBranch.IsSerFeeAddToAirportTax = Convert.ToInt32(chkIsSerFeeAddToAirportTax.Checked);

                _objEMBranch.IsSerFeeMergePaymentMatch = Convert.ToInt32(chkIsSerFeeMergePaymentMatch.Checked);
                _objEMBranch.PreFixDebtors             = txtPreFixDebtors.Text;
                _objEMBranch.PreFixCorporates          = txtPreFixCorporates.Text;
                _objEMBranch.PreFixLiesures            = txtPreFixLiesures.Text;
                _objEMBranch.RoundingDecimal           = txtRoundingDecimal.Text;
                _objEMBranch.BranchId  = Convert.ToInt32(Result.ToString());
                _objEMBranch.CreatedBy = 1;
                int configResult = _objBALBranch.InsUpdConfiguration(_objEMBranch);

                if (configResult > 0)
                {
                    _objEMBranch.ClientTypeId = Convert.ToInt32(hf_ClientTypeId.Value);
                    _objEMBranch.Name         = "Corporate";
                    _objEMBranch.Code         = txtPreFixCorporates.Text;
                    _objEMBranch.CompanyId    = 1;
                    _objEMBranch.BranchId     = Convert.ToInt32(Result.ToString());
                    _objEMBranch.CreatedBy    = 1;
                    _objBALBranch.InsUpdClientTypeMaster(_objEMBranch);

                    _objEMBranch.ClientTypeId = Convert.ToInt32(hf_ClientTypeId.Value);
                    _objEMBranch.Name         = "Debtor";
                    _objEMBranch.Code         = txtPreFixDebtors.Text;
                    _objEMBranch.CompanyId    = 1;
                    _objEMBranch.BranchId     = Convert.ToInt32(Result.ToString());
                    _objEMBranch.CreatedBy    = 1;
                    _objBALBranch.InsUpdClientTypeMaster(_objEMBranch);

                    _objEMBranch.ClientTypeId = Convert.ToInt32(hf_ClientTypeId.Value);
                    _objEMBranch.Name         = "Leisure";
                    _objEMBranch.Code         = txtPreFixLiesures.Text;
                    _objEMBranch.CompanyId    = 1;
                    _objEMBranch.BranchId     = Convert.ToInt32(Result.ToString());
                    _objEMBranch.CreatedBy    = 1;
                    int clienttype = _objBALBranch.InsUpdClientTypeMaster(_objEMBranch);

                    objEMMainAccount.MainAccId   = Convert.ToInt32(hf_MainAccId.Value);
                    objEMMainAccount.MainAcName  = txtSupplierMainAccName.Text;
                    objEMMainAccount.MainAccCode = txtSupplierMainAcNo.Text;
                    objEMMainAccount.AcType      = Convert.ToInt32(DDLSupplierMainAccType.SelectedItem.Value);
                    objEMMainAccount.BranchId    = Result;
                    objEMMainAccount.CompanyId   = 1;
                    DataSet ds = _objBoutility.CheckAccCode_ExistorNot(txtSupplierMainAcNo.Text, "MainAcc");

                    if (ds.Tables[0].Rows.Count > 0)
                    {
                    }
                    else
                    {
                        int suppMainAcc = objBALMainAcc.MainAccountInsert(objEMMainAccount);
                    }



                    objEMMainAccount.MainAccId   = Convert.ToInt32(hf_MainAccId.Value);
                    objEMMainAccount.MainAcName  = txtClientmainAccName.Text;
                    objEMMainAccount.MainAccCode = txtClientMainAcNo.Text;
                    objEMMainAccount.AcType      = Convert.ToInt32(DDLClientaccType.SelectedItem.Value);
                    objEMMainAccount.BranchId    = Result;
                    objEMMainAccount.CompanyId   = 1;
                    DataSet dsclient = _objBoutility.CheckAccCodeExitorNot(txtClientMainAcNo.Text, "MainAcc");
                    if (dsclient.Tables[0].Rows.Count > 0)
                    {
                    }
                    else
                    {
                        int clientMainAcc = objBALMainAcc.MainAccountInsert(objEMMainAccount);
                    }



                    Response.Redirect("BranchList.aspx");
                }
            }
        }
        catch (Exception ex)
        {
            lblMsg.Text = _objBoutility.ShowMessage("danger", "error", ex.Message);
            ExceptionLogging.SendExcepToDB(ex);
        }
    }