protected void btnApply_OnClick(object sender, EventArgs e) { int i = 0; Button btn = (Button)sender; GridFooterItem footerItem = (GridFooterItem)gvOrderRecon.MasterTableView.GetItems(GridItemType.Footer)[0]; TextBox newSubBrokerCode = (TextBox)footerItem.FindControl("txtAllotedSubBrokerCode"); TextBox newOrderSubBrokerCode = (TextBox)footerItem.FindControl("txtOrderSubbrokerCode"); foreach (GridDataItem dataItem in gvOrderRecon.MasterTableView.Items) { if ((dataItem.FindControl("chkId") as CheckBox).Checked) { i = i + 1; } } switch (btn.ID) { case "btnApply": if (i == 0) { ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Please Select Item To Apply SubBrokerCode !');", true); return; } else { foreach (GridDataItem dataItem in gvOrderRecon.MasterTableView.Items) { if ((dataItem.FindControl("chkId") as CheckBox).Checked) { TextBox txtSubBrokerCode = dataItem.FindControl("txtAllotedSubBrokerCodetoAllotment") as TextBox; txtSubBrokerCode.Text = newSubBrokerCode.Text; } } } break; case "btnOrderApply": if (i == 0) { ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Please Select Item To Apply Order SubBrokerCode !');", true); return; } else { foreach (GridDataItem dataItem in gvOrderRecon.MasterTableView.Items) { if ((dataItem.FindControl("chkId") as CheckBox).Checked) { TextBox txtOrderSubBrokerCode = dataItem.FindControl("txtOrderAgentCode") as TextBox; txtOrderSubBrokerCode.Text = newOrderSubBrokerCode.Text; } } } break; } }
protected void ddlSession_SelectedIndexChanged(object sender, EventArgs e) { SqlProcsNew sqlobj = new SqlProcsNew(); DataSet dsSessionRT = new DataSet(); Decimal GrandTotal = 0; int PCount = 0; dsSessionRT = sqlobj.ExecuteSP("[SP_FetchBillingRatetotextbox]", new SqlParameter() { ParameterName = "@IMODE", SqlDbType = SqlDbType.Int, Value = 1 }, new SqlParameter() { ParameterName = "@BCode", SqlDbType = SqlDbType.NVarChar, Value = ddlSession.SelectedValue }); if (dsSessionRT.Tables[0].Rows.Count > 0) { lblSessionRate.Text = dsSessionRT.Tables[0].Rows[0]["Rate"].ToString(); foreach (GridDataItem Item in FoodBillingListView.Items) { RadNumericTextBox TxtBillfor = (RadNumericTextBox)Item.FindControl("TxtBillFor"); Decimal BillingRate = Convert.ToDecimal(lblSessionRate.Text.ToString()); Decimal Billfor = Decimal.Parse(TxtBillfor.Text.ToString()); RadNumericTextBox Amount = (RadNumericTextBox)Item.FindControl("TxtAmnt"); Amount.Text = Convert.ToString(Billfor * BillingRate); GrandTotal = GrandTotal + Convert.ToDecimal(Amount.Text.ToString()); RadNumericTextBox rtbPCount = (RadNumericTextBox)Item.FindControl("TxtBillFor"); PCount = PCount + Convert.ToInt16(rtbPCount.Text.ToString()); } GridFooterItem footeritem = (GridFooterItem)FoodBillingListView.MasterTableView.GetItems(GridItemType.Footer)[0]; RadNumericTextBox Total = (RadNumericTextBox)footeritem.FindControl("lblTotalAmnt"); Total.Text = GrandTotal.ToString(); RadNumericTextBox PCTotal = (RadNumericTextBox)footeritem.FindControl("lblPCount"); PCTotal.Text = PCount.ToString(); } else { lblSessionRate.Text = string.Empty; foreach (GridDataItem Item in FoodBillingListView.Items) { RadNumericTextBox Amount = (RadNumericTextBox)Item.FindControl("TxtAmnt"); Amount.Text = string.Empty; } GridFooterItem footeritem = (GridFooterItem)FoodBillingListView.MasterTableView.GetItems(GridItemType.Footer)[0]; RadNumericTextBox Total = (RadNumericTextBox)footeritem.FindControl("lblTotalAmnt"); Total.Text = string.Empty; } LoadGrid1(); }
protected void btnUpdate_Update(object sender, EventArgs e) { string gvMFAId = ""; int i = 0; GridFooterItem footerItem = (GridFooterItem)gvSubBrokerCleansing.MasterTableView.GetItems(GridItemType.Footer)[0]; TextBox newSubBrokerCode = (TextBox)footerItem.FindControl("newSubBrokerCode"); foreach (GridDataItem dataItem in gvSubBrokerCleansing.MasterTableView.Items) { if ((dataItem.FindControl("chkItem") as CheckBox).Checked) { i = i + 1; } } if (i == 0) { ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Please Select Item To Apply SubBrokerCode !');", true); return; } else { foreach (GridDataItem dataItem in gvSubBrokerCleansing.MasterTableView.Items) { if ((dataItem.FindControl("chkItem") as CheckBox).Checked) { TextBox txtSubBrokerCode = dataItem.FindControl("txtSubBrokerCode") as TextBox; txtSubBrokerCode.Text = newSubBrokerCode.Text; } } } }
protected void btnSave_Click(object sender, EventArgs e) { string adjustValue = string.Empty; string UpdatedExpectedAmt = string.Empty; GridFooterItem footerRow = (GridFooterItem)gvCommissionReceiveRecon.MasterTableView.GetItems(GridItemType.Footer)[0]; foreach (GridDataItem dr in gvCommissionReceiveRecon.Items) { if (dr["ReconStatus"].Text == "closed") { msgReconClosed.Visible = true; } else { if (((TextBox)footerRow.FindControl("txtAdjustAmountMultiple")).Text.Trim() == "") { adjustValue = ((TextBox)dr.FindControl("txtAdjustAmount")).Text; } else { adjustValue = ((TextBox)footerRow.FindControl("txtAdjustAmountMultiple")).Text; } CheckBox checkBox = (CheckBox)dr.FindControl("chkId"); if (checkBox.Checked) { if (!(string.IsNullOrEmpty(dr["expectedamount"].Text)) & !string.IsNullOrEmpty(adjustValue)) { UpdatedExpectedAmt = (double.Parse(dr["expectedamount"].Text) + double.Parse(adjustValue)).ToString(); dr["UpdatedExpectedAmount"].Text = UpdatedExpectedAmt; } else if (!(string.IsNullOrEmpty(dr["expectedamount"].Text))) { UpdatedExpectedAmt = (double.Parse(dr["expectedamount"].Text)).ToString(); dr["UpdatedExpectedAmount"].Text = UpdatedExpectedAmt; } else if (!string.IsNullOrEmpty(adjustValue)) { UpdatedExpectedAmt = (double.Parse(adjustValue)).ToString(); dr["UpdatedExpectedAmount"].Text = UpdatedExpectedAmt; } } } } }
protected void grdFollowUpBudget_ItemCreated(object sender, GridItemEventArgs e) { try { string budgetVersion = ReturnBudgetVersionFromCombo(); if (!IsDeleteButtonEnable()) { if (e.Item is GridFooterItem) { GridFooterItem commandItem = e.Item as GridFooterItem; IndImageButton button = commandItem.FindControl("btnDelete") as IndImageButton; button.Enabled = false; button.ImageUrl = ResolveUrl("~/Images/buttons_delete_disabled.png"); } if (e.Item is GridItem) { GridItem itm = e.Item as GridItem; CheckBox ck = itm.FindControl("chkDeleteCol") as CheckBox; if (ck != null) { ck.Enabled = false; } } } if (e.Item is GridFooterItem) { GridFooterItem commandItem = e.Item as GridFooterItem; LinkButton navigateAll = commandItem.FindControl("btnNavigateAll") as LinkButton; if (IsBATAOrPM(currentUser) || IsFunctionalManager(currentUser)) { switch (CmbTypeSelectedValue) { case ApplicationConstants.BUDGET_TYPE_INITIAL: navigateAll.PostBackUrl = "~/Pages/Budget/WPPreselection/WPPreselection.aspx?Code=" + ApplicationConstants.MODULE_INITIAL + "&IdAssociate=" + ApplicationConstants.INT_NULL_VALUE + "&BudgetVersion=" + budgetVersion + "&IsFromFollowUp=1"; break; case ApplicationConstants.BUDGET_TYPE_REVISED: navigateAll.PostBackUrl = "~/Pages/Budget/WPPreselection/WPPreselection.aspx?Code=" + ApplicationConstants.MODULE_REVISED + "&IdAssociate=" + ApplicationConstants.INT_NULL_VALUE + "&BudgetVersion=" + budgetVersion + "&IsFromFollowUp=1"; break; case ApplicationConstants.BUDGET_TYPE_TOCOMPLETION: navigateAll.PostBackUrl = "~/Pages/Budget/WPPreselection/WPPreselection.aspx?Code=" + ApplicationConstants.MODULE_REFORECAST + "&IdAssociate=" + ApplicationConstants.INT_NULL_VALUE + "&BudgetVersion=" + budgetVersion + "&IsFromFollowUp=1"; break; default: navigateAll.PostBackUrl = "~/Pages/Budget/WPPreselection/WPPreselection.aspx?Code=" + ApplicationConstants.MODULE_INITIAL + "&IdAssociate=" + ApplicationConstants.INT_NULL_VALUE; break; } navigateAll.PostBackUrl += "&BudgetType=" + (cmbType.SelectedIndex - 1); } else { navigateAll.Visible = false; } } } catch (IndException ex) { ShowError(ex); return; } catch (Exception ex) { ShowError(new IndException(ex)); return; } }
protected void btnEditSelectedWPTrans_Click(object sender, EventArgs e) { //int Id = 0; string panNumber = string.Empty; string tradeAccountNumber = string.Empty; string scripCode = string.Empty; string newScripCode = string.Empty; string exchange = string.Empty; string price = string.Empty; string newPrice = string.Empty; string transactionType = string.Empty; string newTransactionType = string.Empty; bool blResult = false; rejectedRecordsBo = new RejectedRecordsBo(); // Gets the footer row directly Cool right! // GridViewRow footerRow = gvWERPTrans.FooterRow; GridFooterItem footerItem = sender as GridFooterItem; string newPanNumber = ((TextBox)footerItem.FindControl("txtPanNumberMultiple")).Text; if (((TextBox)footerItem.FindControl("txtScripCodeMultiple")).Text != string.Empty) { newScripCode = ((TextBox)footerItem.FindControl("txtScripCodeMultiple")).Text; } string newExchange = ((TextBox)footerItem.FindControl("txtExchangeMultiple")).Text; if (((DropDownList)footerItem.FindControl("ddlTransactionType")).SelectedValue != "-1") { newTransactionType = ((DropDownList)footerItem.FindControl("ddlTransactionType")).SelectedValue; } if (((TextBox)footerItem.FindControl("txtPriceMultiple")).Text != string.Empty) { newPrice = ((TextBox)footerItem.FindControl("txtPriceMultiple")).Text; } foreach (GridDataItem dr in gvWERPTrans.Items) { CheckBox checkBox = (CheckBox)dr.FindControl("chkBxWPTrans"); if (checkBox.Checked) { if (newPanNumber != "" || newScripCode != "" || newExchange != "" || newPrice != "" || newTransactionType != "") //Change this logic { panNumber = newPanNumber; scripCode = newScripCode; exchange = newExchange; transactionType = newTransactionType; price = newPrice; } else { panNumber = ((TextBox)dr.FindControl("txtPanNumber")).Text; if (((TextBox)dr.FindControl("txtScripCode")).Text != string.Empty) { scripCode = ((TextBox)dr.FindControl("txtScripCode")).Text; } exchange = ((TextBox)dr.FindControl("txtExchange")).Text; transactionType = ((DropDownList)dr.FindControl("ddlTransactionType")).SelectedValue; // price = Convert.ToDouble(((TextBox)dr.FindControl("txtPrice")).Text); price = ((TextBox)dr.FindControl("txtPrice")).Text; } int id = Convert.ToInt32(gvWERPTrans.MasterTableView.DataKeyNames[dr.RowIndex].ToString()); blResult = rejectedRecordsBo.UpdateRejectedEquityTransactionStaging(id, panNumber, scripCode, exchange, price.ToString(), transactionType); } } if (blResult) { // Success Message } else { // Failure Message } // BindGrid if (Request.QueryString["processId"] != null) { ProcessId = Int32.Parse(Request.QueryString["processId"].ToString()); } BindEquityTransactionGrid(ProcessId); }
protected void RadOtherVaccine_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { if (ViewState["TblImmunisation"] == null) { DtImmunisation = CreateImmunisationTable(); } else { DtImmunisation = (DataTable)ViewState["TblImmunisation"]; } DataRow DR = DtImmunisation.NewRow(); int dtnextId = Convert.ToInt32(DtImmunisation.Rows.Count) + 1; if (e.CommandName == "Insert") { if (RadOtherVaccine != null) { // GridItem[] footerItems = RadOtherVaccine.MasterTableView.GetItems(GridItemType.Footer); GridFooterItem footeritem = (GridFooterItem)RadOtherVaccine.MasterTableView.GetItems(GridItemType.Footer)[0]; if (footeritem != null) { Telerik.Web.UI.RadTextBox txtimmuOther = (Telerik.Web.UI.RadTextBox)footeritem.FindControl("txtFooterRadVaccineName"); Telerik.Web.UI.RadButton btnFooterOthers = (Telerik.Web.UI.RadButton)footeritem.FindControl("btnFooterOthers"); Telerik.Web.UI.RadButton btnCatchupFooterOthers = (Telerik.Web.UI.RadButton)footeritem.FindControl("btnCatchupFooterOthers"); Telerik.Web.UI.RadDatePicker dtFooterOtherDate = (Telerik.Web.UI.RadDatePicker)footeritem.FindControl("dtFooterOtherDate"); if (ValidateAddImmunisation(txtimmuOther.Text.ToString(), dtFooterOtherDate.SelectedDate, btnFooterOthers.SelectedToggleState.Text.ToString()) == false) { RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "JumpToGrid", "document.location = '#sGrid';", true); return; } DR["ImmunisationOther"] = txtimmuOther.Text; DR["ImmunisationDate"] = Convert.ToDateTime(dtFooterOtherDate.SelectedDate.ToString()).ToShortDateString(); DR["ImmunisationCU"] = btnCatchupFooterOthers.SelectedToggleState.Text; DR["Administered"] = btnFooterOthers.SelectedToggleState.Text; DR["ID"] = dtnextId.ToString() + txtimmuOther.Text; DR["EditMode"] = "DELETE"; DtImmunisation.Rows.Add(DR); ViewState["TblImmunisation"] = DtImmunisation; RadOtherVaccine.DataSource = DtImmunisation; RadOtherVaccine.DataBind(); } } } //GridDataItem row = RadGrid1.Items[rowNo]; }
protected void btnSave_Click(object sender, EventArgs e) { string newScheme = string.Empty; string PanNum = string.Empty; string TransactionType = string.Empty; string FolioNumber = string.Empty; double Price = 0; double Units = 0; double Amount = 0; int UserTransactionNo = 0; int CMFTSId = 0; bool blResult = false; rejectedRecordsBo = new RejectedRecordsBo(); GridFooterItem footerRow = (GridFooterItem)gvWERPTrans.MasterTableView.GetItems(GridItemType.Footer)[0]; foreach (GridDataItem dr in gvWERPTrans.Items) { if (((TextBox)footerRow.FindControl("txtSchemeFooter")).Text.Trim() == "") { newScheme = ((TextBox)dr.FindControl("txtScheme")).Text; } else { newScheme = ((TextBox)footerRow.FindControl("txtSchemeFooter")).Text; } if (((TextBox)footerRow.FindControl("txtPanFooter")).Text.Trim() == "") { PanNum = ((TextBox)dr.FindControl("txtPanNum")).Text; } else { PanNum = ((TextBox)footerRow.FindControl("txtPanFooter")).Text; } if (((TextBox)footerRow.FindControl("txtTransactionFooter")).Text.Trim() == "") { TransactionType = ((TextBox)dr.FindControl("txtTransaction")).Text; } else { TransactionType = ((TextBox)footerRow.FindControl("txtTransactionFooter")).Text; } if (((TextBox)footerRow.FindControl("txtFolioNumberFooter")).Text.Trim() == "") { FolioNumber = ((TextBox)dr.FindControl("txtFolioNumber")).Text; } else { FolioNumber = ((TextBox)footerRow.FindControl("txtFolioNumberFooter")).Text; } if (((TextBox)footerRow.FindControl("txtPriceFooter")).Text.Trim() == "") { Price = Convert.ToDouble(((TextBox)dr.FindControl("txtPrice")).Text); } else { Price = Convert.ToDouble(((TextBox)footerRow.FindControl("txtPriceFooter")).Text); } if (((TextBox)footerRow.FindControl("txtUnitsFooter")).Text.Trim() == "") { Units = Convert.ToDouble(((TextBox)dr.FindControl("txtUnits")).Text); } else { Units = Convert.ToDouble(((TextBox)footerRow.FindControl("txtUnitsFooter")).Text); } if (((TextBox)footerRow.FindControl("txtAmountFooter")).Text.Trim() == "") { Amount = Convert.ToDouble(((TextBox)dr.FindControl("txtAmount")).Text); } else { Amount = Convert.ToDouble(((TextBox)footerRow.FindControl("txtAmountFooter")).Text); } if (((TextBox)footerRow.FindControl("txtUsertransactionFooter")).Text.Trim() == "") { UserTransactionNo = Convert.ToInt32(((TextBox)dr.FindControl("txtUsertransaction")).Text); } else { UserTransactionNo = Convert.ToInt32(((TextBox)footerRow.FindControl("txtUsertransactionFooter")).Text); } CheckBox checkBox = (CheckBox)dr.FindControl("chkId"); if (checkBox.Checked) { int selectedRow = 0; GridDataItem gdi; gdi = (GridDataItem)checkBox.NamingContainer; selectedRow = gdi.ItemIndex + 1; CMFTSId = int.Parse((gvWERPTrans.MasterTableView.DataKeyValues[selectedRow - 1]["CMFTSId"].ToString())); blResult = rejectedRecordsBo.UpdateMFTrasactionStaging(CMFTSId, PanNum, newScheme, TransactionType, FolioNumber, Price, Units, Amount, UserTransactionNo); } } if (blResult) { // Success Message } else { // Failure Message } // BindGrid if (Request.QueryString["processId"] != null) { ProcessId = Int32.Parse(Request.QueryString["processId"].ToString()); } if (Request.QueryString["filetypeid"] != null) { filetypeId = Int32.Parse(Request.QueryString["filetypeid"].ToString()); } //BindGrid(ProcessId); BindEquityTransactionGrid(ProcessId); }
protected void TxtBillFor_TextChanged(object sender, EventArgs e) { if (lblSessionRate.Text.ToString() != string.Empty || lblSessionRate.Text.ToString() != "") { Decimal GrandTotal2 = 0; int PCount2 = 0; foreach (GridDataItem Item in FoodBillingListView.Items) { RadNumericTextBox TxtBillfor = (RadNumericTextBox)Item.FindControl("TxtBillFor"); Decimal BillingRate = Convert.ToDecimal(lblSessionRate.Text.ToString()); Decimal Billfor = Decimal.Parse(TxtBillfor.Text.ToString()); RadNumericTextBox Amount = (RadNumericTextBox)Item.FindControl("TxtAmnt"); Amount.Text = Convert.ToString(Billfor * BillingRate); GrandTotal2 = GrandTotal2 + Convert.ToDecimal(Amount.Text.ToString()); RadNumericTextBox rtbPCount = (RadNumericTextBox)Item.FindControl("TxtBillFor"); PCount2 = PCount2 + Convert.ToInt16(rtbPCount.Text.ToString()); } GridFooterItem footeritem = (GridFooterItem)FoodBillingListView.MasterTableView.GetItems(GridItemType.Footer)[0]; RadNumericTextBox Total = (RadNumericTextBox)footeritem.FindControl("lblTotalAmnt"); Total.Text = GrandTotal2.ToString(); RadNumericTextBox PCTotal2 = (RadNumericTextBox)footeritem.FindControl("lblPCount"); PCTotal2.Text = PCount2.ToString(); LoadGrid1(); } else { foreach (GridDataItem Item in FoodBillingListView.Items) { RadNumericTextBox Amount = (RadNumericTextBox)Item.FindControl("TxtAmnt"); Amount.Text = string.Empty; } GridFooterItem footeritem = (GridFooterItem)FoodBillingListView.MasterTableView.GetItems(GridItemType.Footer)[0]; RadNumericTextBox Total = (RadNumericTextBox)footeritem.FindControl("lblTotalAmnt"); Total.Text = string.Empty; } //Decimal GrandTotal2 = 0; //foreach (GridItem Item in FoodBillingListView.Items) //{ // SqlProcsNew sqlobj = new SqlProcsNew(); // DataSet TxtRate = new DataSet(); // DropDownList ddlist = (DropDownList)Item.FindControl("ddlBillingCode"); // TxtRate = sqlobj.ExecuteSP("[SP_FetchBillingRatetotextbox]", // new SqlParameter() { ParameterName = "@IMODE", SqlDbType = SqlDbType.Int, Value = 1 }, // new SqlParameter() { ParameterName = "@BCode", SqlDbType = SqlDbType.NVarChar, Value = ddlist.SelectedValue }); // if (TxtRate.Tables[0].Rows.Count > 0) // { // RadNumericTextBox TxtBillfor = (RadNumericTextBox)Item.FindControl("TxtBillFor"); // RadNumericTextBox BRate = (RadNumericTextBox)Item.FindControl("TxtBillCodeRate"); // BRate.Text = TxtRate.Tables[0].Rows[0]["Rate"].ToString(); // Decimal BillingRate = Convert.ToDecimal(TxtRate.Tables[0].Rows[0]["Rate"].ToString()); // Decimal Billfor = Decimal.Parse(TxtBillfor.Text.ToString()); // RadNumericTextBox Amount = (RadNumericTextBox)Item.FindControl("TxtAmnt"); // Amount.Text = Convert.ToString(Billfor * BillingRate); // GrandTotal2 = GrandTotal2 + Convert.ToDecimal(Amount.Text.ToString()); // } // else // { // WebMsgBox.Show("Select Billing Code and Billing Date."); // return; // } //} //GridFooterItem footeritem = (GridFooterItem)FoodBillingListView.MasterTableView.GetItems(GridItemType.Footer)[0]; //RadNumericTextBox Total = (RadNumericTextBox)footeritem.FindControl("lblTotalAmnt"); //Total.Text = GrandTotal2.ToString(); }
protected void BtnSave_Click(object sender, EventArgs e) { SqlProcsNew sqlobj = new SqlProcsNew(); string Uname = Session["UserID"].ToString(); if (HResult.Value == "true") { GridFooterItem footeritem2 = (GridFooterItem)FoodBillingListView.MasterTableView.GetItems(GridItemType.Footer)[0]; RadNumericTextBox Total2 = (RadNumericTextBox)footeritem2.FindControl("lblTotalAmnt"); RadNumericTextBox PCount2 = (RadNumericTextBox)footeritem2.FindControl("lblPCount"); if (Total2.Text != string.Empty) { foreach (GridItem rw in FoodBillingListView.Items) { //DropDownList dlist = (DropDownList)rw.FindControl("ddlBillingCode"); //RadNumericTextBox BRate = (RadNumericTextBox)rw.FindControl("TxtBillCodeRate"); //var Total = (RadNumericTextBox)footeritem.FindControl("lblTotalAmnt"); //Decimal DailyTotal = Decimal.Parse(Total.Text.ToString()); int RTRSN = Convert.ToInt32(rw.Cells[3].Text); RadNumericTextBox Bill = (RadNumericTextBox)rw.FindControl("TxtBillFor"); int Billfor = Convert.ToInt32(Bill.Text.ToString()); RadNumericTextBox Amount = (RadNumericTextBox)rw.FindControl("TxtAmnt"); Decimal BillingRate = Convert.ToDecimal(lblSessionRate.Text.ToString()); GridFooterItem footeritem = (GridFooterItem)FoodBillingListView.MasterTableView.GetItems(GridItemType.Footer)[0]; Decimal TAmount = Decimal.Parse(Amount.Text.ToString()); try { CheckBox Check = (CheckBox)rw.FindControl("ChkConfirm"); if (Check.Checked == true) { sqlobj.ExecuteSQLNonQuery("[SP_InsertFoodBillPostingDtls]", new SqlParameter() { ParameterName = "@IMODE", SqlDbType = SqlDbType.Int, Value = 1 }, new SqlParameter() { ParameterName = "@RTRSN", SqlDbType = SqlDbType.Int, Value = RTRSN }, new SqlParameter() { ParameterName = "@BCode", SqlDbType = SqlDbType.NVarChar, Value = ddlSession.SelectedValue }, new SqlParameter() { ParameterName = "@BRate", SqlDbType = SqlDbType.Decimal, Value = BillingRate }, new SqlParameter() { ParameterName = "@Date", SqlDbType = SqlDbType.DateTime, Direction = ParameterDirection.Input, Value = BillingDate.SelectedDate.ToString() }, new SqlParameter() { ParameterName = "@Bcount", SqlDbType = SqlDbType.Int, Value = Billfor }, new SqlParameter() { ParameterName = "@BAmount", SqlDbType = SqlDbType.Decimal, Value = TAmount }, new SqlParameter() { ParameterName = "@DTotAmount", SqlDbType = SqlDbType.Decimal, Value = Convert.ToDecimal(Total2.Text.ToString()) }, new SqlParameter() { ParameterName = "@EntryBy", SqlDbType = SqlDbType.NVarChar, Value = Uname }); } else { } } catch (Exception ex) { WebMsgBox.Show(ex.Message.ToString()); } } sqlobj.ExecuteSQLNonQuery("[SP_InsertGrpFoodBillLog]", new SqlParameter() { ParameterName = "@BDate", SqlDbType = SqlDbType.DateTime, Direction = ParameterDirection.Input, Value = Convert.ToDateTime(BillingDate.SelectedDate.ToString()) }, new SqlParameter() { ParameterName = "@BCode", SqlDbType = SqlDbType.NVarChar, Value = ddlSession.SelectedValue.ToString() }, new SqlParameter() { ParameterName = "@Dcount", SqlDbType = SqlDbType.Int, Value = Convert.ToInt16(PCount2.Text.ToString()) }, new SqlParameter() { ParameterName = "@DTotAmount", SqlDbType = SqlDbType.Decimal, Value = Convert.ToDecimal(Total2.Text.ToString()) }, new SqlParameter() { ParameterName = "@EntryBy", SqlDbType = SqlDbType.NVarChar, Value = Uname }); WebMsgBox.Show("Bill Detail Saved."); LoadSession(); LoadGrid(); LoadGrid1(); } else { WebMsgBox.Show("Please select the session."); } } else { } }
protected void btnSave1_Click(object sender, EventArgs e) { string pan = string.Empty; string transactionType = string.Empty; string productCode = string.Empty; bool blResult1 = false; int Id = 0; int tableNo = 0; uploadCommonBo = new UploadCommonBo(); GridFooterItem footerRow = (GridFooterItem)gvSIPReject.MasterTableView.GetItems(GridItemType.Footer)[0]; foreach (GridDataItem dr in gvSIPReject.Items) { if (((TextBox)footerRow.FindControl("txtPANNOFooter")).Text.Trim() == "") { pan = ((TextBox)dr.FindControl("txtPANNO")).Text; } else { pan = ((TextBox)footerRow.FindControl("txtPANNOFooter")).Text; } if (((TextBox)footerRow.FindControl("txtAUTTRNTYPFooter")).Text.Trim() == "") { transactionType = ((TextBox)dr.FindControl("txtAUTTRNTYP")).Text; } else { transactionType = ((TextBox)footerRow.FindControl("txtAUTTRNTYPFooter")).Text; } if (((TextBox)footerRow.FindControl("txtProductFooter")).Text.Trim() == "") { productCode = ((TextBox)dr.FindControl("txtProduct")).Text; } else { productCode = ((TextBox)footerRow.FindControl("txtProductFooter")).Text; } CheckBox checkBox = (CheckBox)dr.FindControl("chkId"); if (checkBox.Checked == true) { int selectedRow = 0; GridDataItem gdi; gdi = (GridDataItem)checkBox.NamingContainer; selectedRow = gdi.ItemIndex + 1; Id = int.Parse((gvSIPReject.MasterTableView.DataKeyValues[selectedRow - 1]["InputId"].ToString())); tableNo = int.Parse((gvSIPReject.MasterTableView.DataKeyValues[selectedRow - 1]["TableNo"].ToString())); blResult1 = uploadCommonBo.UpdateSIPRequestRejects(pan, Id, tableNo, transactionType, productCode); } } if (Request.QueryString["ReqId"] != null) { DataTable dtRequests = new DataTable(); DataSet dtProcessLogDetails = new DataSet(); reqId = Int32.Parse(Request.QueryString["ReqId"].ToString()); GetProfileIncreamentRejection(reqId); dtRequests = (DataTable)Cache["RequestReject" + userVo.UserId.ToString()]; gvSIPReject.Rebind(); } }
protected void btnSave_Click(object sender, EventArgs e) { string city = string.Empty; string state = string.Empty; string pincode = string.Empty; string mobileno = string.Empty; string occupation = string.Empty; string accounttype = string.Empty; string bankname = string.Empty; string personalstatus = string.Empty; bool blResult = false; int Id = 0; int tableNo = 0; string clientCode = string.Empty; string address1 = string.Empty; string address2 = string.Empty; string address3 = string.Empty; string country = string.Empty; string officePhoneNo = string.Empty; string officeExtensionNo = string.Empty; string officeFaxNo = string.Empty; string homePhoneNo = string.Empty; string homeFaxNo = string.Empty; string annualIncome = string.Empty; string pan1 = string.Empty; string pan2 = string.Empty; string pan3 = string.Empty; string emailId = string.Empty; string transactionType = string.Empty; string transactionNature = string.Empty; string transactionHead = string.Empty; string transactionDescription = string.Empty; string productCode = string.Empty; string accountNo = string.Empty; //string guardianDOB = string.Empty; uploadCommonBo = new UploadCommonBo(); GridFooterItem footerRow = (GridFooterItem)gvProfileIncreamenetReject.MasterTableView.GetItems(GridItemType.Footer)[0]; foreach (GridDataItem dr in gvProfileIncreamenetReject.Items) { if (((TextBox)footerRow.FindControl("txtClientCodeFooter")).Text.Trim() == "") { clientCode = ((TextBox)dr.FindControl("txtClientCode")).Text; } else { clientCode = ((TextBox)footerRow.FindControl("txtClientCodeFooter")).Text; } if (((TextBox)footerRow.FindControl("txtCityFooter")).Text.Trim() == "") { city = ((TextBox)dr.FindControl("txtCity")).Text; } else { city = ((TextBox)footerRow.FindControl("txtCityFooter")).Text; } if (((TextBox)footerRow.FindControl("txtStateFooter")).Text.Trim() == "") { state = ((TextBox)dr.FindControl("txtState")).Text; } else { state = ((TextBox)footerRow.FindControl("txtStateFooter")).Text; } if (((TextBox)footerRow.FindControl("txtPinCodeFooter")).Text.Trim() == "") { pincode = ((TextBox)dr.FindControl("txtPinCode")).Text; } else { pincode = ((TextBox)footerRow.FindControl("txtPinCodeFooter")).Text; } if (((TextBox)footerRow.FindControl("txtMobileNoFooter")).Text.Trim() == "") { mobileno = ((TextBox)dr.FindControl("txtMobileNo")).Text; } else { mobileno = ((TextBox)footerRow.FindControl("txtMobileNoFooter")).Text; } if (((TextBox)footerRow.FindControl("txtOccupationFooter")).Text.Trim() == "") { occupation = ((TextBox)dr.FindControl("txtOccupation")).Text; } else { occupation = ((TextBox)footerRow.FindControl("txtOccupationFooter")).Text; } if (((TextBox)footerRow.FindControl("txtAccountTypeFooter")).Text.Trim() == "") { accounttype = ((TextBox)dr.FindControl("txtAccountType")).Text; } else { accounttype = ((TextBox)footerRow.FindControl("txtAccountTypeFooter")).Text; } if (((TextBox)footerRow.FindControl("txtBankNameFooter")).Text.Trim() == "") { bankname = ((TextBox)dr.FindControl("txtBankName")).Text; } else { bankname = ((TextBox)footerRow.FindControl("txtBankNameFooter")).Text; } if (((TextBox)footerRow.FindControl("txtPersonalStatusFooter")).Text.Trim() == "") { personalstatus = ((TextBox)dr.FindControl("txtPersonalStatus")).Text; } else { personalstatus = ((TextBox)footerRow.FindControl("txtPersonalStatusFooter")).Text; } if (((TextBox)footerRow.FindControl("txtAddress1Footer")).Text.Trim() == "") { address1 = ((TextBox)dr.FindControl("txtAddress1")).Text; } else { address1 = ((TextBox)footerRow.FindControl("txtAddress1Footer")).Text; } if (((TextBox)footerRow.FindControl("txtAddress2Footer")).Text.Trim() == "") { address2 = ((TextBox)dr.FindControl("txtAddress2")).Text; } else { address2 = ((TextBox)footerRow.FindControl("txtAddress2Footer")).Text; } if (((TextBox)footerRow.FindControl("txtAddress3Footer")).Text.Trim() == "") { address3 = ((TextBox)dr.FindControl("txtAddress3")).Text; } else { address3 = ((TextBox)footerRow.FindControl("txtAddress3Footer")).Text; } if (((TextBox)footerRow.FindControl("txtCountryFooter")).Text.Trim() == "") { country = ((TextBox)dr.FindControl("txtCountry")).Text; } else { country = ((TextBox)footerRow.FindControl("txtCountryFooter")).Text; } if (((TextBox)footerRow.FindControl("txtOfficePhoneNoFooter")).Text.Trim() == "") { officePhoneNo = ((TextBox)dr.FindControl("txtOfficePhoneNo")).Text; } else { officePhoneNo = ((TextBox)footerRow.FindControl("txtOfficePhoneNoFooter")).Text; } if (((TextBox)footerRow.FindControl("txtOfficeExtensionNoFooter")).Text.Trim() == "") { officeExtensionNo = ((TextBox)dr.FindControl("txtOfficeExtensionNo")).Text; } else { officeExtensionNo = ((TextBox)footerRow.FindControl("txtOfficeExtensionNoFooter")).Text; } if (((TextBox)footerRow.FindControl("txtOfficeFaxNoFooter")).Text.Trim() == "") { officeFaxNo = ((TextBox)dr.FindControl("txtOfficeFaxNo")).Text; } else { officeFaxNo = ((TextBox)footerRow.FindControl("txtOfficeFaxNoFooter")).Text; } if (((TextBox)footerRow.FindControl("txtHomePhoneNoFooter")).Text.Trim() == "") { homePhoneNo = ((TextBox)dr.FindControl("txtHomePhoneNo")).Text; } else { homePhoneNo = ((TextBox)footerRow.FindControl("txtHomePhoneNoFooter")).Text; } if (((TextBox)footerRow.FindControl("txtHomeFaxNoFooter")).Text.Trim() == "") { homeFaxNo = ((TextBox)dr.FindControl("txtHomeFaxNo")).Text; } else { homeFaxNo = ((TextBox)footerRow.FindControl("txtHomeFaxNoFooter")).Text; } if (((TextBox)footerRow.FindControl("txtAnnualIncomeFooter")).Text.Trim() == "") { annualIncome = ((TextBox)dr.FindControl("txtAnnualIncome")).Text; } else { annualIncome = ((TextBox)footerRow.FindControl("txtAnnualIncomeFooter")).Text; } if (((TextBox)footerRow.FindControl("txtPANNO1Footer")).Text.Trim() == "") { pan1 = ((TextBox)dr.FindControl("txtPANNO1")).Text; } else { pan1 = ((TextBox)footerRow.FindControl("txtPANNO1Footer")).Text; } if (((TextBox)footerRow.FindControl("txtPANNO2Footer")).Text.Trim() == "") { pan2 = ((TextBox)dr.FindControl("txtPANNO2")).Text; } else { pan2 = ((TextBox)footerRow.FindControl("txtPANNO2Footer")).Text; } if (((TextBox)footerRow.FindControl("txtPANNO3Footer")).Text.Trim() == "") { pan3 = ((TextBox)dr.FindControl("txtPANNO3")).Text; } else { pan3 = ((TextBox)footerRow.FindControl("txtPANNO3Footer")).Text; } if (((TextBox)footerRow.FindControl("txtEmailIdFooter")).Text.Trim() == "") { emailId = ((TextBox)dr.FindControl("txtEmailId")).Text; } else { emailId = ((TextBox)footerRow.FindControl("txtEmailIdFooter")).Text; } if (((TextBox)footerRow.FindControl("txtTransactionTypeFooter")).Text.Trim() == "") { transactionType = ((TextBox)dr.FindControl("txtTransactionType")).Text; } else { transactionType = ((TextBox)footerRow.FindControl("txtTransactionTypeFooter")).Text; } if (((TextBox)footerRow.FindControl("txtTransactionNatureFooter")).Text.Trim() == "") { transactionNature = ((TextBox)dr.FindControl("txtTransactionNature")).Text; } else { transactionNature = ((TextBox)footerRow.FindControl("txtTransactionNatureFooter")).Text; } if (((TextBox)footerRow.FindControl("txtTransactionHeadFooter")).Text.Trim() == "") { transactionHead = ((TextBox)dr.FindControl("txtTransactionHead")).Text; } else { transactionHead = ((TextBox)footerRow.FindControl("txtTransactionHeadFooter")).Text; } if (((TextBox)footerRow.FindControl("txtTransactionDescriptionFooter")).Text.Trim() == "") { transactionDescription = ((TextBox)dr.FindControl("txtTransactionDescription")).Text; } else { transactionDescription = ((TextBox)footerRow.FindControl("txtTransactionDescriptionFooter")).Text; } if (((TextBox)footerRow.FindControl("txtProductCodeFooter")).Text.Trim() == "") { productCode = ((TextBox)dr.FindControl("txtProductCode")).Text; } else { productCode = ((TextBox)footerRow.FindControl("txtProductCodeFooter")).Text; } if (((TextBox)footerRow.FindControl("txtAccountNoFooter")).Text.Trim() == "") { accountNo = ((TextBox)dr.FindControl("txtAccountNo")).Text; } else { accountNo = ((TextBox)footerRow.FindControl("txtAccountNoFooter")).Text; } CheckBox checkBox = (CheckBox)dr.FindControl("chkId"); if (checkBox.Checked == true) { int selectedRow = 0; GridDataItem gdi; gdi = (GridDataItem)checkBox.NamingContainer; selectedRow = gdi.ItemIndex + 1; Id = int.Parse((gvProfileIncreamenetReject.MasterTableView.DataKeyValues[selectedRow - 1]["ID"].ToString())); tableNo = int.Parse((gvProfileIncreamenetReject.MasterTableView.DataKeyValues[selectedRow - 1]["TableNo"].ToString())); blResult = uploadCommonBo.UpdateRequestRejects(clientCode, Id, tableNo, city, state, pincode, mobileno, occupation, accounttype, bankname, personalstatus, address1, address2, address3, country, officePhoneNo, officeExtensionNo, officeFaxNo, homePhoneNo, homeFaxNo, annualIncome, pan1, pan2, pan3, emailId, transactionType, transactionNature, transactionHead, transactionDescription, productCode, accountNo); } } if (Request.QueryString["ReqId"] != null) { DataTable dtRequests = new DataTable(); DataSet dtProcessLogDetails = new DataSet(); reqId = Int32.Parse(Request.QueryString["ReqId"].ToString()); GetProfileIncreamentRejection(reqId); dtRequests = (DataTable)Cache["RequestReject" + userVo.UserId.ToString()]; { if (ViewState["RejectReason"] != null) { rcbType = ViewState["RejectReason"].ToString(); } if (!string.IsNullOrEmpty(rcbType)) { DataView dvStaffList = new DataView(dtRequests, "RejectedReasonDescription = '" + rcbType + "'", "", DataViewRowState.CurrentRows); gvProfileIncreamenetReject.DataSource = dvStaffList.ToTable(); GridColumn column = gvProfileIncreamenetReject.MasterTableView.GetColumnSafe("RejectedReasonDescription"); column.CurrentFilterFunction = GridKnownFunction.Contains; gvProfileIncreamenetReject.MasterTableView.Rebind(); } else { GetProfileIncreamentRejection(reqId); } } } }
protected void btnConfirmOrder_Click(object sender, EventArgs e) { int issueDetId = 0; int catId = 0; //string Custcategory=""; // if (ViewState["CustCat"] != null) // Custcategory = (string)ViewState["CustCat"]; string confirmValue = Request.Form["confirm_value"]; if (confirmValue == "Yes") { // this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('You clicked YES!')", true); //} //else //{ // this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('You clicked NO!')", true); //} Button Button = (Button)sender; minQty = int.Parse(ViewState["minQty"].ToString()); maxQty = int.Parse(ViewState["maxQty"].ToString()); int MaxAppNo = Convert.ToInt32(gvCommMgmt.MasterTableView.DataKeyValues[0]["AIM_MaxApplNo"].ToString()); int FaceValue = Convert.ToInt32(gvCommMgmt.MasterTableView.DataKeyValues[0]["AIM_FaceValue"].ToString()); DataTable dt = new DataTable(); bool isValid = false; //Need to be collect from Session... dt.Columns.Add("CustomerId"); dt.Columns.Add("AID_IssueDetailId"); dt.Columns.Add("AIM_IssueId"); dt.Columns.Add("Qty"); dt.Columns.Add("Amount"); dt.Columns.Add("CatId"); dt.Columns.Add("AcceptableCatId"); dt.Columns.Add("userId"); dt.Columns.Add("NomineeQuantity"); int rowNo = 0; int tableRow = 0; foreach (GridDataItem CBOrder in gvCommMgmt.MasterTableView.Items) { TextBox txtQuantity = (TextBox)gvCommMgmt.MasterTableView.Items[rowNo]["Quantity"].FindControl("txtQuantity"); TextBox NomineeQuantity = (TextBox)gvCommMgmt.MasterTableView.Items[rowNo]["NomineeQuantity"].FindControl("txtNomineeQuantity"); if (txtQuantity.Text == "0" || txtQuantity.Text == string.Empty) { if (rowNo < gvCommMgmt.MasterTableView.Items.Count) { rowNo = rowNo + 1; } continue; } OnlineBondVo.CustomerId = customerVo.CustomerId; OnlineBondVo.BankAccid = 1002321521; OnlineBondVo.PFISD_SeriesId = int.Parse(gvCommMgmt.MasterTableView.DataKeyValues[rowNo]["AID_IssueDetailId"].ToString()); OnlineBondVo.IssueId = Convert.ToInt32(gvCommMgmt.MasterTableView.DataKeyValues[rowNo]["AIM_IssueId"].ToString()); CheckBox Check = (CheckBox)gvCommMgmt.MasterTableView.Items[rowNo]["Check"].FindControl("cbOrderCheck"); catId = int.Parse(gvCommMgmt.MasterTableView.DataKeyValues[rowNo]["AIDCSR_Id"].ToString()); if (Check.Checked == true) { if (!string.IsNullOrEmpty(txtQuantity.Text)) { isValid = true; txtQuantity.Enabled = true; string catName = string.Empty; string Description = string.Empty; OnlineBondVo.Qty = Convert.ToInt32(txtQuantity.Text); TextBox txtAmount = (TextBox)gvCommMgmt.MasterTableView.Items[rowNo]["Amount"].FindControl("txtAmount"); OnlineBondVo.Amount = Convert.ToDouble(txtAmount.Text); dt.Rows.Add(); dt.Rows[tableRow]["CustomerId"] = OnlineBondVo.CustomerId; dt.Rows[tableRow]["AID_IssueDetailId"] = OnlineBondVo.PFISD_SeriesId; dt.Rows[tableRow]["AIM_IssueId"] = OnlineBondVo.IssueId; dt.Rows[tableRow]["Qty"] = OnlineBondVo.Qty; dt.Rows[tableRow]["Amount"] = OnlineBondVo.Amount; dt.Rows[tableRow]["userid"] = userVo.UserId; if (lblNomineeTwo.Text != "" && Request.QueryString["BondType"] == "FISSGB") { dt.Rows[tableRow]["NomineeQuantity"] = NomineeQuantity.Text; } else { dt.Rows[tableRow]["NomineeQuantity"] = 0; } GridFooterItem footerItemAmount = (GridFooterItem)gvCommMgmt.MasterTableView.GetItems(GridItemType.Footer)[0]; Label lblSum = (Label)footerItemAmount.FindControl("lblAmount"); OnlineBondBo.GetCustomerCat(OnlineBondVo.IssueId, customerVo.CustomerId, adviserVo.advisorId, Convert.ToDouble(lblSum.Text), ref catName, ref issueDetId, ref EligblecatId, ref Description); dt.Rows[tableRow]["CatId"] = catId; dt.Rows[tableRow]["AcceptableCatId"] = EligblecatId; } } if (rowNo < gvCommMgmt.MasterTableView.Items.Count) { if (dt.Rows.Count >= 1) { rowNo = rowNo + 1; tableRow++; } } else { break; } } GridFooterItem ftItemAmount = (GridFooterItem)gvCommMgmt.MasterTableView.GetItems(GridItemType.Footer)[0]; Label lbltotAmt = (Label)ftItemAmount.FindControl("lblAmount"); if (isValid) { Quantity = Convert.ToInt64(ViewState["Qty"].ToString()); sum = Convert.ToInt64(ViewState["Sum"].ToString()); if (Convert.ToDouble(lblAvailableLimits.Text) == 0) { trinsufficentmessage.Visible = true; //lblinsufficent.Text = "Order cannot be processed due to insufficient balance"; //lblinsufficent.ForeColor = Color.Red; //Color co = new Color(); tblMessage.Visible = true; msgRecordStatus.Visible = false; //ShowMessage(lblinsufficent.Text); //// tdsubmit.Visible = false; // lnlBack.Visible = true; // Font testFont = new Font(fontName, 16.0f, FontStyle.Regular, //GraphicsUnit.Pixel); } else if (ViewState["CustCat"] == null) { string category = (string)ViewState["CustCat"]; if (category == string.Empty) { ShowMessage("Please enter no of bonds within the range permissible."); } } else if (Convert.ToDouble(lbltotAmt.Text) > Convert.ToDouble(lblAvailableLimits.Text)) { ShowMessage("Order cannot be processed. Insufficient balance"); // tdsubmit.Visible = false; // lnlBack.Visible = true; } else if (FaceValue > sum) { ShowMessage("Application amount is less than face value."); // tdsubmit.Visible = false; // lnlBack.Visible = true; } else if (Quantity < minQty) { foreach (GridDataItem CBOrder in gvCommMgmt.MasterTableView.Items) { TextBox txtsumQuantity = (TextBox)gvCommMgmt.MasterTableView.Items[CBOrder.ItemIndex]["Quantity"].FindControl("txtQuantity"); TextBox txtsumAmount = (TextBox)gvCommMgmt.MasterTableView.Items[CBOrder.ItemIndex]["Amount"].FindControl("txtAmount"); GridFooterItem footerItem = (GridFooterItem)gvCommMgmt.MasterTableView.GetItems(GridItemType.Footer)[0]; Label lblQty = (Label)footerItem.FindControl("lblQuantity"); GridFooterItem footerItemAmount = (GridFooterItem)gvCommMgmt.MasterTableView.GetItems(GridItemType.Footer)[0]; Label lblSum = (Label)footerItemAmount.FindControl("lblAmount"); ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "MyScript", "alert('Order cannot be processed.Please enter quantity greater than or equal to min quantity required')", true); // ShowMessage(message); txtsumQuantity.Text = ""; txtsumAmount.Text = ""; lblQty.Text = ""; lblSum.Text = ""; } } else if (Quantity > maxQty) { foreach (GridDataItem CBOrder in gvCommMgmt.MasterTableView.Items) { TextBox txtsumQuantity = (TextBox)gvCommMgmt.MasterTableView.Items[CBOrder.ItemIndex]["Quantity"].FindControl("txtQuantity"); TextBox txtsumAmount = (TextBox)gvCommMgmt.MasterTableView.Items[CBOrder.ItemIndex]["Amount"].FindControl("txtAmount"); GridFooterItem footerItem = (GridFooterItem)gvCommMgmt.MasterTableView.GetItems(GridItemType.Footer)[0]; Label lblQty = (Label)footerItem.FindControl("lblQuantity"); GridFooterItem footerItemAmount = (GridFooterItem)gvCommMgmt.MasterTableView.GetItems(GridItemType.Footer)[0]; Label lblSum = (Label)footerItemAmount.FindControl("lblAmount"); ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "MyScript", "alert('Order cannot be processed.Please enter quantity less than or equal to maximum quantity allowed for this issue')", true); // ShowMessage(message); txtsumQuantity.Text = ""; txtsumAmount.Text = ""; lblQty.Text = ""; lblSum.Text = ""; } } else { // placing order IDictionary <string, string> orderIds = new Dictionary <string, string>(); IssuerId = int.Parse(ViewState["IssueId"].ToString()); double availableBalance = Convert.ToDouble(OnlineBondBo.GetUserRMSAccountBalance(customerVo.AccountId)); long totalOrderAmt = Convert.ToInt64(ViewState["Sum"].ToString()); //availableBalance = 40000; string message; string aplicationNoStatus = string.Empty; bool accountDebitStatus = false; int Applicationno = 0; int orderId = 0; if (availableBalance >= totalOrderAmt) { orderIds = OnlineBondBo.onlineBOndtransact(dt, adviserVo.advisorId, IssuerId); orderId = int.Parse(orderIds["Order_Id"].ToString()); if (orderId != 0) { accountDebitStatus = OnlineBondBo.DebitRMSUserAccountBalance(customerVo.AccountId, -totalOrderAmt, orderId, out debitStatus); ShowAvailableLimits(); } Applicationno = int.Parse(orderIds["application"].ToString()); aplicationNoStatus = orderIds["aplicationNoStatus"].ToString(); ViewState["OrderId"] = orderId; ViewState["application"] = Applicationno; btnConfirmOrder.Enabled = false; Label3.Visible = false; } tdsubmit.Visible = false; message = CreateUserMessage(orderId, Applicationno, accountDebitStatus, aplicationNoStatus, debitStatus); ShowMessage(message); lnlBack.Visible = true; } } else { ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "MyScript", "alert('Please Enter Quantity')", true); } } }
protected void txtQuantity_TextChanged(object sender, EventArgs e) { int rowindex1 = ((GridDataItem)((TextBox)sender).NamingContainer).RowIndex; int rowindex = (rowindex1 / 2) - 1; int issueId = Convert.ToInt32(Request.QueryString["IssuerId"]); string catName = string.Empty; string Description = string.Empty; int catId = 0; int issuedetId = 0; double AIM_FaceValue = 0.0; int nomineeqty = 0; TextBox txtQuantitys = (TextBox)sender; //GridDataItem dr=(GridDataItem)txtQuantitys.NamingContainer; //RadGrid gvIssueList = (RadGrid)dr.FindControl("gvIssueList"); int minQty = int.Parse(gvIssueList.MasterTableView.DataKeyValues[0]["AIM_MInQty"].ToString()); int maxQty = int.Parse(gvIssueList.MasterTableView.DataKeyValues[0]["AIM_MaxQty"].ToString()); DateTime t1 = Convert.ToDateTime(DateTime.Now); DateTime cuffOff = DateTime.Parse(gvIssueList.MasterTableView.DataKeyValues[0]["AIM_CutOffTime"].ToString()); if (cuffOff.TimeOfDay.Ticks < t1.TimeOfDay.Ticks) { hdIscuttOff.Value = "true"; } TextBox txtQuantity = (TextBox)gvCommMgmt.MasterTableView.Items[rowindex]["Quantity"].FindControl("txtQuantity"); if (!string.IsNullOrEmpty(txtQuantity.Text)) { string message = string.Empty; int rowno = 0; int PFISD_InMultiplesOf = Convert.ToInt32(gvCommMgmt.MasterTableView.DataKeyValues[rowindex]["AIM_TradingInMultipleOf"].ToString()); // Regex re = new Regex(@"[@\\*+#^\\.\$\-?A-Za-z]+"); Regex re = new Regex(@"^[1-9]\d*$"); if (re.IsMatch(txtQuantity.Text)) { int Qty = Convert.ToInt32(txtQuantity.Text); int Mod = Qty % PFISD_InMultiplesOf; if (Mod != 0) { string messageMultiples = "Please enter quantity greater than or equal to min quantity required and in multiples of " + PFISD_InMultiplesOf.ToString(); ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "MyScript", "alert('" + messageMultiples + "')", true); txtQuantity.Text = ""; return; } AIM_FaceValue = Convert.ToDouble(gvCommMgmt.MasterTableView.DataKeyValues[rowindex]["AID_SeriesFaceValue"].ToString()); TextBox txtAmount = (TextBox)gvCommMgmt.MasterTableView.Items[rowindex]["Amount"].FindControl("txtAmount"); txtAmount.Text = Convert.ToString(Qty * AIM_FaceValue); CheckBox cbSelectOrder = (CheckBox)gvCommMgmt.MasterTableView.Items[rowindex]["Check"].FindControl("cbOrderCheck"); cbSelectOrder.Checked = true; foreach (GridDataItem CBOrder in gvCommMgmt.MasterTableView.Items) { TextBox txtsumQuantity = (TextBox)gvCommMgmt.MasterTableView.Items[rowno]["Quantity"].FindControl("txtQuantity"); TextBox txtsumAmount = (TextBox)gvCommMgmt.MasterTableView.Items[rowno]["Amount"].FindControl("txtAmount"); TextBox txtsumNomineeQuantity = (TextBox)gvCommMgmt.MasterTableView.Items[rowno]["NomineeQuantity"].FindControl("txtNomineeQuantity"); GridFooterItem footerItem = (GridFooterItem)gvCommMgmt.MasterTableView.GetItems(GridItemType.Footer)[0]; Label lblQty = (Label)footerItem.FindControl("lblQuantity"); GridFooterItem footerItemAmount = (GridFooterItem)gvCommMgmt.MasterTableView.GetItems(GridItemType.Footer)[0]; Label lblSum = (Label)footerItemAmount.FindControl("lblAmount"); Label lblNomineeQty = (Label)footerItemAmount.FindControl("lblNomineeQty"); if (cbSelectOrder.Checked == true) { if (!string.IsNullOrEmpty(txtsumQuantity.Text) && !string.IsNullOrEmpty(txtsumAmount.Text)) { Quantity = Quantity + Convert.ToInt64(txtsumQuantity.Text); ViewState["Qty"] = Quantity; sum = sum + Convert.ToInt64(txtsumAmount.Text); ViewState["Sum"] = sum; lblQty.Text = Quantity.ToString(); lblSum.Text = sum.ToString(); nomineeqty = nomineeqty + Convert.ToInt32(txtsumNomineeQuantity.Text); txtsumNomineeQuantity.Text = txtsumQuantity.Text; //lblNomineeQty.Text = nomineeqty.ToString(); ViewState["nomineeQty"] = nomineeqty; // lb1AvailbleCat.Visible = true; OnlineBondBo.GetCustomerCat(issueId, customerVo.CustomerId, adviserVo.advisorId, Convert.ToDouble(lblSum.Text), ref catName, ref issuedetId, ref catId, ref Description); //OnlineBondBo.GetCustomerCat(issueId, customerVo.CustomerId, adviserVo.advisorId, Convert.ToDouble(lblSum.Text), ref catName, ref issuedetId, ref catId, ref Description); ViewState["CustCat"] = catName; //ViewState["Description"] = Description; if (Request.QueryString["BondType"] != "FISSGB") { lb1AvailbleCat.Text = " You have applied this issue under category : " + catName + "-" + Description; ShowMessage(lb1AvailbleCat.Text); } //if (catName == string.Empty) // ShowMessage("Bid category Not Available"); //txtTotAmt_ValueChanged(null, new EventArgs()); } } if (rowno < gvCommMgmt.MasterTableView.Items.Count) { rowno++; } else { break; } } if (Request.QueryString["BondType"] == "FISSGB") { if (int.Parse(ViewState["Qty"].ToString()) < minQty || int.Parse(ViewState["Qty"].ToString()) > maxQty) { ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "MyScript", "alert('Order cannot be processed.Please enter quantity greater than or equal to min quantity required')", true); } } } else { ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "MyScript", "alert('Please enter only Valid Numbers & in multiples of 1')", true); } } else { foreach (GridDataItem CBOrder in gvCommMgmt.MasterTableView.Items) { TextBox txtsumQuantity = (TextBox)gvCommMgmt.MasterTableView.Items[CBOrder.ItemIndex]["Quantity"].FindControl("txtQuantity"); TextBox txtsumAmount = (TextBox)gvCommMgmt.MasterTableView.Items[CBOrder.ItemIndex]["Amount"].FindControl("txtAmount"); GridFooterItem footerItem = (GridFooterItem)gvCommMgmt.MasterTableView.GetItems(GridItemType.Footer)[0]; Label lblQty = (Label)footerItem.FindControl("lblQuantity"); GridFooterItem footerItemAmount = (GridFooterItem)gvCommMgmt.MasterTableView.GetItems(GridItemType.Footer)[0]; Label lblSum = (Label)footerItemAmount.FindControl("lblAmount"); txtQuantity.Text = ""; txtsumQuantity.Text = ""; txtsumAmount.Text = " "; lblQty.Text = ""; lblSum.Text = ""; } } }