public T_Gel CopyGel(T_Gel SourceGel) { T_Gel NewGel = new T_Gel(); TransExpUtil <T_Gel, T_Gel> .CopyValue(SourceGel, NewGel); NewGel.ID = 0; if (SourceGel.ResultMaps != null) { NewGel.ResultMaps = new List <T_ResultMap>(); foreach (var item in SourceGel.ResultMaps) { var obj = TransExpUtil <T_ResultMap, T_ResultMap> .Trans(item); obj.ID = 0; NewGel.ResultMaps.Add(obj); } } if (SourceGel.GelSteps != null) { NewGel.GelSteps = new List <T_GelStep>(); foreach (var item in SourceGel.GelSteps) { var obj = TransExpUtil <T_GelStep, T_GelStep> .Trans(item); obj.ID = 0; NewGel.GelSteps.Add(obj); } } gelDAO.InserOrUpdateGEL(NewGel); return(NewGel); }
protected override void OnViewLoaded() { t_GSBackup = TransExpUtil <T_GelStep, T_GelStep> .Trans(t_GelStep); if (t_GelStep.StepID != 0) { var obj = StepList.Where(c => c.ID == t_GelStep.StepID); if (obj != null && obj.Count() > 0) { SwitchPage(obj.First()); } } }
public bool ValidatePWD(T_User _User) { string loginName = _User.LoginName, Pwd = _User.LoginPwd; if (String.IsNullOrEmpty(loginName)) { return(false); } loginName = loginName.ToUpper(); if (Constants.AdminAccount == loginName) { var result = ValidateAdmin(loginName, Pwd); if (result) { var user = userDAO.QueryTUserByLoginName(loginName); if (user != null) { TransExpUtil <T_User, T_User> .CopyValue(user, _User); } else { result = false; } } return(result); } else if (Constants.SKAccount == loginName) { return(ValidateSKAdmin(loginName, Pwd)); } else { var user = userDAO.QueryTUserByLoginName(loginName); if (user == null) { return(false); } var res = (Common.Utils.MD5Util.validPassword(Pwd, user.LoginPwd)); if (res) { TransExpUtil <T_User, T_User> .CopyValue(user, _User); } return(res); } }
public void Copy() { if (SelectedStep == null) { return; } List <T_LogicStep> selsteps = new List <T_LogicStep>(SelectedStep.ToArray()); foreach (var selstep in selsteps) { var NewStep = TransExpUtil <T_LogicStep, T_LogicStep> .Trans(selstep); NewStep.ID = 0; int orderIndex = 1; if (StepList.Count > 0) { orderIndex = StepList[StepList.Count - 1].OrderIndex + 1; } NewStep.OrderIndex = orderIndex; StepList.Add(NewStep); } }
/// <summary> /// 取消按钮,并撤消更改 /// </summary> public void Close() { TransExpUtil <T_GelStep, T_GelStep> .CopyValue(t_GSBackup, t_GelStep); this.RequestClose(); }