void gridViewOperation_AfterDelete(JH_weekks obj) { //恢复列表 if (obj.计划种类.Contains("一")) { JH_monthks ks = Client.ClientHelper.PlatformSqlMap.GetOneByKey<JH_monthks>(obj.c2); if (ks != null) { ks.可选标记 = ""; ClientHelper.PlatformSqlMap.Update<JH_monthks>(ks); } } }
void ks_RowDoubleClicked(object sender, JH_monthks obj) { if (parentID == null || parentID.Length!=7) { MsgBox.ShowAskMessageBox("请先选择计划周"); return; } foreach (JH_weekks jh in gridViewOperation.BindingList){ if (obj.ID == jh.c2) return; } JH_weekks addjh = new JH_weekks(); //ConvertHelper.CopyTo(obj, addjh); Type t = addjh.GetType(); Type t2 = obj.GetType(); foreach (PropertyInfo p in t.GetProperties()) { p.SetValue(addjh, t2.GetProperty(p.Name).GetValue(obj, null), null); } addjh.ID = addjh.CreateID(); addjh.c2 = obj.ID; addjh.完成标记 = "未完成"; addjh.完成时间 = DateTime.Now; addjh.ParentID = parentID; addjh.预计时间 = ParentOBJ.开始日期; addjh.预计时间2 = ParentOBJ.结束日期; Client.ClientHelper.PlatformSqlMap.Create<JH_weekks>(addjh); gridViewOperation.BindingList.Add(addjh); if (obj.计划种类.Contains("一")) { obj.可选标记 = "否"; Client.ClientHelper.PlatformSqlMap.Update<JH_monthks>(obj); } }
JH_weekks createjh(mOrg o,JH_weekks s) { JH_weekks jh = new JH_weekks(); ConvertHelper.CopyTo(s, jh); jh.ID = jh.CreateID(); jh.单位代码 = o.OrgCode; jh.单位名称 = o.OrgName; jh.c2 = s.ID; jh.单位分类 = "9";//下发任务 return jh; }
/// <summary> /// 新建对象设置Key值 /// </summary> /// <param name="newobj"></param> void gridViewOperation_CreatingObjectEvent(JH_weekks newobj) { newobj.ParentID = parentID; newobj.单位分类 = type1; if (org != null) { newobj.单位代码 = org.OrgCode; newobj.单位名称 = org.OrgName; newobj.c1 = org.OrgName; } newobj.计划种类 = "常规计划"; newobj.计划分类 = type2; newobj.预计时间 = DateTime.Today; newobj.预计时间2 = DateTime.Today; }
void gridViewOperation_AfterAdd(JH_weekks obj) { return; }