Esempio n. 1
0
        public void GetCompanyName()
        {
            Validate _validate = new Validate();
            int slipNo = 0;
            int instrNo = 0;
            bool isAllOk = true;

            if (_validate.isNotSelected(ddlstInstmnt))
            {
                isAllOk = false;
                showError("Select Instrument");
            }
            else
            {
                instrNo = _validate.convertNumber(ddlstInstmnt.Text);
            }

            if (_validate.isNotNumber(txtSrNo))
            {
                isAllOk = false;
                showError("Enter Valid Slip Number");
            }
            else
            {
                slipNo = _validate.convertNumber(txtSrNo.Text);
            }

            if (isAllOk)
            {
                ChequeMaster obj = new Process().GetCheque(slipNo, instrNo);

                if (obj == null)
                {
                    txtClid1.Text = "";
                    txtClid2.Text = "";
                    txtSrNo.Text = "";
                    showError("Invalid Slip Number / Instruction ");
                }
                else
                {
                    txtClid1.Text = obj.companyCode;
                    txtClid2.Text = obj.companyName;
                }
            }
        }
Esempio n. 2
0
        public void GetLotSize()
        {
            Validate _validate = new Validate();
            int lotNo = 0;
            int instrNo = 0;
            bool isAllOk = true;
            if (_validate.isNotSelected(ddlstInstmnt))
            {
                isAllOk = false;
                showError("Select Instrument");
            }
            else
            {
                instrNo = _validate.convertNumber(ddlstInstmnt.SelectedValue);
            }

            if (_validate.isNotSelected(ddllotNo))
            {
                isAllOk = false;
                showError("Select Lot");
            }
            else
            {
                lotNo = _validate.convertNumber(ddllotNo.SelectedValue);
            }

            if (isAllOk)
            {
                LotSize obj = new Process().GetLotSize(lotNo, instrNo);
                if (obj != null)
                {
                    txtlotsize.Text = obj.lz_size.ToString();
                }
                else
                {
                    txtlotsize.Text = "";
                    showError("Invalid Lot / Instruction ");
                }
            }
        }
Esempio n. 3
0
 public int GetScrollNo()
 {
     Validate _validate = new Validate();
     if (_validate.isNotNumber(txtScroll))
     {
         showError("Invalid Scroll No!");
         return 0;
     }
     else
     {
         return _validate.convertNumber(txtScroll.Text.Trim());
     }
 }
Esempio n. 4
0
        public Inward getInwardDetails()
        {
            Validate _validate = new Validate();
            Boolean isAllOk = true;
            Inward obj = new Inward();
            obj.mkrid = Session["UserId"].ToString();
            obj.mkrdt = DateTime.Now;

            if (_validate.isValidInput(txtDt, 10))
                obj.ie_dt = DateTime.ParseExact(txtDt.Text, "yyyy-MM-dd", CultureInfo.InvariantCulture);
            else
            {
                isAllOk = false;
                showError("Invalid Date");
            }

            if (!_validate.isNotSelected(ddlstInstmnt))
            {
                obj.ie_instno = ddlstInstmnt.Text.Trim();
                obj.ie_trxtype = new Process().getInstype(_validate.convertNumber(ddlstInstmnt.Text.Trim()));
            }
            else
            {
                isAllOk = false;
                showError("Select Instruction");
            }

            if (!_validate.isNotSelected(ddllotNo))
                obj.ie_lotno = _validate.convertNumber(ddllotNo.Text);
            else
            {
                isAllOk = false;
                showError("Select Lot");
            }

            if (!_validate.isEmpty(txtlotsize))
            { }

            else
            {
                isAllOk = false;
                showError("Invalid Lotsize");
            }

            if (_validate.isNotNumber(txtSrNo))
            {
                isAllOk = false;
                showError("Invalid Slipno");
            }

            else
            {
                obj.ie_slipno = txtSrNo.Text.Trim();
            }

            if (_validate.isValidInput(txtClid1))
                obj.ie_cmcd = txtClid1.Text;
            else
            {
                isAllOk = false;
                showError("Invalid ClientID");
            }

            if (_validate.isNotNumber(txtinst))
            {
                isAllOk = false;
                showError("Invalid Instructions");
            }
            else
                obj.ie_nooftrx = _validate.convertNumber(txtinst.Text.Trim());

            if (ddlstInstmnt.SelectedItem.Text == "Demat")
            {
                if (_validate.isNotNumber(txtnoofcert))
                {
                    isAllOk = false;
                    showError("Invalid No of certificates");
                }
                else
                {
                    obj.ie_noofcert = _validate.convertNumber(txtnoofcert.Text);
                }
            }
            obj.ie_execdt = DateTime.ParseExact(txtexecdt.Text, "yyyy-MM-dd", CultureInfo.InvariantCulture);
            if (_validate.isNotDecimal(txtcharges))
            {
                isAllOk = false;
                showError("Invalid Charge");
            }

            else
                obj.ie_charge = _validate.ConvertDecimal(txtcharges.Text.Trim());

            if (!_validate.isEmpty(txtremarks))
                obj.ie_remark = txtremarks.Text.Trim();

            if (_validate.isNotSelected(ddl_mode_delivery))
            {
                isAllOk = false;
                showError("Select Mode of delivery");
            }

            else
                obj.ie_mode = ddl_mode_delivery.SelectedValue;

            if (isAllOk)
                return obj;
            else
                return null;
        }