コード例 #1
0
        private void cardViewStockDetails_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            var  view = sender as ColumnView;
            var  col  = view.Columns["UnitPrice"];
            bool save = true;

            try
            {
                decimal temp = (decimal)view.GetRowCellValue(e.RowHandle, col);
                if (temp <= 0)
                {
                    e.Valid = false;
                    view.SetColumnError(col, "Unit price is not accepted null or empty or less than zezo!");
                    save = false;
                }
            }
            catch
            {
                e.Valid = false;
                view.SetColumnError(col, "Unit price is not accepted null!");
                save = false;
            }
            try
            {
                col = view.Columns["Count"];
                int count = (int)view.GetRowCellValue(e.RowHandle, col);
                if (count <= 0)
                {
                    e.Valid = false;
                    view.SetColumnError(col, "Count is not accepted less than zezo!");
                    save = false;
                }
            }
            catch
            {
                e.Valid = false;
                view.SetColumnError(col, "Count is not accepted null!");
                save = false;
            }

            try
            {
                col = view.Columns["ProductID"];
                int proId = (int)view.GetRowCellValue(e.RowHandle, col);
                if (proId <= 0)
                {
                    e.Valid = false;
                    view.SetColumnError(view.Columns["ProductName"], "Please choose product!");
                    save = false;
                }
            }
            catch
            {
                e.Valid = false;
                view.SetColumnError(view.Columns["ProductName"], "Please choose product!");
                save = false;
            }

            btnDetailsSave.Enabled = save;
        }
コード例 #2
0
        private void pledgesView_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            var pledge = (Pledge)e.Row;

            e.ErrorText = controller.GetErrorText(pledge);
            e.Valid     = String.IsNullOrEmpty(e.ErrorText);
        }
コード例 #3
0
ファイル: frmEntrySocres.cs プロジェクト: vhtrieu/HLTV
        private void griVEntryCoures_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            DataRow    r       = griVEntryCoures.GetFocusedDataRow();
            ColumnView view    = sender as ColumnView;
            GridColumn column1 = view.Columns["DIE_Diem"];

            if (r["DIE_Diem"].ToString().Equals(String.Empty))
            {
                //e.ErrorText = “Nhập dữ liệu sai.”;
                e.Valid = false;
                view.SetColumnError(view.Columns["DIE_Diem"], "Không được để trống");
            }
            if (int.Parse(r["DIE_Diem"].ToString()) > 10)
            {
                e.ErrorText = "Nhập dữ liệu sai.";
                e.Valid     = false;
                view.SetColumnError(view.Columns["DIE_Diem"], "Điểm không thể quá 10");
                return;
            }
            if (int.Parse(r["DIE_Diem"].ToString()) < 0)
            {
                e.ErrorText = "Nhập dữ liệu sai.";
                e.Valid     = false;
                view.SetColumnError(view.Columns["DIE_Diem"], "Điểm không thể nhỏ hơn 0");
                return;
            }
        }
        private void gridView1_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            if (e.RowHandle != GridControl.NewItemRowHandle)
            {
                return;
            }
            Dictionary <string, object> customValues = new Dictionary <string, object>();
            GridView view = (GridView)sender;

            foreach (GridColumn col in view.Columns)
            {
                customValues.Add(col.FieldName, view.GetRowCellValue(e.RowHandle, col));
            }
            Validator validator = new Validator((XPBaseObject)e.Row, customValues);

            foreach (GridColumn col in ((GridView)sender).Columns)
            {
                e.ErrorText = validator.Validate(col.FieldName);
                if (!string.IsNullOrEmpty(e.ErrorText))
                {
                    e.Valid = false;
                    return;
                }
            }
        }
コード例 #5
0
ファイル: UserFieldsForm.cs プロジェクト: mdgiles/TraceOffice
        private void advBandedGridView1_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            ColumnView view    = sender as ColumnView;
            GridColumn column1 = view.Columns["LINK_TABLE"];
            GridColumn column2 = view.Columns["LINK_COLUMN"];
            GridColumn column3 = view.Columns["DESC"];

            string val1 = (string)view.GetRowCellValue(e.RowHandle, column1);
            string val2 = (string)view.GetRowCellValue(e.RowHandle, column2);
            string val3 = (string)view.GetRowCellValue(e.RowHandle, column3);

            //if (string.IsNullOrWhiteSpace(val1))
            //{
            //    e.Valid = false;
            //    view.SetColumnError(column1, "Link Table cannot be blank in a row.");
            //}

            //if (string.IsNullOrWhiteSpace(val2))
            //{
            //    e.Valid = false;
            //    view.SetColumnError(column2, "Link Column cannot be blank in a row.");
            //}

            //if (string.IsNullOrWhiteSpace(val3))
            //{
            //    e.Valid = false;
            //    view.SetColumnError(column3, "Description cannot be blank in a row.");
            //}
        }
コード例 #6
0
        private static bool IsNotDuplicateAreaLabel(ColumnView currentView, ValidateRowEventArgs e)
        {
            IEnumerable dataSource = currentView.DataSource as IEnumerable;

            if (dataSource != null)
            {
                Area area = e.Row as Area;

                if (area != null)
                {
                    GridColumn colLabel = currentView.Columns["Labels"];

                    // Check section does not exist at a site level
                    if (area.GetType() == typeof(Section))
                    {
                        return(IsNotDuplicateSectionWithinSite(currentView, (Section)area, colLabel));
                    }

                    // Otherwise area does not exist based on FullLocation
                    foreach (Area a in dataSource)
                    {
                        if (string.Equals(a.FullLocation,
                                          area.FullLocation,
                                          StringComparison.CurrentCultureIgnoreCase) &&
                            a.Id != area.Id)
                        {
                            currentView.SetColumnError(colLabel, "Area " + area.Label + " already exists");
                            return(false);
                        }
                    } //foreach
                }     // if(area!=null)
            }         //if(datasource!=null)

            return(true);
        }
