Esempio n. 1
0
        public void getDetails(int index = 0)
        {
            try
            {
                Boolean isAllOk = true;
                Validate _validate = new Validate();
                InterDepository obj = new InterDepository();
                if (_validate.isValidInput(txtExecutionDt, 10))
                {
                    obj.id_executiondate = _validate.convertDatetime(txtExecutionDt.Text.Trim());
                }
                else
                {
                    isAllOk = false;
                    showError("Invalid Execution date");
                }

                if (_validate.isValidInput(txtTransactionDt, 10))
                {
                    obj.id_trxdate = _validate.convertDatetime(txtTransactionDt.Text.Trim());
                }
                else
                {
                    isAllOk = false;
                    showError("Invalid Transction date");
                }

                if (_validate.isNotNumber(txtInternalRefNo))
                {
                    isAllOk = false;
                    showError("Invalid Internal number");
                }
                else
                {
                    obj.id_internalrefno = txtInternalRefNo.Text.Trim();
                }

                if (_validate.isNotNumber(txtslipno))
                {
                    isAllOk = false;
                    showError("Invalid slip number");
                }
                else
                {
                    obj.id_settlementno = txtslipno.Text.Trim();
                }

                if (_validate.isNotSelected(cmbInstructionType))
                {
                    isAllOk = false;
                    showError("Invalid Instruction selection");
                }

                else
                {
                    obj.id_instcd = cmbInstructionType.SelectedValue;
                }

                if (_validate.isNotNumber(txtlotno))
                {
                    isAllOk = false;
                    showError("Invalid Lot No");
                }
                else
                {
                    obj.id_lotno = Convert.ToInt32(txtlotno.Text.Trim());
                }

                if (_validate.isEmpty(txtClientId))
                {
                    isAllOk = false;
                    showError("Invalid Client ID");
                }
                else
                {
                    obj.id_clientid = txtClientId.Text.Trim();
                    obj.id_otherclientid = txtClientId.Text.Trim();
                }

                if (_validate.isNotSelected(cmbReceiptMode))
                {
                    isAllOk = false;
                    showError("Invalid Recieving mode");
                }
                else
                {
                    obj.id_instreceivemode = cmbReceiptMode.SelectedValue;
                }

                if (_validate.isEmpty(txtdpid))
                {
                    isAllOk = false;
                    showError("Invalid DP ID");
                }
                else
                {
                    obj.id_otherdpid = txtdpid.Text.Trim();
                }
                if (_validate.isEmpty(txtSettNo))
                {
                    isAllOk = false;
                    showError("Invalid Settlemtnt No");
                }
                else
                {
                    obj.id_settlementno = txtSettNo.Text.Trim();
                }

                if (_validate.isNotSelected(ddlType))
                {
                    isAllOk = false;
                    showError("Invalid Type");
                }
                else
                {
                    obj.id_type = ddlType.SelectedValue;
                }

                if (_validate.inValidString(txtbocmid.Text.Trim(),8))
                {
                    isAllOk = false;
                    showError("Invalid bocmid");
                }

                else
                {
                    obj.id_branchbatchcd = txtbocmid.Text.Trim();
                }

                if (_validate.isEmpty(txtcdslstlmnt))
                {
                    isAllOk = false;
                    showError("Invalid CD SL settlement");
                }

                else
                {
                    obj.id_CDSLsettlement = txtcdslstlmnt.Text.Trim();
                }

                if (_validate.isEmpty(txtisinCode_TXT_POSTBACK))
                {
                    isAllOk = false;
                    showError("Invalid ISIN Number");
                }

                else
                {
                    obj.id_isin = txtisinCode_TXT_POSTBACK.Text.Trim();
                }

                if (_validate.isNotNumber(txtqty))
                {
                    isAllOk = false;
                    showError("Invalid Quantity");
                }

                else
                {
                    obj.id_qty = Convert.ToInt32(txtqty.Text.Trim());
                }

                if (_validate.isNotSelected(cmbReason))
                {
                    isAllOk = false;
                    showError("Invalid Reason");
                }
                else
                {
                    obj.id_reasonForTrade = cmbReason.SelectedValue;
                }
                if (_validate.isEmpty(txtRemark))
                {
                    isAllOk = false;
                    showError("Invalid Remarks");
                }
                else
                {
                    obj.id_remarks = txtRemark.Text.Trim();
                }

                if (isAllOk == true)
                {
                    AuthMaster objj = new AuthMaster();
                    int level = new AuthMaster().Authorise(Convert.ToDecimal(obj.id_value),obj.id_instcd);
                    showError("Authorization level is : "+ level.ToString());

                    obj.id_trxdate = _validate.convertDatetime(DateTime.Now.ToString("yyyy-MM-dd"));
                    obj.id_trxtype = "925";
                    obj.id_trxflag = "";
                    obj.id_allow = "S";
                    obj.id_mkttype = "";
                    obj.id_status = "6";
                    obj.sc_rate = txtrate.Text;
                    obj.id_value = txtValue.Text;
                    obj.id_authtm1 = "00:00:00";
                    obj.id_authtm2 = "00:00:00";
                    obj.id_authtm3 = "00:00:00";
                    obj.id_instreceivemode = "S";
                    obj.id_recoslipyn = "N";
                    obj.id_entrymode = "C";
                    //obj.id_pri_key = 0;
                    obj.id_othersettlement = "";

                    obj.id_branchcd = new Process().GetSystemParameter("BRCODE");

                    if (Session["obj"] != null)
                        objs = (List<InterDepository>)Session["obj"];
                    if (Session["Index"] == null)
                    {
                        objs.Add(obj);
                    }
                    else
                    {
                        objs[Convert.ToInt32(Session["Index"])] = obj;
                        Session["Index"] = null;
                    }
                    Session["obj"] = objs;
                    GrdOnMarket.DataSource = objs;
                    GrdOnMarket.DataBind();
                    ClearFields2("");

                }

            }
            catch (Exception ex)
            {

            }
        }
Esempio n. 2
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. 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
 protected void txtSlip_TextChanged(object sender, EventArgs e)
 {
     Validate _validate = new Validate();
     if (_validate.isNotNumber(txtSrNo.Text))
         showError("Invalid Slip No");
     else {
         int count = new Process().CheckInwardExists(Convert.ToInt32(txtSrNo.Text));
         if (count > 0)
         {
             txtClid1.Text = "";
             txtClid2.Text = "";
             txtSrNo.Text = "";
             showError("Entry is already done for entered slip ");
         }
         else
         {
             GetCompanyName();
         }
     }
 }
Esempio n. 5
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;
        }