Пример #1
0
 protected void ASPxGridView_show_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
 {
     if (ASPxGridView_show.VisibleRowCount > 0)
     {
         if (e.GetValue("系统存放地点").ToString() != e.GetValue("盘点存放地点").ToString())
         {
             e.Row.BackColor = System.Drawing.Color.LemonChiffon;
         }
     }
 }
        protected void gridDonDatHang_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            Color color       = (Color)ColorTranslator.FromHtml("#FF9797");
            int   MucDoUuTien = Convert.ToInt32(e.GetValue("MucDoUuTien"));// lấy giá trị
            int   TrangThai   = Convert.ToInt32(e.GetValue("TrangThai"));

            if (MucDoUuTien == 1 && TrangThai == 0)
            {
                e.Row.BackColor = color;
            }
        }
        /// <summary>
        /// This method fires when each row in the all users DevExpress GridView is data bound
        /// and it shows/hides buttons and sets popover information
        /// </summary>
        /// <param name="sender">The GridViewRow inside bsGRUsers</param>
        /// <param name="e">The ASPxGridViewTableRowEventArgs</param>
        protected void bsGRUsers_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            //Only work on data rows
            if (e.RowType == DevExpress.Web.GridViewRowType.Data)
            {
                LinkButton  disableButton, enableButton;
                Label       emailLabel, phoneLabel;
                PyramidUser user;

                //Get the user that the row is for
                using (ApplicationDbContext context = new ApplicationDbContext())
                {
                    user = context.Users.Find(e.GetValue("Id"));
                }

                //Get the necessary controls
                disableButton = (LinkButton)bsGRUsers.FindRowCellTemplateControl(e.VisibleIndex, null, "lbDisableUser");
                enableButton  = (LinkButton)bsGRUsers.FindRowCellTemplateControl(e.VisibleIndex, null, "lbEnableUser");
                emailLabel    = (Label)bsGRUsers.FindRowCellTemplateControl(e.VisibleIndex, null, "lblEmail");
                phoneLabel    = (Label)bsGRUsers.FindRowCellTemplateControl(e.VisibleIndex, null, "lblPhone");

                //Show/hide the enable and disable buttons
                if (user.LockoutEndDateUtc.HasValue && user.LockoutEndDateUtc.Value > DateTime.Now)
                {
                    disableButton.Visible = false;
                    enableButton.Visible  = true;
                }
                else
                {
                    disableButton.Visible = true;
                    enableButton.Visible  = false;
                }

                //Set the CSS class and popover for the email
                if (user.EmailConfirmed)
                {
                    emailLabel.CssClass = "text-success";
                    emailLabel.Attributes.Add("data-content", "Email is confirmed!");
                }
                else
                {
                    emailLabel.CssClass = "text-custom-warning";
                    emailLabel.Attributes.Add("data-content", "Email is not confirmed!");
                }

                //Set the CSS class and popover for the phone
                if (user.PhoneNumberConfirmed)
                {
                    phoneLabel.CssClass = "text-success";
                    phoneLabel.Attributes.Add("data-content", "Phone is confirmed!");
                }
                else
                {
                    phoneLabel.CssClass = "text-custom-warning";
                    phoneLabel.Attributes.Add("data-content", "Phone is not confirmed!");
                }
            }
        }
Пример #4
0
        protected void gridPhanQuyen_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            Color  color     = (Color)ColorTranslator.FromHtml("#FF9797");
            string TrangThai = Convert.ToString(e.GetValue("Link"));

            if (TrangThai == "")
            {
                e.Row.BackColor = color;
            }
        }
Пример #5
0
        protected void gridTonKhoBanDau_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            Color color      = (Color)ColorTranslator.FromHtml("#FF9797");
            int   TonKhoTong = Convert.ToInt32(e.GetValue("SoLuongCon"));

            if (TonKhoTong < 2)
            {
                e.Row.BackColor = color;
            }
        }
Пример #6
0
        protected void gridDanhSach_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            Color color            = (Color)ColorTranslator.FromHtml("#FF9797");
            int   TrangThaiDonHang = Convert.ToInt32(e.GetValue("TrangThaiDonHang"));

            if (TrangThaiDonHang == 1)
            {
                e.Row.BackColor = color;
            }
        }
        /// <summary>
        /// This method fires when the TPITOS GridView prepares a row
        /// and it highlights invalid TPITOS observations
        /// </summary>
        /// <param name="sender">The bsGRTPITOS Bootstrap GridView</param>
        /// <param name="e">The ASPxGridViewTableRowEvent event arguments</param>
        protected void bsGRTPITOS_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            //Evaluate only data rows
            if (e.RowType == DevExpress.Web.GridViewRowType.Data)
            {
                //Determine if this row represents a valid TPITOS
                bool isTPITOSValid = Convert.ToBoolean(e.GetValue("IsValid"));

                if (!isTPITOSValid)
                {
                    //The TPITOS is not valid, add the CSS class
                    e.Row.CssClass = "invalid-tpitos";
                }
            }
        }
Пример #8
0
    protected void griddevice_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
    {
        int            id      = Convert.ToInt32(e.GetValue("idud"));
        string         sql     = "select * from tblEntrance where statusdoor='None' and idud=" + id;
        SqlDataAdapter adapter = new SqlDataAdapter(sql, strcon);
        DataTable      data    = new DataTable();

        adapter.Fill(data);
        if (data.Rows.Count > 0)
        {
            e.Row.BackColor = System.Drawing.Color.Orange;
        }

        //sql = "select * from tblEntrance where statusdoor='None' and idud=" + id;
        //SqlDataAdapter adapter2 = new SqlDataAdapter(sql, strcon);
        //DataTable data2 = new DataTable();
        //adapter2.Fill(data2);
        //if (data2.Rows.Count > 0)
        //{
        //    e.Row.BackColor = System.Drawing.Color.Orange;
        //}
        // int id = Convert.ToInt32(e.GetValue("idud"));
        // string sql = "select * from tblEntrance where iduser not in (select e.iduser from tblEntrance e inner join tblDeviceUser d on e.iduser=d.iduser) and iddevice=" + Convert.ToInt32(lbliddevice.Text) + " and idud=" + id ;
        //SqlDataAdapter adapter = new SqlDataAdapter(sql, strcon);
        //DataTable data = new DataTable();
        //adapter.Fill(data);
        //if (data.Rows.Count > 0)
        //{
        //    e.Row.BackColor = System.Drawing.Color.Orange;
        //}

        //sql = "select * from tblEntrance where iduser is null and idud=" + id ;
        //SqlDataAdapter adapter2 = new SqlDataAdapter(sql, strcon);
        //DataTable data2 = new DataTable();
        //adapter2.Fill(data2);
        //if (data2.Rows.Count > 0)
        //{
        //    e.Row.BackColor = System.Drawing.Color.Orange;
        //}
    }
 protected void ASPxGridView1_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
 {
     e.Row.BackColor = (Color)e.GetValue("ItemColor");
 }