public static void InitData(data.baseDS.sysCodeCatRow row) { row.category = ""; row.description = ""; row.isSystem = false; row.isVisible = true; }
public static data.baseDS.sysCodeCatRow UpdateData(data.baseDS.sysCodeCatRow row) { data.baseDS.sysCodeCatDataTable tbl = new data.baseDS.sysCodeCatDataTable(); tbl.ImportRow(row); myClient.UpdateSysCodeCat(ref tbl); row.AcceptChanges(); return(tbl[0]); }
protected override void UpdateData(DataRow row) { if (row == null) { return; } data.baseDS.sysCodeCatRow sysCodeCatRow = (myMasterSource.Current as DataRowView).Row as data.baseDS.sysCodeCatRow; sysCodeCatRow.ItemArray = DataAccess.Libs.UpdateData(row as data.baseDS.sysCodeCatRow).ItemArray; sysCodeCatRow.AcceptChanges(); }
public override void AddNew(string code) { data.baseDS.sysCodeCatRow row = (data.baseDS.sysCodeCatRow)((DataRowView)myMasterSource.AddNew()).Row; if (row == null) { return; } commonClass.AppLibs.InitData(row); row.category = code; int position = myMasterSource.Position; myMasterSource.Position = -1; myMasterSource.Position = position; SetFirstFocus(); }
protected override void RemoveCurrent() { this.ShowMessage(""); if (myMasterSource.Current == null) { return; } data.baseDS.sysCodeCatRow row = (data.baseDS.sysCodeCatRow)(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); } data.baseDS.sysCodeCatRow row = (data.baseDS.sysCodeCatRow)(myMasterSource.Current as DataRowView).Row; if (row.isSystem) { common.system.ShowErrorMessage(Languages.Libs.GetString("cannotDelete")); return(false); } return(true); }
private void CategoryChanged() { this.ShowMessage(""); myDataSet.RejectChanges(); data.baseDS.sysCodeCatRow row = categoryCb.GetRow(categoryCb.myValue); if (row != null) { systemChk.Checked = row.isSystem; visibleChk.Checked = row.isVisible; maxLenEd.Value = (row.IsmaxCodeLenNull() ?-1:row.maxCodeLen); notesEd.Text = (row.IsnotesNull() ? "" : row.notes.ToString()); } LoadSyscode(); if (this.systemChk.Checked) { LockEdit(true); } editBtn.Enabled = !this.systemChk.Checked; }
protected override bool DataValid(bool showMsg) { ClearNotifyError(); if (codeEd.Text.Trim() == "") { NotifyError(codeLbl); this.codeEd.Focus(); return(false); } if (desc1Ed.Text.Trim() == "") { NotifyError(desc1Lbl); this.desc1Ed.Focus(); return(false); } data.baseDS.sysCodeCatRow row = categoryCb.GetRow(categoryCb.myValue); if (row != null & !row.IsmaxCodeLenNull() && row.maxCodeLen > 0 && codeEd.Text.Length > row.maxCodeLen) { if (showMsg) { common.system.ShowErrorMessage(String.Format(Languages.Libs.GetString("dataTooLong"), row.maxCodeLen)); } } return(true); }
public static void DeleteData(data.baseDS.sysCodeCatRow row) { myClient.DeleteSysCodeCat(row.category); }