protected void dgvGridView_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) { DataControlRowType itemType = e.Row.RowType; switch (itemType) { case DataControlRowType.DataRow: string strSellerOrderID = dgvGridView.DataKeys[e.Row.RowIndex].Values[0].ToString(); string strPaymentMode = dgvGridView.DataKeys[e.Row.RowIndex].Values[1].ToString(); if (strSellerOrderID != "") { GridView dgvGrid = (GridView)e.Row.FindControl("dgvSubDetail"); if (dgvGrid != null) { objSubOrder = new tblSubOrder(); dgvGrid.DataSource = objSubOrder.GetSubOrderDetailList(strSellerOrderID, Convert.ToInt32(Enums.Enums_OrderStatus.ReadyToShip).ToString()); dgvGrid.DataBind(); objSubOrder = null; } } Label lbltype = (Label)e.Row.FindControl("type"); if (dgvGridView.DataKeys[e.Row.RowIndex].Values[2].ToString() != "") { if (Convert.ToBoolean(dgvGridView.DataKeys[e.Row.RowIndex].Values[2].ToString())) { lbltype.Text = "Menifest Generated"; lbltype.ForeColor = System.Drawing.Color.Green; } else { lbltype.Text = "Menifest Not Generated"; lbltype.ForeColor = System.Drawing.Color.Brown; } } else { lbltype.Text = "Menifest Not Generated"; lbltype.ForeColor = System.Drawing.Color.Brown; } if (strPaymentMode != "") { Label lblPaymentMode = (Label)e.Row.FindControl("lblPaymentMode"); if (strPaymentMode == Convert.ToInt32(Enums.PaymentMode.COD).ToString()) { lblPaymentMode.Text = "COD"; lblPaymentMode.BackColor = System.Drawing.Color.Brown; } if (strPaymentMode == Convert.ToInt32(Enums.PaymentMode.PayNow).ToString()) { lblPaymentMode.Text = "Pre-Paid"; lblPaymentMode.BackColor = System.Drawing.Color.Green; } } break; } }
protected void dtProductInvoice_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { string strAddress = appFunctions.strSellerName.ToString() + "<br/>" + appFunctions.strAddress.ToString() + "<br/>" + appFunctions.strCity.ToString() + ", " + appFunctions.strState.ToString() + ", " + appFunctions.strCountry.ToString() + " - " + appFunctions.strPinColde.ToString() + "<br/><b>(" + appFunctions.strPinColde.ToString() + ")</b><br/>"; string strSellerOrderID = dtProductInvoice.DataKeys[e.Item.ItemIndex].ToString(); Repeater dgvLeft = (Repeater)e.Item.FindControl("dgvLeftGridView"); Repeater dgvRIght = (Repeater)e.Item.FindControl("dgvRightgrid"); if (strSellerOrderID != "" && dgvLeft != null && dgvRIght != null) { tblSubOrder objSubOrder = new tblSubOrder(); objDataTable = objSubOrder.GetSubOrderDetailList(strSellerOrderID, Convert.ToInt32(Enums.Enums_OrderStatus.Confirmed).ToString()); dgvLeft.DataSource = objDataTable; dgvLeft.DataBind(); dgvRIght.DataSource = objDataTable; dgvRIght.DataBind(); string strTotal = objDataTable.Compute("sum(appTotal)", "").ToString(); // Label lblLeftOrdeTotal = (Label)e.Item.FindControl("lblLeftOrdeTotal"); lblLeftOrdeTotal.Text = strTotal; //Label lblLeftCODCharges = (Label)e.Item.FindControl("lblLeftCODCharges"); lblLeftCODCharges.Text = "0"; // Label lblLeftShippingCharges = (Label)e.Item.FindControl("lblLeftShippingCharges"); lblLeftShippingCharges.Text = "0"; // Label lblLeftAmount = (Label)e.Item.FindControl("lblLeftAmount"); lblLeftAmount.Text = strTotal; Label lblRightTotal = (Label)e.Item.FindControl("lblRightTotal"); lblRightTotal.Text = strTotal; Label lblRightSubTotal = (Label)e.Item.FindControl("lblRightSubTotal"); lblRightSubTotal.Text = strTotal; if (objDataTable.Rows.Count > 0) { Label lblWeight = (Label)e.Item.FindControl("lblWeight"); lblWeight.Text = objDataTable.Compute("sum(appWeight)", "").ToString(); Label lblTotalQty = (Label)e.Item.FindControl("lblTotalQty"); lblTotalQty.Text = objDataTable.Compute("sum(appQty)", "").ToString(); Label lblAmount = (Label)e.Item.FindControl("lblAmount"); lblAmount.Text = objDataTable.Compute("sum(appSellingPrice)", "").ToString(); Label lblTotalAmount = (Label)e.Item.FindControl("lblTotalAmount"); lblTotalAmount.Text = objDataTable.Compute("sum(appTotal)", "").ToString(); } // Label lblRightAmount = (Label)e.Item.FindControl("lblRightAmount"); lblRightAmount.Text = strTotal; Label lblSellerAddress = (Label)e.Item.FindControl("lblSellerAddress"); lblSellerAddress.Text = strAddress; Label lblAmountInWords = (Label)e.Item.FindControl("lblAmountInWords"); RupeeIntoWord objRupeeIntoWord = new RupeeIntoWord(); lblAmountInWords.Text = "AMOUNT IN WORDS :" + objRupeeIntoWord.AmtInWord(Convert.ToDecimal(lblRightTotal.Text)) + "<br/>"; objRupeeIntoWord = null; objSubOrder = null; } } }
protected void dgvGridView_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) { DataControlRowType itemType = e.Row.RowType; switch (itemType) { case DataControlRowType.DataRow: string strSellerOrderID = dgvGridView.DataKeys[e.Row.RowIndex].Values[0].ToString(); string strPaymentMode = dgvGridView.DataKeys[e.Row.RowIndex].Values[1].ToString(); if (strSellerOrderID != "") { Repeater RepOrderDetail = (Repeater)e.Row.FindControl("RepOrderDetail"); // Label lblWeight = (Label)e.Row.FindControl("lblWeight"); // lblWeight.Text = "0"; if (RepOrderDetail != null) { objSubOrder = new tblSubOrder(); objDataTable = objSubOrder.GetSubOrderDetailList(strSellerOrderID, Convert.ToInt32(Enums.Enums_OrderStatus.ReadyToShip).ToString(), false, true.ToString()); //if (objDataTable.Rows.Count > 0) //{ // lblWeight.Text = objDataTable.Compute("sum(appWeight)", "").ToString(); //} RepOrderDetail.DataSource = objDataTable; RepOrderDetail.DataBind(); objCommon = new clsCommon(); objCommon = null; objSubOrder = null; } } //if (strPaymentMode != "") //{ // Label lblPaymentMode = (Label)e.Row.FindControl("lblPaymentMode"); // if (strPaymentMode == Convert.ToInt32(Enums.PaymentMode.COD).ToString()) // { // lblPaymentMode.Text = "COD"; // } // if (strPaymentMode == Convert.ToInt32(Enums.PaymentMode.PayNow).ToString()) // { // lblPaymentMode.Text = "Pre-Paid"; // } //} break; } }
protected void dgvGridView_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) { DataControlRowType itemType = e.Row.RowType; switch (itemType) { case DataControlRowType.DataRow: string strOrderID = dgvGridView.DataKeys[e.Row.RowIndex].Values[0].ToString(); string strPaymentMode = dgvGridView.DataKeys[e.Row.RowIndex].Values[1].ToString(); if (strOrderID != "") { GridView dgvGrid = (GridView)e.Row.FindControl("dgvSubDetail"); if (dgvGrid != null) { objSubOrder = new tblSubOrder(); objDataTable = objSubOrder.GetSubOrderDetailList(strOrderID, ""); dgvGrid.DataSource = objDataTable; dgvGrid.DataBind(); objSubOrder = null; } } if (strPaymentMode != "") { Label lblPaymentMode = (Label)e.Row.FindControl("lblPaymentMode"); if (strPaymentMode == Convert.ToInt32(Enums.PaymentMode.COD).ToString()) { lblPaymentMode.Text = "COD"; lblPaymentMode.BackColor = System.Drawing.Color.Brown; } if (strPaymentMode == Convert.ToInt32(Enums.PaymentMode.PayNow).ToString()) { lblPaymentMode.Text = "Pre-Paid"; lblPaymentMode.BackColor = System.Drawing.Color.Green; } } break; } }
protected void dgvGridView_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) { DataControlRowType itemType = e.Row.RowType; switch (itemType) { case DataControlRowType.DataRow: string strOrderID = dgvGridView.DataKeys[e.Row.RowIndex].Values[0].ToString(); string strPaymentMode = dgvGridView.DataKeys[e.Row.RowIndex].Values[3].ToString(); string strCourierCompanyId = dgvGridView.DataKeys[e.Row.RowIndex].Values[1].ToString(); string strDocketNo = dgvGridView.DataKeys[e.Row.RowIndex].Values[2].ToString(); if (strOrderID != "") { GridView dgvGrid = (GridView)e.Row.FindControl("dgvSubDetail"); if (dgvGrid != null) { objSubOrder = new tblSubOrder(); dgvGrid.DataSource = objSubOrder.GetSubOrderDetailList(strOrderID, Convert.ToInt32(Enums.Enums_OrderStatus.Shipped).ToString()); dgvGrid.DataBind(); objSubOrder = null; } } if (strPaymentMode != "") { Label lblPaymentMode = (Label)e.Row.FindControl("lblPaymentMode"); if (strPaymentMode == Convert.ToInt32(Enums.PaymentMode.COD).ToString()) { lblPaymentMode.Text = "COD"; lblPaymentMode.BackColor = System.Drawing.Color.Brown; } if (strPaymentMode == Convert.ToInt32(Enums.PaymentMode.PayNow).ToString()) { lblPaymentMode.Text = "Pre-Paid"; lblPaymentMode.BackColor = System.Drawing.Color.Green; } } System.Web.UI.HtmlControls.HtmlGenericControl divCourierCompany = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Row.FindControl("divCourierCompany"); divCourierCompany.Visible = false; TextBox txtDocketNo = (TextBox)e.Row.FindControl("txtDocketNo"); LinkButton lnkAddDocketNo = (LinkButton)e.Row.FindControl("lnkAddDocketNo"); if (strDocketNo != "") { objSubOrder = new tblSubOrder(); txtDocketNo.Text = strDocketNo; txtDocketNo.Style.Add("display", "block"); txtDocketNo.Enabled = false; lnkAddDocketNo.Visible = false; objSubOrder = null; } else if (strCourierCompanyId != "" && strDocketNo == "") { txtDocketNo.Style.Add("display", "block"); lnkAddDocketNo.Visible = true; } else if (strCourierCompanyId == "" && strDocketNo == "") { txtDocketNo.Style.Add("display", "none"); lnkAddDocketNo.Visible = false; divCourierCompany.Visible = true; DropDownList ddlCourierCompany = (DropDownList)e.Row.FindControl("ddlCourierCompany"); objCommon = new clsCommon(); objCommon.FillDropDownListWithOutDefaultValue(ddlCourierCompany, "tblCourierCompany", tblCourierCompany.ColumnNames.AppCourierCompany, tblCourierCompany.ColumnNames.AppCourierCompanyID, tblCourierCompany.ColumnNames.AppDisplayOrder, appFunctions.Enum_SortOrderBy.Asc, tblCourierCompany.ColumnNames.AppIsActive + "=1"); objCommon = null; } break; } }