Beispiel #1
0
        protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                string  lblPrGroup = e.Row.Cells[0].Text;
                TextBox txtQty     = (TextBox)e.Row.FindControl("txtqty"); //total qty conv
                TextBox txtBoxQty  = (TextBox)e.Row.FindControl("txtBox"); //box
                TextBox txtPcsQty  = (TextBox)e.Row.FindControl("txtPcs"); //pcs qty

                TotalQtyConv += Convert.ToDecimal(txtQty.Text);            // Total Box with Pcs
                BoxQty       += Convert.ToDecimal(txtBoxQty.Text);
                PcsQty       += Convert.ToDecimal(txtPcsQty.Text);

                if (Convert.ToDecimal(txtQty.Text) > Convert.ToDecimal(e.Row.Cells[9].Text))
                {
                    e.Row.BackColor = System.Drawing.Color.Tomato;
                }

                Crates += Convert.ToDecimal(e.Row.Cells[3].Text);
                ltr    += Convert.ToDecimal(e.Row.Cells[8].Text);

                #region Pcs Billing Applicability
                DataTable dt = baseObj.GetPcsBillingApplicability(Session["SCHSTATE"].ToString(), lblPrGroup);
                string    ProductGroupApplicable = string.Empty;

                if (dt.Rows.Count > 0)
                {
                    ProductGroupApplicable = dt.Rows[0][1].ToString();
                }
                if (ProductGroupApplicable == "Y")
                {
                    txtPcsQty.Enabled = true;
                }
                else
                {
                    txtPcsQty.Enabled = false;
                }
                #endregion
            }
            //if (e.Row.RowType == DataControlRowType.Footer)
            //{
            //    //e.Row.Cells[2].Text = "TOTAL :";
            //    //e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Left;
            //    //e.Row.Cells[2].ForeColor = System.Drawing.Color.MidnightBlue;
            //    //e.Row.Cells[2].Font.Bold = true;

            //    e.Row.Cells[3].Text = "Total:"+ Crates.ToString();
            //    e.Row.Cells[3].HorizontalAlign = HorizontalAlign.Left;
            //    e.Row.Cells[3].ForeColor = System.Drawing.Color.MidnightBlue;
            //    e.Row.Cells[3].Font.Bold = true;

            //    e.Row.Cells[4].Text = "Total:" + BoxQty.ToString();
            //    e.Row.Cells[4].HorizontalAlign = HorizontalAlign.Right;
            //    e.Row.Cells[4].ForeColor = System.Drawing.Color.MidnightBlue;
            //    e.Row.Cells[4].Font.Bold = true;

            //    e.Row.Cells[5].Text = "Total:" + PcsQty.ToString();
            //    e.Row.Cells[5].HorizontalAlign = HorizontalAlign.Right;
            //    e.Row.Cells[5].ForeColor = System.Drawing.Color.MidnightBlue;
            //    e.Row.Cells[5].Font.Bold = true;

            //    e.Row.Cells[6].Text = "Total:" + TotalQtyConv.ToString();
            //    e.Row.Cells[6].HorizontalAlign = HorizontalAlign.Right;
            //    e.Row.Cells[6].ForeColor = System.Drawing.Color.MidnightBlue;
            //    e.Row.Cells[6].Font.Bold = true;

            //    e.Row.Cells[8].Text = "Total:" + ltr.ToString();
            //    e.Row.Cells[8].HorizontalAlign = HorizontalAlign.Right;
            //    e.Row.Cells[8].ForeColor = System.Drawing.Color.MidnightBlue;
            //    e.Row.Cells[8].Font.Bold = true;

            //}
        }