protected void Login_Click(object sender, EventArgs e) { Validate validate = new Validate(); string user="",password=""; if (validate.isValidInput(UserName, 3)) user = UserName.Text.Trim(); else showMessage("Invalid User Name"); if (validate.isValidInput(Password, 3)) password = Password.Text.Trim(); else showMessage("Invalid Password"); int res = new ValidateUser().isValidUser(user,password); if (res > 0) { string strUser = "******" + "um_logstat,um_special,um_group_id,um_email,um_lastresetday,datediff(d, um_lastresetday, getdate()) as intDay," + "um_resetpwddays, um_locked, um_poaforpayin,um_status from User_master where um_user_id ='" + user + "'"; DBHelper db = new DBHelper(); DataTable dt = db.executeQuery(strUser); db.setSessionValue("UserId", user); db.setSessionValue("Password", password); db.setSessionValue("UserGroup", db.GetDtValue(dt, "um_group_id")); Response.Redirect("~/Home.aspx"); db.setSessionValue("LoginPage","~/Login.aspx"); } else { showMessage("Invalid User Name / Password"); } }
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) { } }
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; }