コード例 #7
0
        private void gridView2_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            using (Session session1 = new Session())
            {
                session1.BeginTransaction();
                try
                {
                    ColumnView view    = sender as ColumnView;
                    GridColumn column1 = view.Columns["CODE"];
                    GridColumn column2 = view.Columns["DAY"];
                    GridColumn column3 = view.Columns["CAT"];
                    GridColumn column4 = view.Columns["LINE"];

                    //Get the value of the columns
                    string val1 = (string)view.GetRowCellValue(e.RowHandle, column1);
                    int    val2 = (int)view.GetRowCellValue(e.RowHandle, column2);
                    string val3 = (string)view.GetRowCellValue(e.RowHandle, column3);
                    int    val4 = (int)view.GetRowCellValue(e.RowHandle, column4);

                    var load = from c in context.PCOMP where c.CODE == val1 && c.DAY == val2 && c.CAT == val3 && c.LINE == val4 select c;
                    //Validity criterion
                    if (load.Count() > 0)
                    {
                        e.Valid = false;
                        view.SetColumnError(column1, "You are trying to enter a duplicate record.");
                    }

                    session1.CommitTransaction();
                }
                catch { session1.RollbackTransaction(); }
            }
        }
コード例 #8
0
        private void Trayectoria_gridView_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            var trayectoria = (TrayectoriaArtista)e.Row;

            if (trayectoria.Centro == null)
            {
                Trayectoria_gridView.SetColumnError(Trayectoria_gridView.Columns["Centro"], "Indique Centro ej: Agencia Clave Cubana, Musicuba, etc...");
                e.Valid = false;
            }
            if (trayectoria.Agrupacion == null)
            {
                Trayectoria_gridView.SetColumnError(Trayectoria_gridView.Columns["Agrupacion"], "Indique la unidad artística ...");
                e.Valid = false;
            }
            if (trayectoria.Desempenno == null)
            {
                Trayectoria_gridView.SetColumnError(Trayectoria_gridView.Columns["Desempenno"], "Indique Desempeño ...");
                e.Valid = false;
            }
            if (trayectoria.Desde < Convert.ToDateTime("1/1/1930"))
            {
                Trayectoria_gridView.SetColumnError(Trayectoria_gridView.Columns["Desde"], "Indique Fecha de alta en dicha unidad Artística ...");
                e.Valid = false;
            }
        }
コード例 #9
0
        private void ItemType_GridView_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            ItemType_GridView.ClearColumnErrors();

            ItemType row  = e.Row.CastTo <ItemType>();
            GridView view = sender as GridView;

            if (string.IsNullOrEmpty(row.ItemTypeName))
            {
                e.Valid = false;
                //Set errors with specific descriptions for the columns
                GridColumn column = view.Columns[nameof(row.ItemTypeName)];
                view.SetColumnError(column, BSMessage.BSM000013);
            }

            if (string.IsNullOrEmpty(row.ItemTypeSName))
            {
                e.Valid = false;
                //Set errors with specific descriptions for the columns
                GridColumn column = view.Columns[nameof(row.ItemTypeSName)];
                view.SetColumnError(column, BSMessage.BSM000012);
            }

            // Kiểm tra tồn tại trong grid
            if (ItemTypeData.ToList().Count(o => o.ItemTypeSName == row.ItemTypeSName) > 1)
            {
                e.Valid = false;
                //Set errors with specific descriptions for the columns
                GridColumn column = view.Columns[nameof(row.ItemTypeSName)];
                view.SetColumnError(column, BSMessage.BSM000010);
            }
        }
コード例 #10
0
 private void gridView1_ValidateRow(object sender, ValidateRowEventArgs e)
 {
     gridView1.ClearColumnErrors();
     DataRowView CurrentRow = (DataRowView)e.Row;
     CurrentRow.Row["HC"] = Convert.ToInt32(CurrentRow.Row["HT"]) + Convert.ToInt32(CurrentRow.Row["HP"]);
     for (int nColumn = 0; nColumn < CurrentRow.Row.ItemArray.Length; nColumn++)
     {
         if (CurrentRow.Row[nColumn].ToString() == "")
         {
             e.Valid = false;
             XtraMessageBox.Show(gridView1.Columns[nColumn].ToString() + " no debe estar vacio", "Error de Captura", MessageBoxButtons.OK, MessageBoxIcon.Error);
             gridView1.SetColumnError(gridView1.Columns[nColumn], "Este Campo no debe ser vacio");
             return;
         }
     }
     for (int nRow = 0; nRow < tabla.Rows.Count; nRow++)
     {
         if (CurrentRow.Row["Clave"].ToString() == tabla.Rows[nRow].ItemArray[1].ToString() && CurrentRow.IsNew)
         {
             e.Valid = false;
             XtraMessageBox.Show("Ya existe esta clave", "Error de Captura", MessageBoxButtons.OK, MessageBoxIcon.Error);
             gridView1.SetColumnError(gridView1.Columns["Clave"], "No debe de haber claves repetidas");
             return;
         }
     } 
 }
コード例 #11
0
        private void GridViewEvent_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            var gridView = sender as GridView;

            if (gridView == null)
            {
                return;
            }

            var tbl = StaticReference.GetTableByFullName(gridView.Tag as string);

            if (tbl != null)
            {
                // var page = GetTabPageByFilename();
                var page = GetTabPageByFilename(tbl.FullName);
                if (null != page)
                {
                    if (!page.Text.Contains("(*)"))
                    {
                        page.Text += "(*)";
                    }
                }

                tbl.Altered = true;
            }
        }
