コード例 #1
0
        private void InitDataBindings()
        {
            uccFechaDesde.DataBindings.Add("Value", _uiController, "FechaDesde");
            uccFechaHasta.DataBindings.Add("Value", _uiController, "FechaHasta");

            rbFechaAltaOR.DataBindings.Add("Checked", _uiController, "PorFechaAltaOrdenReparacion");
            rbFechaAsignacionTecnico.DataBindings.Add("Checked", _uiController, "PorFechaAsignacionATecnico");
            rbFechaFactura.DataBindings.Add("Checked", _uiController, "PorFechaFactura");
            rbFechaCierre.DataBindings.Add("Checked", _uiController, "PorFechaCierre");
            rbFechaUltimaModifTecnico.DataBindings.Add("Checked", _uiController, "PorFechaCierreTecnico");

            mzCmbEstadosOrdenReparacion.DataBindings.Add("Value", _uiController, "IdEstadoOrdenReparacion");

            gridResultado.SetDataBinding(null, null);
            gridResultado.SetDataBinding(_uiController.Result, null);

            if (gridResultado.RootTable.Columns["BackColorRojo"] != null)
            {
                Janus.Windows.GridEX.GridEXFormatStyle fs2 = new Janus.Windows.GridEX.GridEXFormatStyle((Janus.Windows.GridEX.GridEXFormatStyle)gridResultado.RowFormatStyle);
                fs2.BackColor = System.Drawing.Color.Red;
                Janus.Windows.GridEX.ConditionOperator     condOp2 = Janus.Windows.GridEX.ConditionOperator.Equal;
                Janus.Windows.GridEX.GridEXFormatCondition cnd2    = new Janus.Windows.GridEX.GridEXFormatCondition(gridResultado.RootTable.Columns["BackColorRojo"], condOp2, Convert.ToInt32(1));
                cnd2.FormatStyle = fs2;
                gridResultado.RootTable.FormatConditions.Add(cnd2);
            }
        }
コード例 #2
0
 private void LadeAssignmentGridView_RowCheckStateChanged(object sender, Janus.Windows.GridEX.RowCheckStateChangeEventArgs e)
 {
     Janus.Windows.GridEX.GridEXFormatStyle yellow = new Janus.Windows.GridEX.GridEXFormatStyle();
     yellow.BackColor = System.Drawing.Color.FromArgb(253, 217, 142);
     Janus.Windows.GridEX.GridEXFormatStyle White = new Janus.Windows.GridEX.GridEXFormatStyle();
     White.BackColor = System.Drawing.Color.FromArgb(255, 255, 255);
     Janus.Windows.GridEX.GridEXFormatStyle Blue = new Janus.Windows.GridEX.GridEXFormatStyle();
     //Blue.BackColor = System.Drawing.Color.FromArgb(192, 222, 255);
     Blue.BackColor = System.Drawing.Color.FromArgb(64, 156, 225);
     Blue.ForeColor = System.Drawing.Color.FromArgb(255, 255, 255);
     if (LadeAssignmentGridView.CurrentRow.IsChecked)
     {
         LadeAssignmentGridView.CurrentRow.RowStyle = Blue;
         LadeAssignmentGridView.CurrentRow.Cells["EditUserName_nvc"].FormatStyle = Blue;
     }
     else
     {
         if (LadeAssignmentGridView.CurrentRow.Cells["EditUserName_nvc"].Value != DBNull.Value && LadeAssignmentGridView.CurrentRow.Cells["AcceptUserName_nvc"].Value != DBNull.Value)
         {
             yellow.ForeColor = System.Drawing.Color.FromArgb(0, 0, 0);
             LadeAssignmentGridView.CurrentRow.RowStyle = yellow;
             LadeAssignmentGridView.CurrentRow.Cells["EditUserName_nvc"].FormatStyle = yellow;
         }
         else
         {
             White.ForeColor = System.Drawing.Color.FromArgb(0, 0, 0);
             LadeAssignmentGridView.CurrentRow.RowStyle = White;
             LadeAssignmentGridView.CurrentRow.Cells["EditUserName_nvc"].FormatStyle = White;
         }
     }
 }
コード例 #3
0
        //GetInfo


        public static Janus.Windows.GridEX.GridEXFormatStyle GetUnReadRowStyle()
        {
            Janus.Windows.GridEX.GridEXFormatStyle _rowStyle = new Janus.Windows.GridEX.GridEXFormatStyle();
            _rowStyle.FontBold  = Janus.Windows.GridEX.TriState.True;
            _rowStyle.BackColor = System.Drawing.Color.Lavender;
            return(_rowStyle);
        }
