Example #1
0
 public static void InitData(databases.baseDS.sysCodeRow row)
 {
     row.category     = "";
     row.code         = "";
     row.description1 = "";
     row.isSystem     = false; row.isVisible = true;
 }
Example #2
0
 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();
 }
Example #3
0
 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"));
 }
Example #4
0
 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);
 }