コード例 #12
0
 private void gridView1_ValidateRow(object sender, ValidateRowEventArgs e)
 {
     gridView1.ClearColumnErrors();
     DataRowView CurrentRow = (DataRowView)e.Row;
     for (int nColumn = 0; nColumn < CurrentRow.Row.ItemArray.Length; nColumn++)
     {
         if (CurrentRow.Row[nColumn].ToString() == "")
         {
             e.Valid = false;
             XtraMessageBox.Show(gridView1.Columns[nColumn].ToString() + " no debe estar vacio", "Error de Captura", MessageBoxButtons.OK, MessageBoxIcon.Error);
             gridView1.SetColumnError(gridView1.Columns[nColumn], "Este Campo no debe ser vacio");
             return;
         }
         if (gridView1.Columns[nColumn].Name == "colPeriodos"||gridView1.Columns[nColumn].Name == "colMateria")
         {
             if (!IsNumeric(CurrentRow.Row[nColumn]))
             {
                 e.Valid = false;
                 XtraMessageBox.Show(gridView1.Columns[nColumn].ToString() + " debe ser Numerico", "Error de Captura", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 gridView1.SetColumnError(gridView1.Columns[nColumn], "Este campo debe ser Numerico");
                 return;
             }
         }                
     }
     for (int nRow = 0; nRow < tabla.Rows.Count; nRow++)
     {
         if (CurrentRow.Row[0].ToString() == tabla.Rows[nRow].ItemArray[0].ToString() && CurrentRow.IsNew)
         {
             e.Valid = false;
             XtraMessageBox.Show("Especialidad no debe estar Repetido", "Error de Captura", MessageBoxButtons.OK, MessageBoxIcon.Error);
             gridView1.SetColumnError(gridView1.Columns["Nombre"], "Este Campo no debe estar Repetido");
             return;
         }
     }       
 }
コード例 #13
0
        public void OnValidateRow(object sender, ValidateRowEventArgs e)
        {
            string lotno = gridView.GetRowCellValue(e.RowHandle, colLotNo).ToString();

            if (String.IsNullOrEmpty(lotno))
            {
                e.ErrorText = "Art# 不能为空. ";
                e.Valid     = false;
                return;
            }

            if (FindLotNo(lotno) == false)
            {
                e.ErrorText = "Art# 不存在. ";
                e.Valid     = false;
                return;
            }

            if (IsLotNoExist(lotno, e.RowHandle) == true)
            {
                e.ErrorText = "Art# 已存在. ";
                e.Valid     = false;
                return;
            }
            bEdit = true;
        }
コード例 #14
0
        private void onValidatingRow(object sender, ValidateRowEventArgs e)
        {
            if (!dataAvailable())
            {
                return;
            }
            if (ValidationMode == ValidationMode.LeavingCell)
            {
                return;
            }

            //notify error for all validatable columns, either bound or not
            foreach (var columnBinder in allValidatableColumns())
            {
                var cell = retrieveCellFromRowHandle(columnBinder.ColumnName, e.RowHandle);
                if (cell.HasInvalidHandles())
                {
                    continue;
                }
                var notification = columnBinder.Validate(cell.Source);
                if (notification.HasError())
                {
                    e.Valid = false;
                }
                GridView.SetColumnError(xtraColumnFor(columnBinder), notification.ErrorNotification);
            }
        }
コード例 #15
0
        protected override void detailView_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            RequestViewModel model;
            GridView         detailView = sender as GridView;

            detailView.ClearColumnErrors();
            GridColumn colFixAddress       = detailView.Columns[nameof(model.FixAddress)];
            GridColumn colContact          = detailView.Columns[nameof(model.Contact)];
            GridColumn colPhone            = detailView.Columns[nameof(model.Phone)];
            GridColumn colFixingFinishDate = detailView.Columns[nameof(model.FixingFinishDate)];
            GridColumn colFixingDays       = detailView.Columns[nameof(model.FixingDays)];
            GridColumn colFixingPrice      = detailView.Columns[nameof(model.FixingPrice)];
            var        fixAddress          = detailView.GetRowCellValue(e.RowHandle, colFixAddress);
            var        contact             = detailView.GetRowCellValue(e.RowHandle, colContact);
            var        phone            = detailView.GetRowCellValue(e.RowHandle, colPhone);
            var        fixingFinishDate = detailView.GetRowCellValue(e.RowHandle, colFixingFinishDate);
            var        fixingDays       = detailView.GetRowCellValue(e.RowHandle, colFixingDays);
            var        fixingPrice      = detailView.GetRowCellValue(e.RowHandle, colFixingPrice);

            if (fixAddress == null)
            {
                e.Valid = false;
                detailView.SetColumnError(colFixAddress, "请输入维修地址");
            }
            if (contact == null)
            {
                e.Valid = false;
                detailView.SetColumnError(colContact, "请输入联系人");
            }
            if (phone == null)
            {
                e.Valid = false;
                detailView.SetColumnError(colPhone, "请输入联系人电话");
            }
        }
コード例 #16
0
        private void AccountGroup_GridView_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            //AccountGroup_GridView.ClearColumnErrors();

            //AccountGroup row = e.Row.CastTo<AccountGroup>();
            //GridView view = sender as GridView;
            //GridColumn column;

            //if (AccountGroup_GridView.IsNewItemRow(e.RowHandle))
            //{
            //    string accountGroupID = row.AccountGroupID;

            //    // Kiểm tra tồn tại trong grid
            //    if (AccountGroupData.ToList().Count(o => o.AccountGroupID == accountGroupID) > 1)
            //    {
            //        e.Valid = false;
            //        column = view.Columns[nameof(row.AccountGroupID)];
            //        view.SetColumnError(column, BSMessage.BSM000015);
            //    }
            //}

            //if (string.IsNullOrEmpty(row.AccountGroupName))
            //{
            //    e.Valid = false;
            //    column = view.Columns[nameof(row.AccountGroupName)];
            //    view.SetColumnError(column, BSMessage.BSM000011);
            //}
        }