コード例 #4
0
        public void GetInBoxRefer(int pFolderCode)
        {
            Timer.Stop();
            JReferFolder tmpJReferFolder = new JReferFolder();

            tmpJReferFolder.InsertReferFolder(JAFolderTypeEnum.Inbox);

            CurrentKartable  = JAFolderTypeEnum.Inbox;
            Nodes.ObjectBase = new ClassLibrary.JAction("GetReferNode", "Automation.JKartable.GetNode", null, null);

            JRowStyles p = new JRowStyles();
            JRowStyle  R = new JRowStyle();

            R.Expression = "[خوانده شده]='False'";
            Janus.Windows.GridEX.GridEXFormatStyle JanusRowStyle = new Janus.Windows.GridEX.GridEXFormatStyle();
            JanusRowStyle.BackColor = System.Drawing.Color.Silver;
            R.JanusRowStyle         = JanusRowStyle;
            p.Add(R);
            Nodes.RowStyles = p;

            Nodes.DataTable = JARefers.GetReferInInbox(ClassLibrary.JMainFrame.CurrentPostCode, pFolderCode);
            if (pFolderCode == 0)
            {
                Nodes.Name = "JKartableInBOX";
            }
            else
            {
                Nodes.Name = "FolderInBOX_" + pFolderCode.ToString();
            }
            Nodes.hidColumns = "View_date_Time,externalcode,ObjectType,Receiver_Full_Title,action,Code,ClassName,ObjectCode ,DynamicClassCode";
            Timer.Start();
        }
コード例 #5
0
        private void TimeslipReadOnly(bool setToReadOnly)
        {
            if (setToReadOnly)
            {
                Janus.Windows.GridEX.GridEXFormatStyle fsTSClosed;
                fsTSClosed           = new Janus.Windows.GridEX.GridEXFormatStyle();
                fsTSClosed.ForeColor = SystemColors.ControlDarkDark;
                fsTSClosed.BackColor = SystemColors.ControlLight;

                timeSlipGridEX.AllowEdit = Janus.Windows.GridEX.InheritableBoolean.False;
                timeSlipGridEX.RootTable.Columns["Hours"].Selectable   = false;
                timeSlipGridEX.RootTable.Columns["Comment"].Selectable = false;
                timeSlipGridEX.RootTable.RowFormatStyle = fsTSClosed;
                timeSlipGridEX.RootTable.FormatConditions.Clear();
                timeSlipGridEX.VisualStyle   = Janus.Windows.GridEX.VisualStyle.VS2005;
                timeSlipBindingSource.Filter = "SRPID=" + CurrentRowSRP().SRPID.ToString();
                cmdCloseTimeSlip.Enabled     = Janus.Windows.UI.InheritableBoolean.False;
            }
            else
            {
                Janus.Windows.GridEX.GridEXFormatStyle     fsTSNotClosed;
                Janus.Windows.GridEX.GridEXFormatCondition fcNoHours;
                Janus.Windows.GridEX.GridEXFormatStyle     fsNoHours;

                fsTSNotClosed           = new Janus.Windows.GridEX.GridEXFormatStyle();
                fsTSNotClosed.ForeColor = Color.Empty;
                fsTSNotClosed.BackColor = Color.Empty;
                fcNoHours = new Janus.Windows.GridEX.GridEXFormatCondition(timeSlipGridEX.RootTable.Columns["Hours"], Janus.Windows.GridEX.ConditionOperator.Equal, 0);
                fcNoHours.TargetColumn = timeSlipGridEX.RootTable.Columns["Hours"];
                fsNoHours             = new Janus.Windows.GridEX.GridEXFormatStyle();
                fsNoHours.ForeColor   = Color.Black;
                fsNoHours.BackColor   = Color.Moccasin;
                fcNoHours.FormatStyle = fsNoHours;

                timeSlipGridEX.AllowEdit = Janus.Windows.GridEX.InheritableBoolean.True;
                timeSlipGridEX.RootTable.Columns["Hours"].Selectable   = true;
                timeSlipGridEX.RootTable.Columns["Comment"].Selectable = true;
                timeSlipGridEX.RootTable.RowFormatStyle = fsTSNotClosed;
                timeSlipGridEX.RootTable.FormatConditions.Add(fcNoHours);
                timeSlipGridEX.VisualStyle = Janus.Windows.GridEX.VisualStyle.Office2007;

                DateTime endDate = CurrentRowSRP().SRPDate.AddMonths(1).AddMinutes(-1);
                timeSlipBindingSource.Filter = "StartTime >= '" + CurrentRowSRP().SRPDate + "' and StartTime <='" + endDate + "'";

                DateTime DateOKToClose = CurrentRowSRP().SRPDate.AddMonths(1).AddDays(-1);
                if (DateTime.Today >= DateOKToClose)
                {
                    cmdCloseTimeSlip.Enabled = Janus.Windows.UI.InheritableBoolean.True;
                }
                else
                {
                    cmdCloseTimeSlip.Enabled = Janus.Windows.UI.InheritableBoolean.False;
                }
            }
        }
