Ejemplo n.º 1
0
        private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
        {
            if (e.RowHandle >= 0 && e.RowHandle <= gridView1.DataRowCount - 1)
            {
                DevExpress.Utils.AppearanceDefault appGreen = new DevExpress.Utils.AppearanceDefault
                                                                  (Color.Black, Color.Yellow, Color.Empty, Color.SeaShell, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);

                DataRow rowCheck = null;
                DataRow rowOne;

                rowCheck = gridView1.GetDataRow(e.RowHandle - 1);
                rowOne   = gridView1.GetDataRow(e.RowHandle);
                if (rowCheck != null && rowOne != null)
                {
                    if (e.Column.FieldName == "WIE007")
                    {
                        if (!rowCheck ["WIB006"].ToString( ).Trim( ).Equals(rowOne ["WIB006"].ToString( ).Trim( )) || !rowCheck ["WIB009"].ToString( ).Trim( ).Equals(rowOne ["WIB009"].ToString( ).Trim( )) && gridView1.FocusedColumn.FieldName == "WIE007")
                        {
                            DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appGreen);
                        }
                    }
                }

                if (e.Column.FieldName == "WIE012" || e.Column.FieldName == "WIE013" || e.Column.FieldName == "WIE014")
                {
                    DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appGreen);
                }
            }
        }
