protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtDescription.Text != string.Empty)
                {
                    gvDetail();
                    gvDetailInfo.Visible = false;

                    int totrec = gvDetailInfo.Rows.Count;

                    int lastWaseCode = (totrec + 1);

                    if (lastWaseCode < 10)
                    {
                        hdnSuppCode.Text = Converter.GetString("0" + lastWaseCode);
                    }

                    A2ZSUPPLIERDTO objDTO = new A2ZSUPPLIERDTO();

                    objDTO.SuppCode = Converter.GetInteger(hdnSuppCode.Text);

                    objDTO.SuppName = Converter.GetString(txtDescription.Text);

                    objDTO.SuppAddL1 = Converter.GetString(txtAddLine1.Text);

                    objDTO.SuppAddL2 = Converter.GetString(txtAddLine2.Text);

                    objDTO.SuppAddL3 = Converter.GetString(txtAddLine3.Text);

                    objDTO.SuppTel = Converter.GetString(txtSuppTelephone.Text);

                    objDTO.SuppMobile = Converter.GetString(txtSuppMobileNo.Text);

                    objDTO.SuppFax = Converter.GetString(txtSuppFax.Text);

                    objDTO.SuppEmail = Converter.GetString(txtSuppEmail.Text);

                    A2ZCSPARAMETERDTO dto = A2ZCSPARAMETERDTO.GetParameterValue();
                    objDTO.SuppStatDate = Converter.GetDateTime(dto.ProcessDate.ToLongDateString());

                    int roweffect = A2ZSUPPLIERDTO.InsertInformation(objDTO);
                    if (roweffect > 0)
                    {
                        DivisionDropdown();
                        clearInfo();
                        BtnUpdate.Visible = false;
                        BtnSubmit.Visible = true;
                        gvDetail();
                        gvDetailInfo.Visible = false;
                        txtDescription.Text  = string.Empty;
                        txtDescription.Focus();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        protected void txtSupplierCode_TextChanged(object sender, EventArgs e)
        {
            if (txtSupplierCode.Text != string.Empty)
            {
                int            MainCode = Converter.GetInteger(txtSupplierCode.Text);
                A2ZSUPPLIERDTO getDTO   = (A2ZSUPPLIERDTO.GetInformation(MainCode));

                if (getDTO.SuppCode > 0)
                {
                    ddlSupplierName.SelectedValue = Converter.GetString(getDTO.SuppCode);
                    lblAddressl1.Text             = Converter.GetString(getDTO.SuppAddL1);
                    lblAddressl2.Text             = Converter.GetString(getDTO.SuppAddL2);
                    lblAddressl3.Text             = Converter.GetString(getDTO.SuppAddL3);
                    lblMobile.Text = Converter.GetString(getDTO.SuppMobile);
                }
                else
                {
                    ddlSupplierName.SelectedIndex = 0;
                    txtSupplierCode.Text          = string.Empty;
                    txtSupplierCode.Focus();
                    ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Invalid Supplier Code');", true);
                    return;
                }
            }
        }
        protected void ddlSupplier_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                lblLedgerBalance.Visible = true;
                txtPayableAmt.Visible    = true;
                lblVatBalance.Visible    = true;
                txtPayableVATAmt.Visible = true;
                lblTaxBalance.Visible    = true;
                txtPayableTAXAmt.Visible = true;


                int            Code   = Converter.GetInteger(ddlSupplier.SelectedValue);
                A2ZSUPPLIERDTO getDTO = (A2ZSUPPLIERDTO.GetInformation(Code));

                if (getDTO.SuppCode > 0)
                {
                    txtSupplier.Text      = Converter.GetString(getDTO.SuppCode);
                    txtPayableAmt.Text    = Converter.GetString(String.Format("{0:0,0.00}", getDTO.SuppBalance));
                    txtPayableVATAmt.Text = Converter.GetString(String.Format("{0:0,0.00}", getDTO.SuppVATAmt));
                    txtPayableTAXAmt.Text = Converter.GetString(String.Format("{0:0,0.00}", getDTO.SuppTAXAmt));
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }
Esempio n. 4
0
        protected void txtSupplier_TextChanged(object sender, EventArgs e)
        {
            int            SuppCode = Converter.GetInteger(txtSupplier.Text);
            A2ZSUPPLIERDTO getDTO   = (A2ZSUPPLIERDTO.GetInformation(SuppCode));

            if (getDTO.SuppCode > 0)
            {
                ddlSupplier.SelectedValue = txtSupplier.Text;
            }
        }
        protected void ddlSupplier_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlSupplier.SelectedValue == "-Select-")
            {
                clearInfo();
                ddlSupplier.Focus();
                BtnUpdate.Visible = false;
                BtnSubmit.Visible = true;
            }

            try
            {
                if (ddlSupplier.SelectedValue != "-Select-")
                {
                    int            code   = Converter.GetInteger(ddlSupplier.SelectedValue);
                    A2ZSUPPLIERDTO getDTO = (A2ZSUPPLIERDTO.GetInformation(code));
                    if (getDTO.SuppCode > 0)
                    {
                        hdnSuppCode.Text = Converter.GetString(getDTO.SuppCode);
                        txtDescription.Focus();
                        txtDescription.Text = Converter.GetString(getDTO.SuppName);

                        txtAddLine1.Text      = Converter.GetString(getDTO.SuppAddL1);
                        txtAddLine2.Text      = Converter.GetString(getDTO.SuppAddL2);
                        txtAddLine3.Text      = Converter.GetString(getDTO.SuppAddL3);
                        txtSuppEmail.Text     = Converter.GetString(getDTO.SuppEmail);
                        txtSuppFax.Text       = Converter.GetString(getDTO.SuppFax);
                        txtSuppMobileNo.Text  = Converter.GetString(getDTO.SuppMobile);
                        txtSuppTelephone.Text = Converter.GetString(getDTO.SuppTel);

                        BtnSubmit.Visible = false;
                        BtnUpdate.Visible = true;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected void BtnUpdate_Click(object sender, EventArgs e)
        {
            if (ddlSupplier.SelectedValue != "-Select-")
            {
                A2ZSUPPLIERDTO UpDTO = new A2ZSUPPLIERDTO();
                UpDTO.SuppCode = Converter.GetInteger(hdnSuppCode.Text);

                UpDTO.SuppName = Converter.GetString(txtDescription.Text);

                UpDTO.SuppAddL1 = Converter.GetString(txtAddLine1.Text);

                UpDTO.SuppAddL2 = Converter.GetString(txtAddLine2.Text);

                UpDTO.SuppAddL3 = Converter.GetString(txtAddLine3.Text);

                UpDTO.SuppTel = Converter.GetString(txtSuppTelephone.Text);

                UpDTO.SuppMobile = Converter.GetString(txtSuppMobileNo.Text);

                UpDTO.SuppFax = Converter.GetString(txtSuppFax.Text);

                UpDTO.SuppEmail = Converter.GetString(txtSuppEmail.Text);

                int roweffect = A2ZSUPPLIERDTO.UpdateInformation(UpDTO);
                if (roweffect > 0)
                {
                    DivisionDropdown();
                    clearInfo();
                    BtnUpdate.Visible = false;
                    BtnSubmit.Visible = true;
                    gvDetail();
                    gvDetailInfo.Visible = false;
                    txtDescription.Text  = string.Empty;
                    txtDescription.Focus();
                }
            }
        }