Example #1
0
        protected void gvwSnapshotCalendar_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridViewTableDataCellEventArgs e)
        {
            //ASPxGridView gridView = (ASPxGridView)sender;
            string column = e.DataColumn.FieldName;

            if (column == "WeeksOnHand")
            {
                int flag = Convert.ToInt16(e.GetValue("WeeksOnHandWarnFlag"));
                switch (flag)
                {
                case 0:
                    e.Cell.BackColor = ColorTranslator.FromHtml("#f72100");     // red
                    break;

                case 1:
                    e.Cell.BackColor = ColorTranslator.FromHtml("#f7da00");     // yellow
                    break;

                case 2:
                    e.Cell.BackColor = ColorTranslator.FromHtml("#00f77c");     // green
                    break;

                case 3:
                    //e.Cell.BackColor = ColorTranslator.FromHtml("#744dff"); // blue
                    break;

                default:
                    break;
                }
            }

            if (column == "TotalInventory" || column == "CustomerRequirement" || column == "OverrideCustomerRequirement" ||
                column == "InTransQty" || column == "OnOrderEEH" || column == "Balance" || column == "WeeksOnHand")
            {
                string amt = e.GetValue("TotalInventory").ToString();
                if (amt.Contains("("))
                {
                    e.Cell.ForeColor = ColorTranslator.FromHtml("#000000");
                }
            }
        }
Example #2
0
        protected void DAGGridView_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridViewTableDataCellEventArgs e)
        {
            string status = "";

            status = e.GetValue("Status").ToString();
            string FileWitnessStatus = e.GetValue("FileWitnessServerStatus").ToString();

            switch (e.DataColumn.FieldName)
            {
            case "Status":
                if ((status.ToUpper()).Contains("FAIL"))
                {
                    e.Cell.BackColor = System.Drawing.Color.Red;
                    e.Cell.ForeColor = System.Drawing.Color.White;
                }
                else if (status.ToUpper() == "ISSUE")
                {
                    e.Cell.BackColor = System.Drawing.Color.Yellow;
                }
                else if (status.ToUpper() == "OK" || status.ToUpper() == "PASS" || status.ToUpper() == "PASSED")
                {
                    e.Cell.BackColor = System.Drawing.Color.LightGreen;
                }
                break;

            case "FileWitnessServerStatus":
                if ((FileWitnessStatus.ToUpper()).Contains("NOT RESPONDING"))
                {
                    e.Cell.BackColor = System.Drawing.Color.Red;
                    e.Cell.ForeColor = System.Drawing.Color.White;
                }
                else if (FileWitnessStatus.ToUpper() == "OK")
                {
                    e.Cell.BackColor = System.Drawing.Color.LightGreen;
                }
                break;
            }
        }
Example #3
0
        protected void WebsphereNodesgridview_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridViewTableDataCellEventArgs e)

        {
            string status = "";

            status = e.GetValue("Status").ToString();

            if (e.DataColumn.FieldName == "Status" && (e.CellValue.ToString() == "OK" || e.CellValue.ToString() == "Scanning" || e.CellValue.ToString() == "Telnet"))
            {
                e.Cell.BackColor = System.Drawing.Color.LightGreen;
            }

            else if (e.DataColumn.FieldName == "Status" && e.CellValue.ToString() == "Not Responding")
            {
                e.Cell.BackColor = System.Drawing.Color.Red;
                e.Cell.ForeColor = System.Drawing.Color.White;
            }
            else if (e.DataColumn.FieldName == "Status" && e.CellValue.ToString() == "Not Scanned")
            {
                e.Cell.BackColor = System.Drawing.Color.Blue;
                e.Cell.ForeColor = System.Drawing.Color.White;
            }
            else if (e.DataColumn.FieldName == "Status" && e.CellValue.ToString() == "Disabled")
            {
                e.Cell.BackColor = System.Drawing.Color.FromName("#D0D0D0");
                //e.Cell.BackColor = System.Drawing.Color.Gray;
                // e.Cell.ForeColor = System.Drawing.Color.White;
            }
            else if (e.DataColumn.FieldName == "Status" && e.CellValue.ToString() == "Issue")
            {
                e.Cell.BackColor = System.Drawing.Color.Yellow;
            }
            else if (e.DataColumn.FieldName == "Status")
            {
                e.Cell.BackColor = System.Drawing.Color.Yellow;
                // e.DataColumn.GroupFooterCellStyle.ForeColor = System.Drawing.Color.Yellow;
            }
        }
Example #4
0
        protected void MaintanceTasksgrid_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "StatusSummary" && e.GetValue("StatusSummary").ToString() == "Not Responding")
            {
                //e.DataColumn.CellStyle.CssClass = "GridCss3";
                e.Cell.CssClass = "GridCss3";
            }

            //6/10/2013 NS modified - added Telnet status
            if (e.DataColumn.FieldName == "StatusSummary" && e.GetValue("StatusSummary").ToString() == "OK" || e.GetValue("StatusSummary").ToString() == "Scanning")
            {
                e.Cell.BackColor = System.Drawing.Color.LightGreen;
            }

            else if (e.DataColumn.FieldName == "StatusSummary" && e.GetValue("StatusSummary").ToString() == "Not Responding")
            {
                e.Cell.BackColor = System.Drawing.Color.Red;
                e.Cell.ForeColor = System.Drawing.Color.White;
                //e.DataColumn.CellStyle.CssClass = "GridCss3";
            }
            else if (e.DataColumn.FieldName == "StatusSummary" && e.GetValue("StatusSummary").ToString() == "Not Scanned")
            {
                e.Cell.BackColor = System.Drawing.Color.FromName("#87CEEB");
                e.Cell.ForeColor = System.Drawing.Color.Black;
            }
            //3/1/2013 NS modified the value of text below - lower case disabled did not match the returned status with capital D
            else if (e.DataColumn.FieldName == "StatusSummary" && e.GetValue("StatusSummary").ToString() == "Disabled")
            {
                e.Cell.BackColor = System.Drawing.Color.FromName("#C8C8C8");
                // e.Cell.ForeColor = System.Drawing.Color.White;
            }
            else if (e.DataColumn.FieldName == "StatusSummary" && e.GetValue("StatusSummary").ToString() == "Maintenance")
            {
                e.Cell.BackColor = System.Drawing.Color.LightBlue;
            }
            else if (e.DataColumn.FieldName == "StatusSummary")
            {
                //e.Cell.BackColor = System.Drawing.Color.Yellow;
                // e.DataColumn.GroupFooterCellStyle.ForeColor = System.Drawing.Color.Yellow;
            }
        }