コード例 #17
0
        private void ValidateNumberData(ref object sender, ref ValidateRowEventArgs e,
                                        string colName, string errorMessage, bool hasTrue = false)
        {
            GridView   view   = (GridView)sender;
            GridColumn column = view.Columns[colName];

            if (view.GetRowCellValue(e.RowHandle, column) is DBNull ||
                (view.GetRowCellValue(e.RowHandle, column) == null) ||
                (view.GetRowCellValue(e.RowHandle, column).ToString().Trim().Length <= 0)
                )
            {
                e.Valid = false;
                view.SetColumnError(column, errorMessage);
            }
            else
            {
                try
                {
                    double grade = Convert.ToDouble(view.GetRowCellValue(e.RowHandle, column).ToString());
                    e.Valid = true;
                    view.SetColumnError(column, "Please enter a number");
                }
                catch (Exception ex)
                {
                    e.Valid = false;
                }
            }
        }
コード例 #18
0
        private void gridView2_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            DataRowView rowdata = e.Row as DataRowView;

            if (rowdata == null)
            {
                return;
            }

            if (rowdata["CB021"] is System.DBNull)
            {
                e.ErrorText = "请选择项目!";
                e.Valid     = false;
                return;
            }
            else if (rowdata["CB030"] is System.DBNull)
            {
                e.ErrorText = "请输入数量!";
                e.Valid     = false;
                return;
            }
            else if (decimal.Parse(rowdata["CB030"].ToString()) <= 0)
            {
                e.ErrorText = "数量必须大于0!";
                e.Valid     = false;
                return;
            }
        }
コード例 #19
0
        public void OnValidateRow(object sender, ValidateRowEventArgs e)
        {
            string lotno = gridView.GetRowCellValue(e.RowHandle, colLotNo).ToString();

            if (String.IsNullOrEmpty(lotno))
            {
                e.ErrorText = "Art# Column can not be empty. ";
                e.Valid     = false;
                return;
            }
            if (FindLotNo(lotno) == false)
            {
                e.ErrorText = "Art# does not exist. ";
                e.Valid     = false;
                return;
            }

            if (IsLotNoExist(lotno, e.RowHandle) == true)
            {
                e.ErrorText = "Art# already exists. ";
                e.Valid     = false;
                return;
            }

            if (ValidRowQuantity(e.RowHandle) == false)
            {
                e.ErrorText = "出库数量大于库存量. ";
                e.Valid     = false;
                return;
            }
        }
コード例 #20
0
 private void gridView1_ValidateRow(object sender, ValidateRowEventArgs e)
 {
     if (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "SI003") == null)
     {
         e.Valid = false;
         (sender as ColumnView).SetColumnError(gridView1.Columns["SI003"], "名称不能为空!");
     }
 }
コード例 #21
0
ファイル: Frm_Invoice.cs プロジェクト: thomassamoul/POS
 private void GridView1_ValidateRow(object sender, ValidateRowEventArgs e)
 {
     if (!(e.Row is DAL.InvoiceDetail row) || row.ItemID == 0)
     {
         e.Valid = false;
         return;
     }
 }
コード例 #22
0
ファイル: DataDict.cs プロジェクト: radtek/Lime
 /// <summary>
 /// 行校验
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void gridView1_ValidateRow(object sender, ValidateRowEventArgs e)
 {
     if (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ST003") == null || string.IsNullOrEmpty(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ST003").ToString()))
     {
         e.Valid = false;
         (sender as ColumnView).SetColumnError(gridView1.Columns["ST003"], "数据项不能为空!");
     }
 }
コード例 #23
0
ファイル: FrmConstant.cs プロジェクト: 15831944/winform-1
        private void gridView1_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            ClearValidate();

            ValidateData();

            InitView();
        }
コード例 #24
0
ファイル: ServiceCommodity.cs プロジェクト: anrk0451/White
 /// <summary>
 /// 行验证
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void gridView2_ValidateRow(object sender, ValidateRowEventArgs e)
 {
     //string value = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "SI003").ToString();
     if (gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "GI003") == null)
     {
         e.Valid = false;
         (sender as ColumnView).SetColumnError(gridView2.Columns["GI003"], "名称不能为空!");
     }
 }
コード例 #25
0
        public static void ValidateRow(object sender, ValidateRowEventArgs e, GridControl grid)
        {
            ColumnView currentView = (ColumnView)sender;

            e.Valid = (
                CodeIsValid(currentView, e) &&
                IsNotDuplicateCode(currentView, e)
                );
        }
コード例 #26
0
 private void ViewStudents_ValidateRow(object sender, ValidateRowEventArgs e)
 {
     ValidateNumberData(ref sender, ref e, "StudNum", "Please enter a number", false);
     // ValidateRequiredFields(ref sender, ref e, "StudNum", "Please enter  the student number", false);
     ValidateRequiredFields(ref sender, ref e, "FName", "Please enter  the firstname", false);
     ValidateRequiredFields(ref sender, ref e, "LName", "Please enter  the lastname", false);
     ValidateRequiredFields(ref sender, ref e, "Section", "Please enter  section", false);
     ValidateRequiredFields(ref sender, ref e, "CourseID", "Please select course", false);
 }
コード例 #27
0
        private void grvDetails_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            var item = e.Row as Logic.Entities.OrderDetailModel;

            if (item.Quantity <= 0)
            {
                e.ErrorText = "Quantity must be greater than 0";
                e.Valid     = false;
            }
        }
コード例 #28
0
        public static void ValidateDuplicate(this GridView view, GridColumn NameColumn, List<string> duplicates, ValidateRowEventArgs e)
        {
            if (duplicates.Count > 0)
            {
                view.SetColumnError(NameColumn,
                    Program.LanguageManager.GetString(StringResources.Settings_UniqueValueRequired));
                e.Valid = false;
            }

        }