Ejemplo n.º 2
0
        private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
        {
            DevExpress.Utils.AppearanceDefault appRed = new DevExpress.Utils.AppearanceDefault
                                                            (Color.Black, Color.Red, Color.Empty, Color.Red, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
            DevExpress.Utils.AppearanceDefault appYellow = new DevExpress.Utils.AppearanceDefault
                                                               (Color.Black, Color.Yellow, Color.Empty, Color.Yellow, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
            DevExpress.Utils.AppearanceDefault appGreen = new DevExpress.Utils.AppearanceDefault
                                                              (Color.Black, Color.Green, Color.Empty, Color.Green, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
            if (e.Column.FieldName == "cjkcs")//指定列
            {
                string strDDS = gridView1.GetRowCellDisplayText(e.RowHandle, "FSRCQTY").ToString().Trim().Replace(",", "");

                string strCJS = gridView1.GetRowCellDisplayText(e.RowHandle, "cjkcs").ToString().Trim().Replace(",", "");

                int iDDs = int.Parse(strDDS);
                int iCJS = int.Parse(strCJS);

                if (iCJS > 0)
                {
                    if (iCJS < iDDs)
                    {
                        DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appRed);
                    }
                    else
                    {
                        // DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appGreen);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
        {
            try
            {
                string sp = gridView1.GetRowCellDisplayText(e.RowHandle, gridCol审批时间).ToString().Trim();
                if (e.Column == gridCol决算资料提交是否延期)
                {
                    string 决算资料提交是否延期 = gridView1.GetRowCellDisplayText(e.RowHandle, gridCol决算资料提交是否延期).ToString().Trim();
                    if (决算资料提交是否延期 != "" && sp == "")
                    {
                        DevExpress.Utils.AppearanceDefault appRed = new DevExpress.Utils.AppearanceDefault(Color.Black, Color.Red, Color.Red, Color.SeaShell, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
                        DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appRed);

                    }
                    else if (sp != "")
                    {
                        DevExpress.Utils.AppearanceDefault appRed = new DevExpress.Utils.AppearanceDefault(e.Appearance.BackColor, e.Appearance.BackColor);
                        DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appRed);
                    }
                }

                if (e.Column == gridCol竣工资料上报是否延期)
                {
                    string 竣工资料上报是否延期 = gridView1.GetRowCellDisplayText(e.RowHandle, gridCol竣工资料上报是否延期).ToString().Trim();
                    if (竣工资料上报是否延期 != "" && sp == "")
                    {
                        DevExpress.Utils.AppearanceDefault appRed = new DevExpress.Utils.AppearanceDefault(Color.Red);
                        DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appRed);
                    }
                    else if (sp != "")
                    {
                        DevExpress.Utils.AppearanceDefault appRed = new DevExpress.Utils.AppearanceDefault(e.Appearance.BackColor, e.Appearance.BackColor);
                        DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appRed);
                    }
                }

                if (e.Column == gridCol竣工是否延期)
                {
                    string 竣工是否延期 = gridView1.GetRowCellDisplayText(e.RowHandle, gridCol竣工是否延期).ToString().Trim();
                    if (竣工是否延期 != "" && sp == "")
                    {
                        DevExpress.Utils.AppearanceDefault appRed = new DevExpress.Utils.AppearanceDefault(Color.Black, Color.Red, Color.Red, Color.SeaShell, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
                        DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appRed);
                    }
                    else if (sp != "")
                    {
                        DevExpress.Utils.AppearanceDefault appRed = new DevExpress.Utils.AppearanceDefault(e.Appearance.BackColor, e.Appearance.BackColor);
                        DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appRed);
                    }
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
        }
Ejemplo n.º 4
0
 private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
 {
     if (e.RowHandle >= 0 && e.RowHandle <= gridView1.DataRowCount - 1)
     {
         DevExpress.Utils.AppearanceDefault appRed = new DevExpress.Utils.AppearanceDefault
                                                         (Color.Black, Color.Red, Color.Empty, Color.SeaShell, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
         DevExpress.Utils.AppearanceDefault appYellow = new DevExpress.Utils.AppearanceDefault
                                                            (Color.Black, Color.Yellow, Color.Empty, Color.SeaShell, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
         DevExpress.Utils.AppearanceDefault appGreen = new DevExpress.Utils.AppearanceDefault
                                                           (Color.Black, Color.Green, Color.Empty, Color.SeaShell, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
         if (e.Column.FieldName == "BRB003")
         {
             string strTemp = gridView1.GetRowCellValue(e.RowHandle, "BRB002").ToString( ).Trim( );
             if (strTemp.Equals("绕线圈") || strTemp.Equals("装电磁铁") || strTemp.Equals("粘摩擦片") || strTemp.Equals("装配衔铁") || strTemp.Equals("装弹簧"))
             {
                 DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appYellow);
             }
         }
     }
 }
Ejemplo n.º 5
0
        private void gridView1_RowCellStyle_1(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
        {
            DevExpress.Utils.AppearanceDefault appNotPass1 = new DevExpress.Utils.AppearanceDefault(Color.Black, Color.Salmon, Color.Empty, Color.SeaShell, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
            DevExpress.Utils.AppearanceDefault appNotPass2 = new DevExpress.Utils.AppearanceDefault(Color.Black, Color.Yellow, Color.Empty, Color.SeaShell, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);

            DataRow dr = gridView1.GetDataRow(e.RowHandle);

            if (dr != null)
            {   //普通发票
                if (
                    (
                        (sInvTypeId == "2")
                        &&
                        (
                            (dr["TAXCUSTNAME"].ToString().Trim() == "") ||
                            (dr["ARTID"].ToString().Trim() != "") ||
                            (dr["TAXNO"].ToString().Trim() == "")
                        )
                    )
                    )
                {
                    DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appNotPass2);
                }
                //专用发票
                if (
                    (sInvTypeId == "1") &&
                    (
                        (dr["TAXCUSTNAME"].ToString().Trim() == "") ||
                        (dr["TAXNO"].ToString().Trim() == "") ||
                        (dr["BANKNAME"].ToString().Trim() == "") ||
                        (dr["BANKACCOUNT"].ToString().Trim() == "") ||
                        (dr["ADDRESS"].ToString().Trim() == "") ||
                        (dr["CONTACTPHONE"].ToString().Trim() == "") ||
                        (dr["ARTID"].ToString().Trim() != "")
                    )
                    )
                {
                    DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appNotPass2);
                }
            }
        }
Ejemplo n.º 6
0
 private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
 {
     if (e.RowHandle >= 0 && e.RowHandle <= gridView1.DataRowCount - 1)
     {
         DevExpress.Utils.AppearanceDefault appRed = new DevExpress.Utils.AppearanceDefault
                                                         (Color.Black, Color.Red, Color.Empty, Color.SeaShell, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
         DevExpress.Utils.AppearanceDefault appYellow = new DevExpress.Utils.AppearanceDefault
                                                            (Color.Black, Color.Yellow, Color.Empty, Color.SeaShell, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
         DevExpress.Utils.AppearanceDefault appGreen = new DevExpress.Utils.AppearanceDefault
                                                           (Color.Black, Color.Green, Color.Empty, Color.SeaShell, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
         if (e.Column.FieldName == "STD004")
         {
             string strTemp    = gridView1.GetRowCellValue(e.RowHandle, "STD003").ToString( ).Trim( );
             string strMessage = gridView1.GetRowCellValue(e.RowHandle, "STD004").ToString( ).Trim( );
             if (/*strTemp . Equals ( "接头数量" ) ||*/ strTemp.Equals("确认接头数量") || strTemp.Equals("焊接接头数量") || strTemp.Equals("出线端线尺寸合格") || strTemp.Equals("非出线端线包尺寸合格") || strTemp.Equals("线包尺寸用卡板检验合格") || strTemp.Equals("外观整齐,无漏绑") || strTemp.Equals("槽楔整齐,无歪斜") || strTemp.Equals("漆包线无破损") || strTemp.Equals("线包尺寸用卡板检验合格%") || strTemp.Equals("绝缘纸维修剪") || strTemp.Equals("引出线长度不够") || strTemp.Equals("曹契装配不合格") || strTemp.Equals("铁芯叠片翘起") || strTemp.Equals("虚焊") || strTemp.Equals("线包高度超出") || strTemp.Equals("绑线松紧不够"))
             {
                 DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appYellow);
             }
         }
     }
 }
Ejemplo n.º 7
0
        private void gridView1_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
        {
            try
            {
                if (e.RowHandle >= 0)
                {
                    DateTime d1;
                    if (gridView1.GetRowCellValue(e.RowHandle, gridColumn23).ToString().Trim() != "")
                    {
                        d1 = DateTime.Parse(DateTime.Parse(gridView1.GetRowCellValue(e.RowHandle, gridColumn23).ToString()).ToString("yyyy-MM-dd"));
                    }
                    else if (gridView1.GetRowCellValue(e.RowHandle, gridColumn21).ToString().Trim() != "")
                    {
                        d1 = DateTime.Parse(DateTime.Parse(gridView1.GetRowCellValue(e.RowHandle, gridColumn21).ToString()).ToString("yyyy-MM-dd"));
                    }
                    else
                    {
                        d1 = DateTime.Parse(DateTime.Parse(gridView1.GetRowCellValue(e.RowHandle, gridColumn19).ToString()).ToString("yyyy-MM-dd"));
                    }

                    if (d1 < DateTime.Parse(FrameBaseFunction.ClsBaseDataInfo.sLogDate))
                    {
                        e.Appearance.BackColor = Color.Tomato;
                    }



                    DevExpress.Utils.AppearanceDefault appTomato = new DevExpress.Utils.AppearanceDefault(Color.Tomato);
                    if (e.Column == gridCol标记延期)
                    {
                        if (Convert.ToBoolean(gridView1.GetRowCellValue(e.RowHandle, gridCol标记延期)))
                        {
                            DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appTomato);
                        }
                    }
                }
            }
            catch
            { }
        }
Ejemplo n.º 8
0
 private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
 {
     if (e.RowHandle >= 0 && e.RowHandle <= gridView1.DataRowCount - 1)
     {
         DevExpress.Utils.AppearanceDefault appRed = new DevExpress.Utils.AppearanceDefault
                                                         (Color.Black, Color.Red, Color.Empty, Color.SeaShell, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
         DevExpress.Utils.AppearanceDefault appYellow = new DevExpress.Utils.AppearanceDefault
                                                            (Color.Black, Color.Yellow, Color.Empty, Color.SeaShell, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
         DevExpress.Utils.AppearanceDefault appGreen = new DevExpress.Utils.AppearanceDefault
                                                           (Color.Black, Color.Green, Color.Empty, Color.SeaShell, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
         string strTemp  = gridView1.GetRowCellValue(e.RowHandle, "GEB002").ToString( ).Trim( );
         string strTemp1 = gridView1.GetRowCellValue(e.RowHandle, "GEB003").ToString( ).Trim( );
         if (e.Column.FieldName == "GEB003")
         {
             if (strTemp.Equals("组装曳引轮+转子") || strTemp.Equals("贴磁钢") || strTemp.Equals("装轴承") || strTemp.Equals("组装机座+定子线圈") || strTemp.Equals("装制动器") || strTemp.Equals("成品检验") || strTemp.Equals("噪音(dB)") || strTemp.Equals("制动器吸合噪音(dB)") || strTemp.Equals("制动器释放噪音(dB)"))
             {
                 //黄色
                 DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appYellow);
             }
         }
         if (e.Column.FieldName == "GEB004")
         {
             if (strTemp.Equals("组装曳引轮+转子") || strTemp.Equals("组装机座+定子线圈"))
             {
                 //红色
                 DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appRed);
             }
         }
         if (e.Column.FieldName == "GEB002" || e.Column.FieldName == "GEB003")
         {
             if (strTemp1.Equals("噪音(dB)") || strTemp1.Equals("制动器吸合噪音(dB)") || strTemp1.Equals("制动器释放噪音(dB)"))
             {
                 //红色
                 DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appYellow);
             }
         }
     }
 }
Ejemplo n.º 9
0
 private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
 {
     DevExpress.Utils.AppearanceDefault appRed = new DevExpress.Utils.AppearanceDefault
         (Color.Black, Color.Red, Color.Empty, Color.SeaShell,System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
     DevExpress.Utils.AppearanceDefault appYellow = new DevExpress.Utils.AppearanceDefault
         (Color.Black, Color.Yellow, Color.Empty, Color.SeaShell,System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
     DevExpress.Utils.AppearanceDefault appGreen = new DevExpress.Utils.AppearanceDefault
         (Color.Black, Color.Green, Color.Empty, Color.SeaShell,System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
     string strTemp = gridView1.GetRowCellValue(e.RowHandle, "cntColor").ToString().Trim();
     if (e.Column.FieldName == "InCount" || e.Column.FieldName == "NeedCount")
     {
         switch (strTemp)
         {
             case "yellow": DevExpress.Utils.AppearanceHelper.Apply(e.Appearance, appYellow); break;
         }
     }
 }