Example #1
0
        protected void ddlAccType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlAccType.SelectedValue == "-Select-")
            {
                txtAccType.Text = string.Empty;
                txtAccType.Focus();
            }
            if (ddlAccType.SelectedValue != "-Select-")
            {
                Int16         MainCode = Converter.GetSmallInteger(ddlAccType.SelectedValue);
                A2ZACCTYPEDTO getDTO   = (A2ZACCTYPEDTO.GetInformation(MainCode));

                if (getDTO.AccTypeCode > 0)
                {
                    txtAccType.Text = Converter.GetString(getDTO.AccTypeCode);
                }
                else
                {
                    txtAccType.Text = string.Empty;
                }
                //   string qry = "SELECT AccNo,AccNo FROM A2ZACCOUNT WHERE AccType = '" + txtAccType.Text + "'";
                //   DataTable dt = DataAccessLayer.BLL.CommonManager.Instance.GetDataTableByQuery(qry, "A2ZCSMCUS");
                //   if (dt.Rows.Count > 0)

                Int16 Acctype   = Converter.GetSmallInteger(txtAccType.Text);
                Int64 AccNumber = Converter.GetLong(txtAccNo.Text);
                Int16 CuType    = 0;
                int   CUnumber  = 0;
                int   MemNumber = Converter.GetInteger(txtMemNo.Text);


                A2ZACCOUNTDTO accgetDTO = (A2ZACCOUNTDTO.GetInformation(Acctype, AccNumber, CuType, CUnumber, MemNumber));

                if (accgetDTO.a > 0)
                {
                    txtAccNo.Text = Converter.GetString(accgetDTO.AccNo);
                }

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

                    if (!cs.IsStartupScriptRegistered(cstype, csname1))
                    {
                        String cstext1 = "alert('Account Does Not Exist');";
                        cs.RegisterStartupScript(cstype, csname1, cstext1, true);
                    }

                    txtAccType.Text = string.Empty;
                    txtAccType.Focus();

                    return;
                }
            }
        }
Example #2
0
        protected void txtAccType_TextChanged(object sender, EventArgs e)
        {
            if (txtAccType.Text != string.Empty)
            {
                Int16         MainCode = Converter.GetSmallInteger(txtAccType.Text);
                A2ZACCTYPEDTO getDTO   = (A2ZACCTYPEDTO.GetInformation(MainCode));

                if (getDTO.AccTypeCode > 0)
                {
                    ddlAccType.SelectedValue = Converter.GetString(getDTO.AccTypeCode);
                }
                else
                {
                    ddlAccType.SelectedValue = "-Select-";
                }

                Int16 Acctype   = Converter.GetSmallInteger(txtAccType.Text);
                Int64 AccNumber = Converter.GetLong(txtAccNo.Text);
                Int16 CuType    = 0;
                int   CUnumber  = 0;
                int   MemNumber = Converter.GetInteger(txtMemNo.Text);


                A2ZACCOUNTDTO accgetDTO = (A2ZACCOUNTDTO.GetInformation(Acctype, AccNumber, CuType, CUnumber, MemNumber));

                if (accgetDTO.a > 0)
                {
                    txtAccNo.Text = Converter.GetString(accgetDTO.AccNo);
                }



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

                    if (!cs.IsStartupScriptRegistered(cstype, csname1))
                    {
                        String cstext1 = "alert('Account Does Not Exist');";
                        cs.RegisterStartupScript(cstype, csname1, cstext1, true);
                    }

                    txtAccType.Text = string.Empty;
                    txtAccType.Focus();

                    return;
                }
            }
        }