Example #5
0
 protected void gridDanhSachKH_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.GetValue("CongNo").ToString() != "0" && e.GetValue("HanMucCongNo").ToString() != "0")
     {
         if (double.Parse(e.GetValue("CongNo").ToString()) > double.Parse(e.GetValue("HanMucCongNo").ToString()))
         {
             e.Cell.Attributes.Add("onclick", "ShowPopup('" + e.Cell.ClientID + "','1-" + e.KeyValue + "')");
         }
     }
     if (e.DataColumn.FieldName == "ThoiHanThanhToan" && e.GetValue("ThoiHanThanhToan").ToString() != "0")
     {
         int IDKhachHang = int.Parse(e.KeyValue.ToString());
         int ThoiHanTT   = int.Parse(e.GetValue("ThoiHanThanhToan").ToString());
         var PhieuGH     = DBDataProvider.DB.ghPhieuGiaoHangs.Where(x => x.KhachHangID == IDKhachHang && x.TTThanhToan == 0 && SqlMethods.DateDiffDay(x.NgayDuyet, DateTime.Now) > ThoiHanTT).ToList();
         if (PhieuGH.Count > 0)
         {
             e.Cell.BackColor = System.Drawing.Color.LightPink;
             e.Cell.ForeColor = System.Drawing.Color.DarkRed;
             e.Cell.Text      = PhieuGH.Count + " phiếu trễ";
             e.Cell.Attributes.Add("onclick", "ShowPopup('" + e.Cell.ClientID + "','2-" + e.KeyValue + "')");
         }
     }
 }
Example #6
0
        protected void MailFileGridView_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "TotalItemSizeInMB")
            {
                e.Cell.BackColor = System.Drawing.Color.LightGreen;
            }

            if (e.DataColumn.FieldName == "TotalItemSizeInMB" && e.CellValue.ToString() != "")
            {
                if (e.GetValue("IssueWarningQuota").ToString() != "" && e.GetValue("IssueWarningQuota").ToString().ToLower() != "unlimited")
                {
                    double IssueWarningQuota = Convert.ToDouble(e.GetValue("IssueWarningQuota"));
                    double ItemSize          = Convert.ToDouble(e.CellValue.ToString());
                    if (ItemSize > IssueWarningQuota)
                    {
                        e.Cell.BackColor = System.Drawing.Color.Yellow;
                    }
                }
                if (e.GetValue("ProhibitSendQuota").ToString() != "" && e.GetValue("ProhibitSendQuota").ToString().ToLower() != "unlimited")
                {
                    double ProhibitSendQuota = Convert.ToDouble(e.GetValue("ProhibitSendQuota"));
                    double ItemSize          = Convert.ToDouble(e.CellValue.ToString());
                    if (ItemSize > ProhibitSendQuota)
                    {
                        e.Cell.BackColor = System.Drawing.Color.Red;
                        e.Cell.ForeColor = System.Drawing.Color.White;
                    }
                }
                if (e.GetValue("ProhibitSendReceiveQuota").ToString() != "" && e.GetValue("ProhibitSendReceiveQuota").ToString().ToLower() != "unlimited")
                {
                    double ProhibitSendReceiveQuota = Convert.ToDouble(e.GetValue("ProhibitSendReceiveQuota"));
                    double ItemSize = Convert.ToDouble(e.CellValue.ToString());
                    if (ItemSize > ProhibitSendReceiveQuota)
                    {
                        e.Cell.BackColor = System.Drawing.Color.Red;
                        e.Cell.ForeColor = System.Drawing.Color.White;
                    }
                }
            }



            //if (e.DataColumn.FieldName == "TotalItemSizeInMB")
            //{
            //    e.Cell.BackColor = System.Drawing.Color.LightGreen;
            //}

            //else if (e.DataColumn.FieldName == "Status" && e.CellValue.ToString() == "Not Responding")
            //{
            //    e.Cell.BackColor = System.Drawing.Color.Red;
            //    e.Cell.ForeColor = System.Drawing.Color.White;
            //}
            //else if (e.DataColumn.FieldName == "Status" && e.CellValue.ToString() == "Not Scanned")
            //{

            //    e.Cell.BackColor = System.Drawing.Color.FromName("#87CEEB");
            //    e.Cell.ForeColor = System.Drawing.Color.Black;
            //}
            //else if (e.DataColumn.FieldName == "Status" && e.CellValue.ToString() == "disabled")
            //{
            //    e.Cell.BackColor = System.Drawing.Color.Gray;
            //    // e.Cell.ForeColor = System.Drawing.Color.White;
            //}
            //else if (e.DataColumn.FieldName == "Status")
            //{
            //    e.Cell.BackColor = System.Drawing.Color.Yellow;
            //    // e.DataColumn.GroupFooterCellStyle.ForeColor =
            //}
        }