コード例 #6
0
        Boolean first  = true; //for checking the it is first time for that user
        public PLTrade()
        {
            InitializeComponent();

            Janus.Windows.GridEX.GridEXFormatStyle style = new Janus.Windows.GridEX.GridEXFormatStyle();
            style.ForeColor = Color.LightGray;
            style.Key       = "Accepted";
            grdPLTrade.FormatStyles.Add(style);

            dateTimePickerFrom.Value   = DateTime.Today;
            dateTimePickerFrom.Checked = true;
            dateTimePickerTo.Value     = DateTime.Now;
            dateTimePickerTo.Checked   = false;
        }
コード例 #7
0
        private void gridResultado_FormattingRow(object sender, Janus.Windows.GridEX.RowLoadEventArgs e)
        {
            //gridResultado.GroupsChanged +=new Janus.Windows.GridEX.GroupsChangedEventHandler(gridResultado_GroupsChanged);
            //gridResultado.GroupsChanging += new Janus.Windows.GridEX.GroupsChangingEventHandler(gridResultado_GroupsChanging);
            if (e.Row.RowType.Equals(Janus.Windows.GridEX.RowType.GroupHeader))
            {
                Janus.Windows.GridEX.GridEXFormatStyle style = new Janus.Windows.GridEX.GridEXFormatStyle();
                //style.BackColor = (Color)_mapGroupfis[e.Row.Group.Index];
                if (_mapGroupForegroundColors.ContainsKey(e.Row.Group.Index))
                {
                    style.ForeColor = (Color)_mapGroupForegroundColors[e.Row.Group.Index];
                }
                else
                {
                    style.ForeColor = Color.DimGray;
                }
                style.FontBold = Janus.Windows.GridEX.TriState.True;
                e.Row.RowStyle = style;
            }
            if (e.Row.RowType.Equals(Janus.Windows.GridEX.RowType.GroupFooter))
            {
                Janus.Windows.GridEX.GridEXFormatStyle style = new Janus.Windows.GridEX.GridEXFormatStyle();
                if (_mapGroupForegroundColors.ContainsKey(e.Row.Group.Index))
                {
                    style.ForeColor = (Color)_mapGroupForegroundColors[e.Row.Group.Index];
                }
                else
                {
                    style.ForeColor = Color.DimGray;
                }
                style.FontBold = Janus.Windows.GridEX.TriState.True;
                e.Row.RowStyle = style;
            }
            if (e.Row.RowType.Equals(Janus.Windows.GridEX.RowType.Record))
            {
                Janus.Windows.GridEX.GridEXFormatStyle style = new Janus.Windows.GridEX.GridEXFormatStyle();
                //style.ForeColor = Color.Transparent;
                e.Row.RowStyle = style;
            }

            /*
             * if(e.Row.RowType.Equals(Janus.Windows.GridEX.RowType.TotalRow))
             * {
             *      Janus.Windows.GridEX.GridEXFormatStyle style = new Janus.Windows.GridEX.GridEXFormatStyle();
             *      style.BackColor = Color.Pink;
             *      e.Row.RowStyle = style;
             * }
             */
        }
