Пример #1
0
 private void tblView_ValidateRow(object sender, DevExpress.Xpf.Grid.GridRowValidationEventArgs e)
 {
     if (e.Row == null)
     {
         return;
     }
     if (tblView.FocusedColumn.FieldName == colParaName.FieldName.ToString() || tblView.FocusedColumn == colParaName)
     {
         if (e.Value == null || e.Value.ToString() == "")
         {
             e.SetError("Vui lòng nhập đủ thông tin...");
             e.IsValid = false;
             return;
         }
     }
     if (tblView.FocusedColumn.FieldName == colParaVal.FieldName.ToString() || tblView.FocusedColumn == colParaVal)
     {
         if (e.Value == null || e.Value.ToString() == "")
         {
             e.SetError("Vui lòng nhập đủ thông tin...");
             e.IsValid = false;
             return;
         }
     }
 }
        void OnValidateRow(System.Object sender, DevExpress.Xpf.Grid.GridRowValidationEventArgs e)
        {
            var row = (EntityFrameworkIssues.Issues.User)e.Row;

            if (e.IsNewItem)
            {
                _Context.Users.Add(row);
            }
            _Context.SaveChanges();
        }
 void CreateUpdateRow(object sender, DevExpress.Xpf.Grid.GridRowValidationEventArgs e)
 {
     if (e.IsNewItem)
     {
         e.UpdateRowResult = IssuesService.AddNewIssueAsync((IssueData)e.Value);
     }
     else
     {
         e.UpdateRowResult = IssuesService.UpdateRowAsync((IssueData)e.Value);
     }
 }
Пример #4
0
 private void TableView_ValidateRow(object sender, DevExpress.Xpf.Grid.GridRowValidationEventArgs e)
 {
     if (e.Row == null)
     {
         return;
     }
     if (e.RowHandle == DevExpress.Xpf.Grid.GridControl.NewItemRowHandle)
     {
         e.IsValid = true;
         e.Handled = true;
     }
 }
        void OnValidateRow(System.Object sender, DevExpress.Xpf.Grid.GridRowValidationEventArgs e)
        {
            var row     = (EntityFrameworkIssues.Issues.Issue)e.Row;
            var context = new EntityFrameworkIssues.Issues.IssuesContext();

            context.Entry(row).State = e.IsNewItem
                ? EntityState.Added
                : EntityState.Modified;
            try {
                context.SaveChanges();
            } finally {
                context.Entry(row).State = EntityState.Detached;
            }
        }
Пример #6
0
 void OnValidateRow(System.Object sender, DevExpress.Xpf.Grid.GridRowValidationEventArgs e)
 {
     using (var unitOfWork = new DevExpress.Xpo.UnitOfWork()) {
         var item = e.IsNewItem
             ? new XPOIssues.Issues.Issue(unitOfWork)
             : unitOfWork.GetObjectByKey <XPOIssues.Issues.Issue>(_DetachedObjectsHelper.GetKey(e.Row));
         _DetachedObjectsHelper.ApplyProperties(item, e.Row);
         unitOfWork.CommitChanges();
         if (e.IsNewItem)
         {
             _DetachedObjectsHelper.SetKey(e.Row, item.Oid);
         }
     }
 }
Пример #7
0
 private void tblView_ValidateRow(object sender, DevExpress.Xpf.Grid.GridRowValidationEventArgs e)
 {
     if (MTGlobal.MT_CURRENT_ACTION != "ADD" && MTGlobal.MT_CURRENT_ACTION != "EDIT")
     {
         return;
     }
     if (tblViewCT.FocusedColumn.FieldName == colMasp.FieldName.ToString() || tblViewCT.FocusedColumn == colTenSP)
     {
         if (e.Value == null || e.Value.ToString() == "")
         {
             e.SetError("Thông tin không được bỏ trống...");
             e.IsValid = false;
             return;
         }
     }
 }
Пример #8
0
 void OnValidateRow(System.Object sender, DevExpress.Xpf.Grid.GridRowValidationEventArgs e)
 {
     _UnitOfWork.CommitChanges();
 }