protected void dgvGridView_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) { DataControlRowType itemType = e.Row.RowType; switch (itemType) { case DataControlRowType.DataRow: string strID = dgvGridView.DataKeys[e.Row.RowIndex].Values[0].ToString(); CheckBox chk = (CheckBox)e.Row.FindControl("chkSelectRow"); if ((chk != null)) { chk.Attributes.Add("OnClick", "javascript:SelectRow(this," + strID + ")"); } DropDownList ddlstatus = (DropDownList)e.Row.FindControl("ddlSubOrderStatus"); objCommon = new clsCommon(); objCommon.FillDropDownListWithOutDefaultValue(ddlstatus, "tblOrderStatus", tblOrderStatus.ColumnNames.AppOrderStatus, tblOrderStatus.ColumnNames.AppOrderStatusID, tblOrderStatus.ColumnNames.AppDisplayOrder, appFunctions.Enum_SortOrderBy.Asc); objCommon = null; ddlstatus.SelectedValue = dgvGridView.DataKeys[e.Row.RowIndex].Values[1].ToString(); if ((ddlstatus != null)) { ddlstatus.Attributes.Add("onchange", "javascript:ChkOrder(" + strID + ")"); } 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; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //LoadCategoryMenu(); clsCommon objCommon = new clsCommon(); objCommon.FillDropDownListWithOutDefaultValue(ddlCurrency, "tblCurrency", tblCurrency.ColumnNames.AppCurrency, tblCurrency.ColumnNames.AppCurrencyID, tblCurrency.ColumnNames.AppDisplayOrder, appFunctions.Enum_SortOrderBy.Asc, tblCurrency.ColumnNames.AppIsActive + "=1"); objCommon = null; if (Session[appFunctions.Session.CurrencyID.ToString()] != null) { if (Session[appFunctions.Session.CurrencyID.ToString()].ToString() != "") { ddlCurrency.SelectedValue = Session[appFunctions.Session.CurrencyID.ToString()].ToString(); } } if ((Session[appFunctions.Session.ClientUserID.ToString()] != null)) { if (!(string.IsNullOrEmpty(Session[appFunctions.Session.ClientUserName.ToString()].ToString()) | Session[appFunctions.Session.ClientUserID.ToString()].ToString() == "0")) { divLogOut.Style.Add("display", "inline"); divLogin.Style.Add("display", "none"); } } else { divLogin.Style.Add("display", "inline"); divLogOut.Style.Add("display", "none"); } if (Session[appFunctions.Session.ClientUserID.ToString()] != null) { if (Session[appFunctions.Session.ClientUserID.ToString()].ToString() != "") { // liAccount.Visible = true; tblFavouriteProduct objFavProduct = new tblFavouriteProduct(); objFavProduct.Where.AppCustomerID.Value = Session[appFunctions.Session.ClientUserID.ToString()].ToString(); objFavProduct.Query.Load(); lblWishCount.Text = "(" + objFavProduct.RowCount.ToString() + ")"; objFavProduct = null; lblClientName.Text = "Hi, " + Session[appFunctions.Session.ClientUserName.ToString()].ToString(); } else { // liAccount.Visible = false; } } else { // liAccount.Visible = false; } lnkCart.HRef = Request.RawUrl + "#"; DataTable dtCart = new DataTable(); if ((HttpContext.Current.Session[appFunctions.Session.Cart.ToString()] != null)) { dtCart = (DataTable)HttpContext.Current.Session[appFunctions.Session.Cart.ToString()]; } if (dtCart.Rows.Count > 0) { lblProductCount.Visible = true; lblProductCount.Text = dtCart.Rows.Count.ToString(); lnkCart.HRef = objPageBase.GetAlias("Order.aspx"); } else { lblProductCount.Visible = false; } } }
public void LoadColorWiseImages(string strProductColorId = "0") { tblProductImage objImg = new tblProductImage(); objDataTable = objImg.LoadProductColorImg(hdnPKID.Value, strProductColorId, hdnColorId.Value); if (objDataTable.Rows.Count > 0) { // lblProductPrice.Text = objDataTable.Rows[0][tblProductDetail.ColumnNames.AppPrice].ToString(); // SpanPrice.InnerHtml = objDataTable.Rows[0][tblProductDetail.ColumnNames.AppPrice].ToString(); //if (objDataTable.Rows[0][tblProductDetail.ColumnNames.AppPrice].ToString() != "") //{ // SpanPrice.InnerHtml = Session[appFunctions.Session.CurrencyImage.ToString()].ToString() + "" + Math.Round(Convert.ToDecimal(Session[appFunctions.Session.CurrencyInRupee.ToString()].ToString()) * Convert.ToDecimal(objDataTable.Rows[0][tblProductDetail.ColumnNames.AppPrice].ToString()), 2).ToString(); //} hdnImg.Value = strServerURL + "admin/" + objDataTable.Rows[0][tblProductImage.ColumnNames.AppLargeImage].ToString(); LabelSKUNo.Text = objDataTable.Rows[0][tblProductDetail.ColumnNames.AppSKUNo].ToString(); SpanPrice.InnerHtml = Session[appFunctions.Session.CurrencyImage.ToString()].ToString() + "" + Math.Round(Convert.ToDecimal(Session[appFunctions.Session.CurrencyInRupee.ToString()].ToString()) * Convert.ToDecimal(objDataTable.Rows[0][tblProductDetail.ColumnNames.AppPrice].ToString()), 0).ToString(); SpanMRP.InnerHtml = "Selling Price : " + Session[appFunctions.Session.CurrencyImage.ToString()].ToString() + "" + Math.Round(Convert.ToDecimal(Session[appFunctions.Session.CurrencyInRupee.ToString()].ToString()) * Convert.ToDecimal(objDataTable.Rows[0][tblProductDetail.ColumnNames.AppMRP].ToString()), 0).ToString(); decimal decPrice = Convert.ToDecimal(objDataTable.Rows[0][tblProductDetail.ColumnNames.AppPrice].ToString()); decimal decMRP = Convert.ToDecimal(objDataTable.Rows[0][tblProductDetail.ColumnNames.AppMRP].ToString());; if (objDataTable.Rows[0]["appMRP1"].ToString() != "0.00") { SpanMRP2.InnerHtml = "MRP : " + Session[appFunctions.Session.CurrencyImage.ToString()].ToString() + "" + Math.Round(Convert.ToDecimal(Session[appFunctions.Session.CurrencyInRupee.ToString()].ToString()) * Convert.ToDecimal(objDataTable.Rows[0]["appMRP1"].ToString()), 0).ToString(); decMRP = Convert.ToDecimal(objDataTable.Rows[0]["appMRP1"].ToString()); SpanMRP2.Style.Add("text-decoration", "line-through"); SpanMRP.Style.Add("text-decoration", "line-through"); } else { SpanMRP.InnerHtml = "MRP : " + Session[appFunctions.Session.CurrencyImage.ToString()].ToString() + "" + Math.Round(Convert.ToDecimal(Session[appFunctions.Session.CurrencyInRupee.ToString()].ToString()) * Convert.ToDecimal(objDataTable.Rows[0][tblProductDetail.ColumnNames.AppMRP].ToString()), 0).ToString(); SpanMRP2.Visible = false; SpanMRP.Style.Add("text-decoration", "line-through"); } int iPercentage = Convert.ToInt32(Math.Round((100 - ((decPrice * 100) / decMRP)), 0)); if (iPercentage != 0) { divProductOff.Style.Add("visibility", "visible"); lblDiscount.Text = iPercentage.ToString() + "%"; lblSaveRupee.Text = "(You are saving " + Session[appFunctions.Session.CurrencyImage.ToString()].ToString() + Math.Round(Convert.ToDecimal(Session[appFunctions.Session.CurrencyInRupee.ToString()].ToString()) * (decMRP - decPrice), 0).ToString() + ")"; } else { divProductOff.Style.Add("visibility", "hidden"); lblDiscount.Text = ""; lblSaveRupee.Text = ""; } objCommon = new clsCommon(); objCommon.FillDropDownListWithOutDefaultValue(ddlSize, "tblProductDetail Inner join tblSize On tblSize.appSizeId=tblProductDetail.appSizeId ", tblSize.ColumnNames.AppSize, tblProductDetail.ColumnNames.AppProductDetailID, tblProductDetail.ColumnNames.AppProductDetailID, appFunctions.Enum_SortOrderBy.Asc, tblProductDetail.ColumnNames.AppProductColorID + "=" + objDataTable.Rows[0][tblProductDetail.ColumnNames.AppProductColorID].ToString()); objCommon = null; hdncolorName.Value = objDataTable.Rows[0][tblColor.ColumnNames.AppColorName].ToString(); hdnProductColorId.Value = objDataTable.Rows[0][tblProductDetail.ColumnNames.AppProductColorID].ToString(); ddlSize.SelectedValue = objDataTable.Rows[0][tblProductDetail.ColumnNames.AppProductDetailID].ToString(); hdnProductDetailId.Value = objDataTable.Rows[0][tblProductDetail.ColumnNames.AppProductDetailID].ToString(); } RepImg.DataSource = objDataTable; RepImg.DataBind(); LoadProductProperty(); objImg = null; }