void commonClient_GetEntityProNameByEnityNameCompleted(object sender, Saas.Tools.HrCommonServiceWS.GetEntityProNameByEnityNameCompletedEventArgs e) { if (e.Error != null && e.Error.Message != "") { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); } else { if (e.Result != null) { foreach (var str in e.Result) { T_HR_IMPORTSETDETAIL ent = new T_HR_IMPORTSETDETAIL(); ent.DETAILID = Guid.NewGuid().ToString(); ent.ENTITYCOLUMNCODE = str; ent.ENTITYCOLUMNNAME = Utility.GetResourceStr(str); ent.T_HR_IMPORTSETMASTER = Master; ent.CREATEDATE = DateTime.Now; ent.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; detailList.Add(ent); } } DtGrid.ItemsSource = detailList; DtGrid.DataContext = detailList; } RefreshUI(RefreshedTypes.HideProgressBar); }
public void ImportSetMasterAdd(T_HR_IMPORTSETMASTER entity, List <T_HR_IMPORTSETDETAIL> entList, ref string strMsg) { try { T_HR_IMPORTSETMASTER tempEnt = new T_HR_IMPORTSETMASTER(); var entTmp = from c in dal.GetObjects() where c.CITY == entity.CITY && c.OWNERCOMPANYID == entity.OWNERCOMPANYID select c; if (entTmp.Count() > 0) { // throw new Exception("EXISTIMPORTSETCITY"); strMsg = "EXISTIMPORTSETCITY"; return; } Utility.CloneEntity <T_HR_IMPORTSETMASTER>(entity, tempEnt); foreach (var ents in entList) { T_HR_IMPORTSETDETAIL ent = new T_HR_IMPORTSETDETAIL(); Utility.CloneEntity <T_HR_IMPORTSETDETAIL>(ents, ent); tempEnt.T_HR_IMPORTSETDETAIL.Add(ent); } //DataContext.AddObject("T_HR_IMPORTSETMASTER", tempEnt); //DataContext.SaveChanges(); dal.AddToContext(tempEnt); dal.SaveContextChanges(); } catch (Exception ex) { SMT.Foundation.Log.Tracer.Debug(System.DateTime.Now.ToString() + " ImportSetMasterAdd:" + ex.Message); throw ex; } }