コード例 #29
0
        private void GridValidateRow(object sender, ValidateRowEventArgs e)
        {
            var row = e.Row as invoices_details;

            if (row == null || row.itemid == 0)
            {
                e.Valid = false;
                return;
            }
        }
コード例 #30
0
ファイル: Roles.cs プロジェクト: anrk0451/White
        private void gridView1_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            string value = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "RO003").ToString();

            if (String.IsNullOrEmpty(value))
            {
                e.Valid = false;
                (sender as ColumnView).SetColumnError(gridView1.Columns["RO003"], "角色名称不能为空!");
            }
        }
コード例 #31
0
        private void inspectionHistoryGridView_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            GridView             view       = sender as GridView;
            InspectionTestResult inspection = view.GetRow(view.FocusedRowHandle) as InspectionTestResult;

            if (inspection.Status != PartInspectionStatus.Pending && inspection.Inspectors.Count <= 0)
            {
                ValidateInspection(inspectionHistoryGridView, inspectorsGridColumn.Name.ToString(), e);
            }
        }
コード例 #32
0
 private void gridViewDetail_ValidateRow(object sender, ValidateRowEventArgs e)
 {
     try
     {
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.ToString(),
                             ResourceHelper.GetResourceValueByName("ResExceptionCaption"), MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #33
0
        public static void ValidateRow(object sender, ValidateRowEventArgs e, GridControl grid)
        {
            ColumnView currentView = (ColumnView)sender;

            e.Valid = (
                IsNotDuplicateAreaLabel(currentView, e) &&
                IsNotPreProcessAreaAndLocatorControlled(currentView, e) &&
                SectionHasBays(currentView, e) &&
                BayHasShelves(currentView, e)
                );
        }
コード例 #34
0
 private void grwUnitList_ValidateRow(object sender, ValidateRowEventArgs e)
 {
     foreach (GridColumn col in grwUnitList.Columns)
     {
         if (grwUnitList.GetColumnError(col) != string.Empty &&
             grwUnitList.GetColumnErrorType(col) == ErrorType.Critical)
         {
             e.Valid = false;
             return;
         }
     }
 }
コード例 #35
0
        public static void ValidateNotEmpty(this GridView view, GridColumn NameColumn, ValidateRowEventArgs e)
        {
            string Name = (string)view.GetRowCellValue(e.RowHandle, NameColumn);

            if (String.IsNullOrWhiteSpace(Name))
            {
                view.SetColumnError(NameColumn,
                   Program.LanguageManager.GetString(StringResources.Settings_ValueRequired));
                e.Valid = false;
            }

        }
コード例 #36
0
ファイル: BookingView.cs プロジェクト: Niedda/ImpressioEf
        private void viewAppointment_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            var appointment = e.Row as Appointment;

              if (appointment != null)
              {
            viewAppointment.SetColumnError(colDateTimeApp, appointment.DateTime > DateTime.MinValue ? "" : "Bitte ein gültiges Datum definieren");
            viewAppointment.SetColumnError(colFkAppointmentType, appointment.FkAppointmentType != 0 ? "" : "Bitte einen Termintyp definieren");
            appointment.FkBooking = Booking.BookingId;
              }
              e.Valid = !viewAppointment.HasColumnErrors;
        }
コード例 #37
0
 private void gridView1_ValidateRow(object sender, ValidateRowEventArgs e)
 {
     gridView1.ClearColumnErrors();
     DataRowView CurrentRow = (DataRowView)e.Row;
     for (int nColumn = 0; nColumn < CurrentRow.Row.ItemArray.Length; nColumn++)
     {
         if (CurrentRow.Row[nColumn].ToString() == "" && nColumn!=0)
         {
             e.Valid = false;
             XtraMessageBox.Show(gridView1.Columns[nColumn].ToString() + " no debe estar vacio", "Error de Captura", MessageBoxButtons.OK, MessageBoxIcon.Error);
             gridView1.SetColumnError(gridView1.Columns[nColumn], "Este Campo no debe ser vacio");
             return;
         }
     }            
 }
コード例 #38
0
        public static void ValidateCertificate(this GridView view, GridColumn certificateNumber, GridColumn certificateDate, ValidateRowEventArgs e)
        {
            string number = (string)view.GetRowCellValue(e.RowHandle, certificateNumber);
            DateTime date = (DateTime)view.GetRowCellValue(e.RowHandle, certificateDate);

            if (String.IsNullOrWhiteSpace(number))
            {
                view.SetColumnError(certificateNumber,
                    Program.LanguageManager.GetString(StringResources.Settings_ValueRequired));
                e.Valid = false;
            }

            if (date == DateTime.MinValue)
            {
                view.SetColumnError(certificateDate,
                   Program.LanguageManager.GetString(StringResources.Settings_ValueRequired));
                e.Valid = false;
            }
        }
コード例 #39
0
        public static void ValidatePersonName(this GridView view, GridColumn firstNameColumn, GridColumn lastNameColumn, ValidateRowEventArgs e)
        {
            string firstName = (string)view.GetRowCellValue(e.RowHandle, firstNameColumn);
            string lastName = (string)view.GetRowCellValue(e.RowHandle, lastNameColumn);

            if (String.IsNullOrWhiteSpace(firstName))
            {
                view.SetColumnError(firstNameColumn,
                    Program.LanguageManager.GetString(StringResources.Settings_ValueRequired));
                e.Valid = false;
            }

            if (String.IsNullOrWhiteSpace(lastName))
            {
                view.SetColumnError(lastNameColumn,
                   Program.LanguageManager.GetString(StringResources.Settings_ValueRequired));
                e.Valid = false;
            }
        }
コード例 #40
0
        private void inspectionView_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            GridView gv = sender as GridView;
            PipeTest pipeTest = gv.GetRow(e.RowHandle) as PipeTest;
            if (!pipeTest.IsReadyToUse)
            {
                controlOperationValidate = false;
                e.Valid = false;

                if (pipeTest.Category == null)
                {
                    gv.SetColumnError(categoryColumn,
                        Program.LanguageManager.GetString(StringResources.Settings_ValueRequired));
                }
                else if (string.IsNullOrWhiteSpace(pipeTest.Name))
                {
                    gv.SetColumnError(inspectionNameGridColumn,
                        Program.LanguageManager.GetString(StringResources.Settings_ValueRequired));
                }
                else if (pipeTest.ResultType == PipeTestResultType.Undefined)
                {
                    gv.SetColumnError(resultTypeGridColumn,
                        Program.LanguageManager.GetString(StringResources.Settings_ValueRequired));
                }
                else if (pipeTest.ControlType == PipeTestControlType.Undefined)
                {
                    gv.SetColumnError(controlTypeGridColumn,
                        Program.LanguageManager.GetString(StringResources.Settings_ValueRequired));
                }
                else
                {
                    gv.SetColumnError(inspectionCodeGridColumn,
                    Program.LanguageManager.GetString(StringResources.Settings_ValueRequired));
                }
            }
        }
