private void OnActionEnd(object sender, ABCStandardEventArg arg) { if (ActionEndEvent != null) { ActionEndEvent(sender, arg); } }
public virtual void OnAddComment(CommentObject comment, ABCStandardEventArg e) { if (this.AddCommentEvent != null) { this.AddCommentEvent(comment, e); } }
public void AddComment(String strComment) { if (String.IsNullOrWhiteSpace(strComment)) { return; } ABCStandardEventArg arg = new ABCStandardEventArg(); OnAddComment(new CommentObject(this.TableName, ObjectID, strComment, Tags, TagsDisplay), arg); if (arg.Cancel) { return; } AddComment(this.TableName, ObjectID, strComment); }
void GridControl_BarItemClick(object sender, string strTag) { ABCStandardEventArg arg = new ABCStandardEventArg(strTag); OnActionStart(sender, arg); if (arg.Cancel) { return; } switch (strTag) { case "Save": DialogResult dlgResult = ABCHelper.ABCMessageBox.Show("Bạn có muốn lưu dữ liệu ? ", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dlgResult == DialogResult.Yes) { if (this.Binding != null) { this.Binding.Save(true, true); } else { ActionSave(true); } } break; case "Refresh": ActionRefresh(); break; case "Delete": ActionRemove(); break; } OnActionEnd(sender, new ABCStandardEventArg(strTag)); }
public void ActionSave(bool isShowWaitingDlg) { if (ChangedItems.Count > 0 && ABCScreenManager.Instance.CheckTablePermission(this.TableName, TablePermission.AllowEdit) == false) { return; } if (RemovedItems.Count > 0 && ABCScreenManager.Instance.CheckTablePermission(this.TableName, TablePermission.AllowDelete) == false) { return; } if (NewItems.Count > 0 && ABCScreenManager.Instance.CheckTablePermission(this.TableName, TablePermission.AllowNew) == false) { return; } if (isShowWaitingDlg) { ABCHelper.ABCWaitingDialog.Show("", "Đang lưu ...."); } List <T> lstDeletings = new List <T>(); List <T> lstUpdatings = new List <T>(); List <T> lstCreatings = new List <T>(); #region Init foreach (T objT in RemovedItems.Values) { lstDeletings.Add(objT); } foreach (Guid iID in ChangedItems) { BusinessObject objT = GetItemByID(iID); if (objT != null) { BusinessObjectHelper.SetAutoValue(objT); lstUpdatings.Add((T)objT); } } foreach (int iIndex in NewItems) { BusinessObjectHelper.SetDefaultValue(this[iIndex]); BusinessObjectHelper.SetAutoValue(this[iIndex]); Guid iID = BusinessObjectHelper.GetIDValue(this[iIndex]); if (iID == Guid.Empty) { lstCreatings.Add(this[iIndex]); } else { lstUpdatings.Add(this[iIndex]); } } #endregion ABCStandardEventArg arg = new ABCStandardEventArg(); OnSaving(this, ref lstDeletings, ref lstUpdatings, ref lstCreatings, arg); if (arg.Cancel) { return; } foreach (T objT in lstDeletings) { DeleteItem(objT); } foreach (T objT in lstUpdatings) { Controller.UpdateObject(objT); } foreach (T objT in lstCreatings) { Controller.CreateObject(objT); } ClearDetections(); DataCachingProvider.RefreshLookupTable(this.TableName); OnSaved(this, ref lstDeletings, ref lstUpdatings, ref lstCreatings, new ABCStandardEventArg()); if (isShowWaitingDlg) { ABCHelper.ABCWaitingDialog.Close(); } }
private void OnSaved(object sender, ref List <T> lstDeletings, ref List <T> lstUpdatings, ref List <T> lstCreatings, ABCStandardEventArg arg) { if (SavedEvent != null) { SavedEvent(sender, ref lstDeletings, ref lstUpdatings, ref lstCreatings, arg); } }
public void OnAddCommentEvent(ABCComment.CommentObject comment, ABCStandardEventArg e) { }