protected void grdReport_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (strPrinterName == "") { strPrinterName = PrjClass.GetPrinterName(Globals.BranchID); } if (Request.QueryString[0].Split(',')[0].IndexOf('-') == -1) { e.Row.Cells[1].Visible = false; } if (e.Row.RowType == DataControlRowType.DataRow) { HyperLink hypBookingNo = (HyperLink)e.Row.FindControl("hypBtnShowDetails"); string strBookinNo = hypBookingNo.Text; HiddenField lblDueDate = (HiddenField)e.Row.FindControl("hdnDeliveryDate"); string strDuedate = lblDueDate.Value; hypBookingNo.NavigateUrl = String.Format("~/" + strPrinterName + "/BookingSlip.aspx?BN={0}{1}{2}", strBookinNo, "-1", strDuedate); } else if (e.Row.RowType == DataControlRowType.Footer) { if (Ob.DatasetOther.Tables[0].Rows.Count != 0) { e.Row.Cells[0].Text = "Total"; e.Row.Cells[4].Text = Ob.DatasetOther.Tables[0].Rows[Ob.DatasetOther.Tables[0].Rows.Count - 1][4].ToString(); e.Row.Cells[5].Text = Ob.DatasetOther.Tables[0].Rows[Ob.DatasetOther.Tables[0].Rows.Count - 1][5].ToString(); } } } catch (Exception ex) { } }
protected void btnInvoicePrint_Click(object sender, EventArgs e) { strPrinterName = PrjClass.GetPrinterName(Globals.BranchID); var urlToOpen = "../" + strPrinterName + "/InvoiceStatementSlip.aspx?CustCode=" + hdnCustId.Value + "&fromDate=" + hdnStartDate.Value + "&ToDate=" + hdnEndDate.Value; urlToOpen += "&DirectPrint=true&RedirectBack=true&closeWindow=true"; OpenUrlFromBasePage(urlToOpen); }
protected void grdReport_RowDataBound(object sender, GridViewRowEventArgs e) { DataRowView drview = e.Row.DataItem as DataRowView; if (strPrinterName == "") { strPrinterName = PrjClass.GetPrinterName(Globals.BranchID); } if (e.Row.RowType == DataControlRowType.DataRow) { HyperLink hypBookingNo = (HyperLink)e.Row.FindControl("hypBtnShowDetails"); string strBookinNo = hypBookingNo.Text; HiddenField lblDueDate = (HiddenField)e.Row.FindControl("hdnDeliveryDate"); string strDuedate = lblDueDate.Value; hypBookingNo.NavigateUrl = String.Format("~/" + strPrinterName + "/BookingSlip.aspx?BN={0}{1}{2}", strBookinNo, "-1", strDuedate); } }
protected void grdReport_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (Request.QueryString["Type"].ToString() == "Discount") { //e.Row.Cells[5].Visible = false; //e.Row.Cells[6].Visible = false; if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[2].Text = "Order Date"; e.Row.Cells[3].Text = "Order Amount"; e.Row.Cells[4].Text = "Discount Amount"; } } if (e.Row.RowType == DataControlRowType.Footer) { if (Ob.DatasetOther.Tables[0].Rows.Count != 0) { e.Row.Cells[0].Text = "Total"; if (Request.QueryString["Type"].ToString() == "Discount") { e.Row.Cells[3].Text = Ob.DatasetOther.Tables[0].Rows[Ob.DatasetOther.Tables[0].Rows.Count - 1][1].ToString(); e.Row.Cells[4].Text = Ob.DatasetOther.Tables[0].Rows[Ob.DatasetOther.Tables[0].Rows.Count - 1][4].ToString(); } //e.Row.Cells[6].Text = Ob.DatasetOther.Tables[0].Rows[Ob.DatasetOther.Tables[0].Rows.Count - 1][6].ToString(); } } DataRowView drview = e.Row.DataItem as DataRowView; if (strPrinterName == "") { strPrinterName = PrjClass.GetPrinterName(Globals.BranchID); } if (e.Row.RowType == DataControlRowType.DataRow) { HyperLink hypBookingNo = (HyperLink)e.Row.FindControl("hypBtnShowDetails"); string strBookinNo = hypBookingNo.Text; HiddenField lblDueDate = (HiddenField)e.Row.FindControl("hdnDate"); string strDuedate = lblDueDate.Value; hypBookingNo.NavigateUrl = String.Format("~/" + strPrinterName + "/BookingSlip.aspx?BN={0}{1}{2}", strBookinNo, "-1", strDuedate); } } catch (Exception ex) { } }
protected void btnShowReport_Click(object sender, EventArgs e) { DetailsViewDeliverSlip.Visible = false; ArrayList date = BAL.BALFactory.Instance.BAL_DateAndTime.getDateAndTimeAccordingToZoneTime(Globals.BranchID); try { Bookingno = txtInvoiceNo.Text.Split('-'); txtInvoiceNo.Text = Bookingno[0].ToString(); } catch (Exception ex) { } if (BAL.BALFactory.Instance.BAL_sms.CheckValidBookingNo(Globals.BranchID, txtInvoiceNo.Text) == true) { if (BAL.BALFactory.Instance.BAL_sms.CheckDeliverSlipViewRight(Globals.BranchID, txtInvoiceNo.Text, Globals.UserType) == true) { strPrinterName = PrjClass.GetPrinterName(Globals.BranchID); OpenNewWindow("../" + strPrinterName + "/BookingSlip.aspx?BN=" + txtInvoiceNo.Text + "-1" + date[0].ToString() + "&RS=" + "0" + "&DirectPrint=false&CloseWindow=false"); txtInvoiceNo.Text = ""; txtInvoiceNo.Focus(); } else { DataSet dsMain = new DataSet(); dsMain = BAL.BALFactory.Instance.BAL_City.DeliveryDetail(Globals.BranchID, txtInvoiceNo.Text); DetailsViewDeliverSlip.DataSource = dsMain.Tables[0]; DetailsViewDeliverSlip.DataBind(); DetailsViewDeliverSlip.Visible = true; lblMsg.Text = "Delivered"; txtInvoiceNo.Focus(); txtInvoiceNo.Attributes.Add("onfocus", "javascript:select();"); } } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ScriptRegistration", "setDivMouseOver('Red', '#999999');", true); lblMsg.Text = "Please enter a valid order no."; DetailsViewDeliverSlip.Visible = false; txtInvoiceNo.Focus(); txtInvoiceNo.Attributes.Add("onfocus", "javascript:select();"); } }
protected void grdReport_RowDataBound(object sender, GridViewRowEventArgs e) { // Mohit Chauhan // set the headers dynamically if (strPrinterName == "") { strPrinterName = PrjClass.GetPrinterName(Globals.BranchID); } if (drpReportFrom.SelectedItem.Text == "Booking" || drpReportFrom.SelectedItem.Text == "Delivery") { if (e.Row.RowType == DataControlRowType.DataRow) { HyperLink hypBookingNo = (HyperLink)e.Row.FindControl("hypBtnShowDetails"); string strBookinNo = hypBookingNo.Text; Label lblDueDate = (Label)e.Row.FindControl("lblDate"); string strDuedate = lblDueDate.Text; hypBookingNo.NavigateUrl = String.Format("~/" + strPrinterName + "/BookingSlip.aspx?BN={0}{1}{2}", strBookinNo, "-1", strDuedate); } } if (e.Row.RowType == DataControlRowType.Header) { if (drpReportFrom.SelectedItem.Text == "Booking" || drpReportFrom.SelectedItem.Text == "Delivery") { // the tax col are 5 (main tax), 6 (second tax), 7 (third tax) e.Row.Cells[10].Text = _LabelTax1; e.Row.Cells[11].Text = _LabelTax2; e.Row.Cells[12].Text = _LabelTax3; } else { e.Row.Cells[9].Text = _LabelTax1; e.Row.Cells[10].Text = _LabelTax2; e.Row.Cells[11].Text = _LabelTax3; } } else if (e.Row.RowType == DataControlRowType.Footer) { e.Row.BackColor = System.Drawing.Color.GreenYellow; } }