コード例 #41
0
        private void gridViewUsers_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            GridView view = sender as GridView;
            view.ClearColumnErrors();
            gridViewUsers.ValidatePersonName(colFirstName, colLastName, e);

            if (view.IsValidRowHandle(e.RowHandle))
            {
                User user = view.GetRow(e.RowHandle) as User;
                if (String.IsNullOrWhiteSpace(user.Login))
                {
                    view.SetColumnError(colLogin,
                        Program.LanguageManager.GetString(StringResources.Settings_ValueRequired));
                    e.Valid = false;
                    return;
                }
                if (String.IsNullOrWhiteSpace(user.PasswordHash))
                {
                    view.SetColumnError(colUserPass,
                   Program.LanguageManager.GetString(StringResources.Settings_ValueRequired));
                    e.Valid = false;
                    return;
                }
            }

            DuplicatesList l = findDuplicateList[gridViewUsers];
            List<string> loginDuplicates = l.Method(gridViewUsers);
            gridViewUsers.ValidateDuplicate(colLogin, loginDuplicates, e);
        }
コード例 #42
0
        private void gridViewRole_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            var view = sender as GridView;
            view.ClearColumnErrors();

            gridViewRole.ValidateNotEmpty(colRoleSetupName, e);

            roleValidate = e.Valid;
        }
コード例 #43
0
        void ValidateCertificate(GridView view, GridColumn certNameColumn, GridColumn expDateColumn, ValidateRowEventArgs e)
        {
            string certName = (string)view.GetRowCellValue(e.RowHandle, certNameColumn);
            DateTime? certExpDate = (DateTime?)view.GetRowCellValue(e.RowHandle, expDateColumn);

            view.ClearColumnErrors();

            if (string.IsNullOrWhiteSpace(certName))
            {
                view.SetColumnError(certNameColumn, Program.LanguageManager.GetString(StringResources.Settings_ValueRequired));
                e.Valid = false;
            }
        }
コード例 #44
0
        private void inspectorCertificateGridView_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            GridView view = sender as GridView;
            view.ClearColumnErrors();

            inspectorCertificateGridView.ValidateCertificate(inspectorCertificateNumberCol, inspectorCertificateExpirationCol, e);

            inspectorsCertificateValidate = e.Valid;
        }
コード例 #45
0
        private void gridViewWelders_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            GridView view = sender as GridView;
            view.ClearColumnErrors();

            gridViewWelders.ValidatePersonName(colWelderFirstName, colWelderLastName, e);

            gridViewWelders.ValidateCertificate(colWelderCert, colWelderCertExp, e);

            weldersValidate = e.Valid;
        }
コード例 #46
0
        private void pipesSizeListGridView_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            GridView view = sender as GridView;
            view.ClearColumnErrors();

            pipesSizeListGridView.ValidateNotEmpty(pipeSizeGridColumn, e);

            if (viewModel.CurrentProjectSettings != null && viewModel.IsMill)
            {
                DuplicatesList l = findDuplicateList[pipesSizeListGridView];
                List<string> pipeSizesDuplicates = l.Method(pipesSizeListGridView);
                pipesSizeListGridView.ValidateDuplicate(pipeSizeGridColumn, pipeSizesDuplicates, e);
            }

            pipesSizeValidate = e.Valid;
        }
コード例 #47
0
        private void certificateTypesView_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            GridView view = sender as GridView;
            view.ClearColumnErrors();

            certificateTypesView.ValidateNotEmpty(certificateNameColumn, e);

            DuplicatesList l = findDuplicateList[certificateTypesView];
            List<string> certificateDuplicate = l.Method(certificateTypesView);
            certificateTypesView.ValidateDuplicate(certificateNameColumn, certificateDuplicate, e);

            inspectorsCertificateTypeValidate = e.Valid;
        }
コード例 #48
0
 private void ViewDetailValidateRow(object sender, ValidateRowEventArgs e)
 {
     e.Valid = ValidateDetailRow();
 }
コード例 #49
0
ファイル: FormNewQaQc.cs プロジェクト: khoattn/LimsProject
        private void bgvBatchCalc2_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            CTemplate_method_aa oTemplate_method_aa = new CTemplate_method_aaFactory().GetByPrimaryKey(new CTemplate_method_aaKeys(Idtemplate_method));

            GridView view = sender as GridView;

            if (!Convert.ToBoolean(bgvBatchCalc2.GetFocusedRowCellValue(gv2col_Flag_dila1)) &&
                Convert.ToBoolean(bgvBatchCalc2.GetFocusedRowCellValue(gv2col_Flag_dilb1)))
            {
                e.Valid = false;
                view.SetColumnError(gv2col_Flag_dila1, "Selección de diluciones mal efectuada.");
                view.SetColumnError(gv2col_Flag_dilb1, "Selección de diluciones mal efectuada.");
            }
        }
