public ActionResult UpdateSysConfigRadio(SysConfigRadio objConfigRadio) { try { using (var scope = new TransactionScope()) { using (var sp = new SharedDbConnectionScope()) { SqlQuery q = new SqlQuery().From(SysConfigRadio.Schema).Where(SysConfigRadio.Columns.SysId).IsEqualTo(1); if (q.GetRecordCount() <= 0) { objConfigRadio.IsNew = true; objConfigRadio.Save(); } else { new Update(SysConfigRadio.Schema) .Set(SysConfigRadio.PassWordColumn).EqualTo(objConfigRadio.PassWord) .Set(SysConfigRadio.UserNameColumn).EqualTo(objConfigRadio.UserName) .Set(SysConfigRadio.DomainColumn).EqualTo(objConfigRadio.Domain) .Set(SysConfigRadio.PathUNCColumn).EqualTo(objConfigRadio.PathUNC) .Where(SysConfigRadio.SysIdColumn).IsEqualTo(1).Execute(); } } scope.Complete(); return(ActionResult.Success); } } catch (Exception exception) { return(ActionResult.Error); } }
private void LoadDataSysConfigRadio() { SysConfigRadio objConfigRadio = SysConfigRadio.FetchByID(1); if (objConfigRadio != null) { PropertyLib._FTPProperties.UNCPath = Utility.sDbnull(objConfigRadio.PathUNC, ""); PropertyLib._FTPProperties.PWD = Utility.sDbnull(objConfigRadio.PassWord, ""); PropertyLib._FTPProperties.IPAddress = Utility.sDbnull(objConfigRadio.Domain, ""); PropertyLib._FTPProperties.UID = Utility.sDbnull(objConfigRadio.UserName, ""); } }
public string GetImageServerPath() { SysConfigRadio objConfigRadio = SysConfigRadio.FetchByID(1); string ServerPath = ""; if (objConfigRadio != null) { //string sPathName ServerPath = objConfigRadio.PathUNC; } else { Utility.ShowMsg("Bạn phải chưa khởi tạo Config, Bạn phải cấu hình hệ thống", "Thông báo"); ServerPath = ""; } return(ServerPath); }
public void Insert(string SysId,string UserName,string PassWord,string Domain,string PathUNC,int? IsSave) { SysConfigRadio item = new SysConfigRadio(); item.SysId = SysId; item.UserName = UserName; item.PassWord = PassWord; item.Domain = Domain; item.PathUNC = PathUNC; item.IsSave = IsSave; item.Save(UserName); }
public ActionResult UpdateSysConfigRadio(SysConfigRadio objConfigRadio) { try { using (var scope = new TransactionScope()) { using (var sp = new SharedDbConnectionScope()) { SqlQuery q = new SqlQuery().From(SysConfigRadio.Schema).Where(SysConfigRadio.Columns.SysId).IsEqualTo(1); if(q.GetRecordCount()<=0) { objConfigRadio.IsNew = true; objConfigRadio.Save(); }else { new Update(SysConfigRadio.Schema) .Set(SysConfigRadio.PassWordColumn).EqualTo(objConfigRadio.PassWord) .Set(SysConfigRadio.UserNameColumn).EqualTo(objConfigRadio.UserName) .Set(SysConfigRadio.DomainColumn).EqualTo(objConfigRadio.Domain) .Set(SysConfigRadio.PathUNCColumn).EqualTo(objConfigRadio.PathUNC) .Where(SysConfigRadio.SysIdColumn).IsEqualTo(1).Execute(); } } scope.Complete(); return ActionResult.Success; } } catch (Exception exception) { return ActionResult.Error; } }
public void Update(string SysId,string UserName,string PassWord,string Domain,string PathUNC,int? IsSave) { SysConfigRadio item = new SysConfigRadio(); item.MarkOld(); item.IsLoaded = true; item.SysId = SysId; item.UserName = UserName; item.PassWord = PassWord; item.Domain = Domain; item.PathUNC = PathUNC; item.IsSave = IsSave; item.Save(UserName); }
/// <summary> /// khởi tạo thông tin của đối tượng cấu hình /// </summary> /// <returns></returns> private SysConfigRadio CreateNewSysRadio() { var objConfigRadio = new SysConfigRadio(); objConfigRadio.PassWord = PropertyLib._FTPProperties.PWD; objConfigRadio.UserName = PropertyLib._FTPProperties.UID; objConfigRadio.Domain = PropertyLib._FTPProperties.IPAddress; objConfigRadio.PathUNC = PropertyLib._FTPProperties.UNCPath; return objConfigRadio; }