protected override void Loading() { if (!IsAdd) { var dict = MainDict.FindById(long.Parse(ItemID)); FrmAddEditBindComboBoxText.BindObjectToControls(dict, tabPage1); } }
//public static DataTable GetAllMainDictTable(string optrType) //{ // var dt = MainDict.Find(CK.K["OptrType"] == optrType).ToDataTable(); // dt.Columns.Remove("OptrType"); // dt.Columns.Remove("PreName"); // dt.Columns[1].ColumnName = "名称"; // dt.Columns[2].ColumnName = "类型"; // dt.Columns[3].ColumnName = "备注"; // return dt; //} public static void DelCell(long id) { //保留删除之前的名称然后才删除 var mainDict = MainDict.FindById(id); mainDict.PreName = mainDict.Name; mainDict.Save(); MainDict.DeleteAll(CK.K["Id"] == id); }
protected override void Saving() { if (IsAdd) { var dict = MainDict.New; FrmAddEditBindComboBoxText.BindControlsToObject(dict, tabPage1); dict.OptrType = UserStatics.OptrType; dict.Save(); } else { var dict = MainDict.FindById(long.Parse(ItemID)); FrmAddEditBindComboBoxText.BindControlsToObject(dict, tabPage1); dict.OptrType = UserStatics.OptrType; dict.Save(); } }