コード例 #50
0
 private void inspectionHistoryGridView_ValidateRow(object sender, ValidateRowEventArgs e)
 {
     GridView view = sender as GridView;
     InspectionTestResult inspection = view.GetRow(view.FocusedRowHandle) as InspectionTestResult;
     if(inspection.Status != PartInspectionStatus.Pending && inspection.Inspectors.Count <= 0)
     {
         ValidateInspection(inspectionHistoryGridView, inspectorsGridColumn.Name.ToString(), e);
     }
 }
コード例 #51
0
        private void ValidateInspection(GridView view, string NameColumn, ValidateRowEventArgs e)
        {
            string Name = (string)view.GetRowCellValue(e.RowHandle, NameColumn);

            view.ClearColumnErrors();

            if(String.IsNullOrEmpty(Name))
            {
                view.SetColumnError(inspectorsGridColumn,
                   Program.LanguageManager.GetString(StringResources.SelectInspectorsForTestResult));
                e.Valid = false;
            }
        }
コード例 #52
0
        private void categoriesGridView_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            GridView view = sender as GridView;
            view.ClearColumnErrors();

            categoriesGridView.ValidateNotEmpty(categoryNameColumn, e);

            DuplicatesList l = findDuplicateList[categoriesGridView];
            List<string> categoriesDuplicates = l.Method(categoriesGridView);
            categoriesGridView.ValidateDuplicate(categoryNameColumn, categoriesDuplicates, e);

            categoriesValidate = e.Valid;
        }
コード例 #53
0
 public void gridView_ValidateRow(object sender, ValidateRowEventArgs e)
 {
     GridView grid = ((GridView)sender);
     DataRow row = grid.GetDataRow(e.RowHandle);
     grid.ClearColumnErrors();
     if (this.tableName == null)
     {
         Error.ClearErrors();
         GUIValidation.ShowRequiredError(Error,
             new object[]{
                 LoaiCongViec, "Loại công việc",
             }
         );
         e.Valid = false;
         this.Tag = false;
         return;
     }
     else if (!DABangTheoDoi.Instance.ValidateDetail(row, tableName))
     {
         e.Valid = false;
         this.Tag = false;
         return;
     }
     PLValidation.CheckDuplicate(grid, this.GridDataSet, e, this.tableName);
     if (!e.Valid)
     {
         e.Valid = false;
         this.Tag = false;
         return;
     }
     e.Valid = true;
     this.Tag = true;
     if (row["DTD_ID"].ToString() == "")
         row["DTD_ID"] = HelpDB.getDatabase().GetID("G_NGHIEP_VU");
     row["BTD_ID"] = this.doBangTheoDoi.BTD_ID;
     row["LCV_ID"] = this.LoaiCongViec._getSelectedID();
     row["NGUOI_CAP_NHAT"] = FrameworkParams.currentUser.employee_id;
     row["NGAY_CAP_NHAT"] = DateTime.Now;
 }
コード例 #54
0
        private void seamTypeGridView_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            GridView view = sender as GridView;
            view.ClearColumnErrors();

            seamTypeGridView.ValidateNotEmpty(seamTypeColumn, e);

            if (viewModel.CurrentProjectSettings != null && viewModel.IsMill)
            {
                DuplicatesList l = findDuplicateList[seamTypeGridView];
                List<string> seemTypeDuplicates = l.Method(seamTypeGridView);
                seamTypeGridView.ValidateDuplicate(seamTypeColumn, seemTypeDuplicates, e);
            }

            seamTypesValidate = e.Valid;
        }
コード例 #55
0
ファイル: BookingView.cs プロジェクト: Niedda/ImpressioEf
 private void viewBookingPosition_ValidateRow(object sender, ValidateRowEventArgs e)
 {
     if (ActiveBookingPosition != null)
       {
     viewBookingPosition.SetColumnError(colName, String.IsNullOrEmpty(ActiveBookingPosition.Name) ? "Bitte einen Namen definieren" : "");
       }
       e.Valid = !viewBookingPosition.HasColumnErrors;
 }
コード例 #56
0
        private void componentryTypeGridView_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            GridView view = sender as GridView;
            view.ClearColumnErrors();

            componentryTypeGridView.ValidateNotEmpty(typeColumn, e);

            if (viewModel.CurrentProjectSettings != null && viewModel.IsMill)
            {
                DuplicatesList l = findDuplicateList[componentryTypeGridView];
                List<string> componentryTypeDuplicates = l.Method(componentryTypeGridView);
                componentryTypeGridView.ValidateDuplicate(typeColumn, componentryTypeDuplicates, e);
            }

            componentryTypeValidate = e.Valid;
        }
コード例 #57
0
        private void jointsOperationsGridView_ValidateRow(object sender, ValidateRowEventArgs e)
        {
            GridView view = sender as GridView;
            view.ClearColumnErrors();
            jointsOperationsGridView.ValidateNotEmpty(nameGridColumn, e);

            jointsOperationsValidate = e.Valid;
        }
コード例 #58
0
 private void LayoutView_ValidateRow(object sender, ValidateRowEventArgs e) {
 }