コード例 #8
0
        private void documentGridEX_FormattingRow(object sender, Janus.Windows.GridEX.RowLoadEventArgs e)
        {
            try
            {
                if (e.Row.DataRow == null)
                {
                    return;
                }
                docDB.DocumentRow dr = (docDB.DocumentRow)((DataRowView)e.Row.DataRow).Row;
                if (dr == null)
                {
                    return;
                }

                if (!dr.IsSizeNull())
                {
                    e.Row.Cells["Size"].Text = String.Format("{0} kb", dr.Size / 1024);
                }

                if (!dr.IsSentToShareFolderNull())
                {
                    if (dr.SentToShareFolder == 2)
                    {
                        e.Row.Cells["SentToShareFolder"].Image = Properties.Resources.SentToShareSuccess;
                    }
                    else if (dr.SentToShareFolder == 3)
                    {
                        e.Row.Cells["SentToShareFolder"].Image = Properties.Resources.SentToShareFail;
                    }
                }

                if (myDM == null || myDM.FM.IsVirtualFM || dr.IsNull("FileId"))
                {
                    return;
                }

                //JLL: When Selecting Add Doc/Record/Send from ucRecords action, dr.fileid is null, making below statement fail
                if (dr.FileId != myDM.FM.CurrentFile.FileId)
                {
                    Janus.Windows.GridEX.GridEXFormatStyle fmt = new Janus.Windows.GridEX.GridEXFormatStyle();
                    fmt.BackColor  = Color.LightYellow;
                    e.Row.RowStyle = fmt;
                }
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }
コード例 #9
0
 private void gridExRoleLegend_FormattingRow(object sender, Janus.Windows.GridEX.RowLoadEventArgs e)
 {
     try
     {
         string sColor = e.Row.Cells["Color"].Text.ToString();
         Color  cColor = Color.FromArgb(Convert.ToInt32(sColor));
         Janus.Windows.GridEX.GridEXFormatStyle gfs = new Janus.Windows.GridEX.GridEXFormatStyle();
         gfs.BackColor  = cColor;
         e.Row.RowStyle = gfs;
     }
     catch (Exception x)
     {
         UIHelper.HandleUIException(x);
     }
 }
コード例 #10
0
        /*
         * private void gridEX1_CellUpdated(object sender, Janus.Windows.GridEX.ColumnActionEventArgs e)
         * {
         *      gridEX1.Refresh();
         * }
         */

        private void gridEX1_SelectionChanged(object sender, EventArgs e)
        {
            bool ok = false;

            if (gridEX1.SelectedItems.Count > 0 && gridEX1.SelectedItems[0].RowType.Equals(Janus.Windows.GridEX.RowType.Record))
            {
                gridEXValores.Refetch();
                object    selected = gridEX1.SelectedItems[0].GetRow().DataRow;
                ArrayList valores  = _uiController.GetValores(selected);
                foreach (object valor in valores)
                {
                    Janus.Windows.GridEX.GridEXRow row = gridEXValores.GetRow(valor);
                    if (row != null)
                    {
                        Janus.Windows.GridEX.GridEXFormatStyle rowStyle = new Janus.Windows.GridEX.GridEXFormatStyle();
                        rowStyle.BackColor = System.Drawing.Color.Red;
                        row.RowStyle       = rowStyle;
                    }
                }
            }
        }
コード例 #11
0
        //bool isRefresh;

        public Orders()
        {
            InitializeComponent();

            Janus.Windows.GridEX.GridEXFormatStyle style = new Janus.Windows.GridEX.GridEXFormatStyle();
            style.ForeColor = Color.LightGray;
            style.Key       = "Accepted";
            grdOrders.FormatStyles.Add(style);
            //RefreshDataset();

            dtpStartDate.Value   = DateTime.Now;
            dtpStartDate.Checked = true;
            dtpEndDate.Value     = DateTime.Now;
            dtpEndDate.Checked   = false;


            if (singleton_Orders == null)
            {
                singleton_Orders = this;
            }
            // isRefresh = false;
        }
コード例 #12
0
 private void LoadLadeAssignmentWithDate()
 {
     try
     {
         HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory LadeAssignmentFactory = new HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory();
         Properties.Settings Setting = new HPS.Properties.Settings();
         string Condition            = string.Empty;
         if (Setting.SaloonID_int != 0)
         {
             Condition = string.Format("[LadeAssignment_T].[Accepted_bit]='false' AND LadeAssignment_T.LadingDate_nvc='{0}' AND (LT.SaloonID_int ={1}) ", LadeAssignmentFactory.ServerJalaliDate, Setting.SaloonID_int);
         }
         else
         {
             Condition = string.Format("[LadeAssignment_T].[Accepted_bit]='false' AND LadeAssignment_T.LadingDate_nvc='{0}' ", LadeAssignmentFactory.ServerJalaliDate);
         }
         LadeAssignmentDataTable.Clear();
         LadeAssignmentFactory.GetForAccept(Condition, ref LadeAssignmentDataTable);
         LadeAssignmentGridView.DataSource = null;
         this.LadeAssignmentGridView.SetDataBinding(LadeAssignmentDataTable, "LadeAssignmentDataTable");
         Janus.Windows.GridEX.GridEXFormatStyle Focus = new Janus.Windows.GridEX.GridEXFormatStyle();
         Focus.FontSize = 20;
         Janus.Windows.GridEX.GridEXFormatStyle yellow = new Janus.Windows.GridEX.GridEXFormatStyle();
         yellow.BackColor = System.Drawing.Color.FromArgb(253, 217, 142);
         for (int i = 0; i < ((DataTable)LadeAssignmentGridView.DataSource).Rows.Count; i++)
         {
             if (LadeAssignmentGridView.GetRow(i).Cells["EditUserName_nvc"].Value != DBNull.Value && LadeAssignmentGridView.GetRow(i).Cells["AcceptUserName_nvc"].Value != DBNull.Value)
             {
                 LadeAssignmentGridView.GetRow(i).RowStyle = yellow;
                 LadeAssignmentGridView.GetRow(i).Cells["EditUserName_nvc"].FormatStyle = yellow;
             }
         }
         ChooseLadeAssignmentAcceptedButton.Select();
     }
     catch (System.Exception ex)
     {
         Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
     }
 }
コード例 #13
0
 private void grdPLTrade_FormattingRow(object sender, Janus.Windows.GridEX.RowLoadEventArgs e)
 {
     try
     {
         double pips;
         if (e.Row.Cells["Realized"].Value != DBNull.Value)
         {
             pips = Convert.ToDouble(e.Row.Cells["Realized"].Value);
             Janus.Windows.GridEX.GridEXFormatStyle f = new Janus.Windows.GridEX.GridEXFormatStyle();
             if (pips > 0)
             {
                 f.ForeColor = Color.Green;
                 e.Row.Cells["Realized"].FormatStyle = f;
             }
             else if (pips < 0)
             {
                 f.ForeColor = Color.Red;
                 e.Row.Cells["Realized"].FormatStyle = f;
             }
         }
         pips = Convert.ToDouble(e.Row.Cells["RealizedUSD"].Value);
         Janus.Windows.GridEX.GridEXFormatStyle f1 = new Janus.Windows.GridEX.GridEXFormatStyle();
         if (pips > 0)
         {
             f1.ForeColor = Color.Green;
             e.Row.Cells["RealizedUSD"].FormatStyle = f1;
         }
         else if (pips < 0)
         {
             f1.ForeColor = Color.Red;
             e.Row.Cells["RealizedUSD"].FormatStyle = f1;
         }
     }
     catch //(Exception ex)
     {
     }
 }
コード例 #14
0
 public static Janus.Windows.GridEX.GridEXFormatStyle GetReadRowStyle()
 {
     Janus.Windows.GridEX.GridEXFormatStyle _rowStyle = new Janus.Windows.GridEX.GridEXFormatStyle();
     return(_rowStyle);
 }
コード例 #15
0
        private void _grilla_FormattingRow(object sender, Janus.Windows.GridEX.RowLoadEventArgs e)
        {
            Janus.Windows.GridEX.GridEXRow row = e.Row;
            if (row.RowType == Janus.Windows.GridEX.RowType.Record)
            {
                foreach (ConfiguracionStyleGrilla.ConfiguracionGrillaEstilosCondicionalesDet conf in _configuracionDet)
                {
                    string key  = conf.Columna.Name;
                    string cond = conf.Condicion;
                    Janus.Windows.GridEX.GridEXCell   cell1 = row.Cells[key];
                    Janus.Windows.GridEX.GridEXColumn col2  = (Janus.Windows.GridEX.GridEXColumn)conf.Valor;
                    Janus.Windows.GridEX.GridEXCell   cell2 = row.Cells[col2.Key];
                    object valorCol1          = cell1.Value;
                    object valorCol2          = cell2.Value;
                    bool   satisfaceCondicion = false;
                    string type = conf.Columna.Type;
                    switch (cond)
                    {
                    case ">":
                    {
                        switch (type)
                        {
                        case "DECIMAL":
                            decimal val1D = (decimal)valorCol1;
                            decimal val2D = (decimal)valorCol2;
                            satisfaceCondicion = val1D > val2D;
                            break;

                        case "INT":
                            int val1I = (int)valorCol1;
                            int val2I = (int)valorCol2;
                            satisfaceCondicion = val1I > val2I;
                            break;

                        case "DATETIME":
                            DateTime val1DT = (DateTime)valorCol1;
                            DateTime val2DT = (DateTime)valorCol2;
                            satisfaceCondicion = val1DT > val2DT;
                            break;
                        }
                        break;
                    }

                    case "<":
                    {
                        switch (type)
                        {
                        case "DECIMAL":
                            decimal val1D = (decimal)valorCol1;
                            decimal val2D = (decimal)valorCol2;
                            satisfaceCondicion = val1D < val2D;
                            break;

                        case "INT":
                            int val1I = (int)valorCol1;
                            int val2I = (int)valorCol2;
                            satisfaceCondicion = val1I < val2I;
                            break;

                        case "DATETIME":
                            DateTime val1DT = (DateTime)valorCol1;
                            DateTime val2DT = (DateTime)valorCol2;
                            satisfaceCondicion = val1DT < val2DT;
                            break;
                        }
                        break;
                    }

                    case "=":
                    {
                        switch (type)
                        {
                        case "DECIMAL":
                            decimal val1D = (decimal)valorCol1;
                            decimal val2D = (decimal)valorCol2;
                            satisfaceCondicion = val1D == val2D;
                            break;

                        case "INT":
                            int val1I = (int)valorCol1;
                            int val2I = (int)valorCol2;
                            satisfaceCondicion = val1I == val2I;
                            break;

                        case "DATETIME":
                            DateTime val1DT = (DateTime)valorCol1;
                            DateTime val2DT = (DateTime)valorCol2;
                            satisfaceCondicion = val1DT == val2DT;
                            break;

                        case "STRING":
                            string val1S = (string)valorCol1;
                            string val2S = (string)valorCol2;
                            satisfaceCondicion = val1S == val2S;
                            break;

                        case "BOOL":
                            bool val1B = (bool)valorCol1;
                            bool val2B = (bool)valorCol2;
                            satisfaceCondicion = val1B == val2B;
                            break;
                        }
                        break;
                    }

                    case ">=":
                    {
                        switch (type)
                        {
                        case "DECIMAL":
                            decimal val1D = (decimal)valorCol1;
                            decimal val2D = (decimal)valorCol2;
                            satisfaceCondicion = val1D >= val2D;
                            break;

                        case "INT":
                            int val1I = (int)valorCol1;
                            int val2I = (int)valorCol2;
                            satisfaceCondicion = val1I >= val2I;
                            break;

                        case "DATETIME":
                            DateTime val1DT = (DateTime)valorCol1;
                            DateTime val2DT = (DateTime)valorCol2;
                            satisfaceCondicion = val1DT >= val2DT;
                            break;
                        }
                        break;
                    }

                    case "<=":
                    {
                        switch (type)
                        {
                        case "DECIMAL":
                            decimal val1D = (decimal)valorCol1;
                            decimal val2D = (decimal)valorCol2;
                            satisfaceCondicion = val1D <= val2D;
                            break;

                        case "INT":
                            int val1I = (int)valorCol1;
                            int val2I = (int)valorCol2;
                            satisfaceCondicion = val1I <= val2I;
                            break;

                        case "DATETIME":
                            DateTime val1DT = (DateTime)valorCol1;
                            DateTime val2DT = (DateTime)valorCol2;
                            satisfaceCondicion = val1DT <= val2DT;
                            break;
                        }
                        break;
                    }

                    case "!=":
                    {
                        switch (type)
                        {
                        case "DECIMAL":
                            decimal val1D = (decimal)valorCol1;
                            decimal val2D = (decimal)valorCol2;
                            satisfaceCondicion = val1D != val2D;
                            break;

                        case "INT":
                            int val1I = (int)valorCol1;
                            int val2I = (int)valorCol2;
                            satisfaceCondicion = val1I != val2I;
                            break;

                        case "DATETIME":
                            DateTime val1DT = (DateTime)valorCol1;
                            DateTime val2DT = (DateTime)valorCol2;
                            satisfaceCondicion = val1DT != val2DT;
                            break;

                        case "STRING":
                            string val1S = (string)valorCol1;
                            string val2S = (string)valorCol2;
                            satisfaceCondicion = val1S != val2S;
                            break;

                        case "BOOL":
                            bool val1B = (bool)valorCol1;
                            bool val2B = (bool)valorCol2;
                            satisfaceCondicion = val1B != val2B;
                            break;
                        }
                        break;
                    }

                    case "like":
                    {
                        switch (type)
                        {
                        case "STRING":
                            string val1D = (string)valorCol1;
                            string val2D = (string)valorCol2;
                            satisfaceCondicion = val1D.IndexOf(val2D) != -1;
                            break;
                        }
                        break;
                    }
                    }
                    if (satisfaceCondicion)
                    {
                        Janus.Windows.GridEX.GridEXFormatStyle fs = conf.Estilo.ToFormatStyle();
                        row.RowStyle = fs;
                    }
                }
            }
        }
コード例 #16
0
        private bool ObtenerConfiguracionGrillaPerfiles(long IdProceso, long IdTarea, long IdPerfil, long IdConfiguracion)
        {
            bool existeConfiguracion = false;
            //long IdConfiguracion = long.MinValue;
            //tui_ConfiguracionGrillaEstiloAplicadoPerfilesDataset dataEA = tui_ConfiguracionGrillaEstiloAplicadoPerfiles.GetList(IdPerfil, IdProceso, IdTarea, _grilla.Name, _formulario, long.MinValue);
            //foreach(tui_ConfiguracionGrillaEstiloAplicadoPerfilesDataset.tui_ConfiguracionGrillaEstiloAplicadoPerfilesRow row in dataEA.tui_ConfiguracionGrillaEstiloAplicadoPerfiles.Rows)
            //{
            //existeConfiguracion = true;
            //IdConfiguracion = row.IdConfiguracion;
            tui_ConfiguracionGrillaEstilosCondicionalesDetPerfilesDataset dataCondDet = businessrules.tui_ConfiguracionGrillaEstilosCondicionalesDetPerfiles.GetList(IdPerfil, IdConfiguracion);

            foreach (tui_ConfiguracionGrillaEstilosCondicionalesDetPerfilesDataset.tui_ConfiguracionGrillaEstilosCondicionalesDetPerfilesRow rowDet in dataCondDet.tui_ConfiguracionGrillaEstilosCondicionalesDetPerfiles.Rows)
            {
                existeConfiguracion = true;
                string ColumnaKey  = rowDet.Columna;
                string Condicion   = rowDet.Condicion.ToString();
                long   IdCondicion = rowDet.IdCondicion;
                Janus.Windows.GridEX.GridEXFormatStyle fs = getEstiloPerfil(IdConfiguracion, IdCondicion, IdPerfil);
                if (rowDet["ValorColumna"] == System.DBNull.Value || rowDet.ValorColumna.Equals(string.Empty))                        //El valor de comparacion no es una colomna
                {
                    Janus.Windows.GridEX.ConditionOperator condOp = new Janus.Windows.GridEX.ConditionOperator();
                    switch (Condicion)
                    {
                    case ">":
                        condOp = Janus.Windows.GridEX.ConditionOperator.GreaterThan;
                        break;

                    case "<":
                        condOp = Janus.Windows.GridEX.ConditionOperator.LessThan;
                        break;

                    case "=":
                        condOp = Janus.Windows.GridEX.ConditionOperator.Equal;
                        break;

                    case ">=":
                        condOp = Janus.Windows.GridEX.ConditionOperator.GreaterThanOrEqualTo;
                        break;

                    case "<=":
                        condOp = Janus.Windows.GridEX.ConditionOperator.LessThanOrEqualTo;
                        break;

                    case "!=":
                        condOp = Janus.Windows.GridEX.ConditionOperator.NotEqual;
                        break;

                    case "like":
                        condOp = Janus.Windows.GridEX.ConditionOperator.Contains;
                        break;
                    }
                    string Valor = rowDet.Valor;
                    Janus.Windows.GridEX.GridEXFormatCondition cnd = new Janus.Windows.GridEX.GridEXFormatCondition(_grilla.RootTable.Columns[ColumnaKey], condOp, Valor);
                    cnd.FormatStyle = fs;
                    _grilla.RootTable.FormatConditions.Add(cnd);
                }
                else                         //El valor de comparacion es una colomna
                {
                    string ColumnaValorKey = rowDet.ValorColumna;
                    Janus.Windows.GridEX.GridEXColumn            realColumn = _grilla.RootTable.Columns[ColumnaKey];
                    ConfiguracionStyleGrilla.ColumnaView         colView    = new ConfiguracionStyleGrilla.ColumnaView(realColumn.Caption, GridManagerView.getTypeFor(realColumn.FormatString, realColumn.ColumnType.ToString()), realColumn.Key, realColumn);
                    Janus.Windows.GridEX.GridEXColumn            valorC     = _grilla.RootTable.Columns[ColumnaValorKey];
                    ConfiguracionStyleGrilla.MyGridEXFormatStyle mfs        = new ConfiguracionStyleGrilla.MyGridEXFormatStyle(fs);
                    ConfiguracionStyleGrilla.ConfiguracionGrillaEstilosCondicionalesDet detConf = new ConfiguracionStyleGrilla.ConfiguracionGrillaEstilosCondicionalesDet(IdCondicion, colView, Condicion, valorC, mfs, string.Empty);
                    _configuracionDet.Add(detConf);
                }
            }

            //}
            if (existeConfiguracion)
            {
                tui_ConfiguracionGrillaEstilosCondicionalesPerfilesDataset.tui_ConfiguracionGrillaEstilosCondicionalesPerfilesRow rowC = tui_ConfiguracionGrillaEstilosCondicionalesPerfiles.GetByPk(IdPerfil, IdConfiguracion);
                string nombreConf = rowC.Nombre;
                toolTip1.SetToolTip(btnConfGrilla, nombreConf);
            }
            return(existeConfiguracion);
        }
コード例 #17
0
        private Janus.Windows.GridEX.GridEXFormatStyle getEstiloPerfil(long IdConfiguracion, long IdCondicion, long IdPerfil)
        {
            Janus.Windows.GridEX.GridEXFormatStyle fs = new Janus.Windows.GridEX.GridEXFormatStyle((Janus.Windows.GridEX.GridEXFormatStyle)_grilla.RowFormatStyle);
            tui_ConfiguracionGrillaEstilosCondicionalesDetEstilosAplicadosPerfilesDataset dataCondDetEstAp = businessrules.tui_ConfiguracionGrillaEstilosCondicionalesDetEstilosAplicadosPerfiles.GetList(IdPerfil, IdConfiguracion, IdCondicion);

            foreach (tui_ConfiguracionGrillaEstilosCondicionalesDetEstilosAplicadosPerfilesDataset.tui_ConfiguracionGrillaEstilosCondicionalesDetEstilosAplicadosPerfilesRow rowDetEstA in dataCondDetEstAp.tui_ConfiguracionGrillaEstilosCondicionalesDetEstilosAplicadosPerfiles.Rows)
            {
                string Propiedad = rowDetEstA.Propiedad;
                string val       = rowDetEstA.Valor;
                switch (Propiedad)
                {
                case "BackColor":
                    int argb = Convert.ToInt32(val);
                    fs.BackColor = System.Drawing.Color.FromArgb(argb);
                    break;

                case "Font":
                    if (!val.Equals(string.Empty))
                    {
                        XmlDocument doc = new XmlDocument();
                        doc.LoadXml(val);
                        XmlNodeReader reader = new XmlNodeReader(doc.DocumentElement);
                        XmlSerializer ser    = new XmlSerializer(typeof(mz.erp.businessrules.ConfiguracionStyleGrilla.XmlFont));
                        object        obj    = ser.Deserialize(reader);
                        mz.erp.businessrules.ConfiguracionStyleGrilla.XmlFont xmlFont = (mz.erp.businessrules.ConfiguracionStyleGrilla.XmlFont)obj;
                        fs.Font = xmlFont.ToFont();
                    }
                    break;

                case "FontBold":
                {
                    Janus.Windows.GridEX.TriState fb = Janus.Windows.GridEX.TriState.Empty;
                    switch (val)
                    {
                    case "Empty":
                        fb = Janus.Windows.GridEX.TriState.Empty;
                        break;

                    case "False":
                        fb = Janus.Windows.GridEX.TriState.False;
                        break;

                    case "True":
                        fb = Janus.Windows.GridEX.TriState.True;
                        break;
                    }
                    fs.FontBold = fb;
                    break;
                }

                case "FontItalic":
                {
                    Janus.Windows.GridEX.TriState fb = Janus.Windows.GridEX.TriState.Empty;
                    switch (val)
                    {
                    case "Empty":
                        fb = Janus.Windows.GridEX.TriState.Empty;
                        break;

                    case "False":
                        fb = Janus.Windows.GridEX.TriState.False;
                        break;

                    case "True":
                        fb = Janus.Windows.GridEX.TriState.True;
                        break;
                    }
                    fs.FontItalic = fb;
                    break;
                }

                case "FontSize":
                    fs.FontSize = (float)Convert.ToDecimal(val);
                    break;

                case "ForeColor":
                    int argb2 = Convert.ToInt32(val);
                    fs.ForeColor = System.Drawing.Color.FromArgb(argb2);
                    break;

                case "TextAlignment":
                {
                    Janus.Windows.GridEX.TextAlignment ta = Janus.Windows.GridEX.TextAlignment.Empty;
                    switch (val)
                    {
                    case "Center":
                        ta = Janus.Windows.GridEX.TextAlignment.Center;
                        break;

                    case "Empty":
                        ta = Janus.Windows.GridEX.TextAlignment.Empty;
                        break;

                    case "Far":
                        ta = Janus.Windows.GridEX.TextAlignment.Far;
                        break;

                    case "Near":
                        ta = Janus.Windows.GridEX.TextAlignment.Near;
                        break;
                    }
                    fs.TextAlignment = ta;
                    break;
                }
                }
            }
            return(fs);
        }