public static void InitData(databases.baseDS.sysCodeRow row) { row.category = ""; row.code = ""; row.description1 = ""; row.isSystem = false; row.isVisible = true; }
public override void AddNew(string code) { this.AddNewRow(); databases.baseDS.sysCodeRow row = (databases.baseDS.sysCodeRow)((DataRowView)sysCodeSource.Current).Row; if (row == null) { return; } databases.AppLibs.InitData(row); row.code = code; row.category = this.categoryCb.SelectedValue.ToString(); }
protected override void RemoveCurrent() { this.ShowMessage(""); if (myMasterSource.Current == null) { return; } databases.baseDS.sysCodeRow row = (databases.baseDS.sysCodeRow)(myMasterSource.Current as DataRowView).Row; if (row.HasVersion(DataRowVersion.Original)) { DataAccess.Libs.DeleteData(row); } myMasterSource.RemoveCurrent(); this.ShowMessage(Languages.Libs.GetString("dataWasDeleted")); }
protected override bool BeforeDelete() { if (myMasterSource.Current == null) { return(false); } if (!base.BeforeDelete()) { return(false); } databases.baseDS.sysCodeRow row = (databases.baseDS.sysCodeRow)(myMasterSource.Current as DataRowView).Row; if (row.isSystem) { common.system.ShowErrorMessage(Languages.Libs.GetString("cannotDelete")); return(false); } return(true); }