コード例 #59
0
 private void Grid_ValidateRow(object sender, ValidateRowEventArgs e)
 {
     ColumnView clview = (ColumnView)sender;
     GridColumn clTentailieu = clview.Columns["TEN_TAI_LIEU"];
     GridColumn clTenfile = clview.Columns["DATA_ID"];
     e.Valid = true;
     if (clview.GetRowCellValue(e.RowHandle, clTentailieu).ToString() == "")
     {
         e.Valid = false;
         clview.SetColumnError(clTentailieu, "Vui lòng vào thông tin 'Tên tài liệu'.");
     }
     if (clview.GetRowCellValue(e.RowHandle, clTenfile).ToString() == "")
     {
         e.Valid = false;
         clview.SetColumnError(clTenfile, "Vui lòng chọn 'Tên file'.");
     }
     if (this.cotFile._currentDONoiDungTaiLieu == null)
     {
         e.Valid = false;
         clview.SetColumnError(clTenfile, "Vui lòng chọn 'Tên file'.");
     }
     if (e.Valid == true)
     {
         //DOTaiLieu _doTailieu = null;
         //if (this._IsAdd == true)
         //{
         //    _doTailieu = new DOTaiLieu(HelpNumber.ParseInt64(grdThongtinTL.Grid.GetRowCellValue(grdThongtinTL.Grid.FocusedRowHandle, grdThongtinTL.Grid.Columns["ID"]).ToString()),
         //                                    grdThongtinTL.Grid.GetRowCellValue(grdThongtinTL.Grid.FocusedRowHandle, grdThongtinTL.Grid.Columns["TEN_TAI_LIEU"]).ToString(),
         //                                    grdThongtinTL.Grid.GetRowCellValue(grdThongtinTL.Grid.FocusedRowHandle, grdThongtinTL.Grid.Columns["PHIEN_BAN"]).ToString(),
         //                                    grdThongtinTL.Grid.GetRowCellValue(grdThongtinTL.Grid.FocusedRowHandle, grdThongtinTL.Grid.Columns["MO_TA"]).ToString(),
         //                                    HelpNumber.ParseInt64(grdThongtinTL.Grid.GetRowCellValue(grdThongtinTL.Grid.FocusedRowHandle, grdThongtinTL.Grid.Columns["LOAI_TAI_LIEU_ID"]).ToString()),
         //                                    "Y",
         //                                    FrameworkParams.currentUser.employee_id, DateTime.Now, FrameworkParams.currentUser.employee_id, DateTime.Now, this.cotFile._currentDONoiDungTaiLieu.ID);
         //    DMTaiLieu.setRowCellDefaultValue(grdThongtinTL.Grid.GetDataRow(grdThongtinTL.Grid.FocusedRowHandle), _doTailieu);
         //    cotFile.Insert();
         //}
         //else if (this._IsAdd == false)
         //{
         //    _doTailieu = new DOTaiLieu(HelpNumber.ParseInt64(grdThongtinTL.Grid.GetRowCellValue(grdThongtinTL.Grid.FocusedRowHandle, grdThongtinTL.Grid.Columns["ID"]).ToString()),
         //                                    grdThongtinTL.Grid.GetRowCellValue(grdThongtinTL.Grid.FocusedRowHandle, grdThongtinTL.Grid.Columns["TEN_TAI_LIEU"]).ToString(),
         //                                    grdThongtinTL.Grid.GetRowCellValue(grdThongtinTL.Grid.FocusedRowHandle, grdThongtinTL.Grid.Columns["PHIEN_BAN"]).ToString(),
         //                                    grdThongtinTL.Grid.GetRowCellValue(grdThongtinTL.Grid.FocusedRowHandle, grdThongtinTL.Grid.Columns["MO_TA"]).ToString(),
         //                                    HelpNumber.ParseInt64(grdThongtinTL.Grid.GetRowCellValue(grdThongtinTL.Grid.FocusedRowHandle, grdThongtinTL.Grid.Columns["LOAI_TAI_LIEU_ID"]).ToString()),
         //                                    "Y",
         //                                    HelpNumber.ParseInt64(grdThongtinTL.Grid.GetRowCellValue(grdThongtinTL.Grid.FocusedRowHandle, grdThongtinTL.Grid.Columns["NGUOI_GUI"]).ToString()),
         //                                    Convert.ToDateTime(grdThongtinTL.Grid.GetRowCellValue(grdThongtinTL.Grid.FocusedRowHandle, grdThongtinTL.Grid.Columns["NGAY_GUI"]).ToString()),
         //                                    FrameworkParams.currentUser.employee_id, DateTime.Now, this.cotFile._currentDONoiDungTaiLieu.ID);
         //    DMTaiLieu.setRowCellDefaultValue(grdThongtinTL.Grid.GetDataRow(grdThongtinTL.Grid.FocusedRowHandle), _doTailieu);
         //    cotFile.Update();
         //}
     }
 }
        private void GridSelectedItemsViewOnValidateRow(object sender, ValidateRowEventArgs e)
        {
            var view = sender as GridView;
            view.ClearColumnErrors();

            var manufacturerID = view.GetRowCellDisplayText(e.RowHandle, colManufacturer);
            var quantity = view.GetRowCellDisplayText(e.RowHandle, colQuantity);
            var amount = view.GetRowCellDisplayText(e.RowHandle, colAmount);

            if (string.IsNullOrEmpty(manufacturerID) || manufacturerID.Equals("Select Manufacturer"))
            {
                e.Valid = false;
                view.SetColumnError(colManufacturer, @"Manufacturer is empty");
            }

            if (string.IsNullOrEmpty(quantity))
            {
                e.Valid = false;
                view.SetColumnError(colQuantity, @"Quantity is empty");
            }
            else if (Convert.ToDecimal(quantity) < 0)
            {
                e.Valid = false;
                view.SetColumnError(colQuantity, @"Quantity is negative");
            }

            if (string.IsNullOrEmpty(amount))
            {
                e.Valid = false;
                view.SetColumnError(colAmount, @"Amount is empty");
            }
            else if (Convert.ToDecimal(amount) < 0)
            {
                e.Valid = false;
                view.SetColumnError(colAmount, @"Amount is negative");
            }
        }