public bool UpdateRole(string Title, string Desc, bool Status, int?Id) { try { var _role = _db.SingleOrDefault <UserRole>("where RoleId =@0", Id); _role.Title = Title; _role.Desc = Desc; _role.Isroleactive = Status; _db.Update(_role); return(true); } catch (Exception) { return(false); } }
public bool UpdateRole(string Title, string Desc, bool Status, int?Id) { try { var _role = _db.SingleOrDefault <UserRole>("where RoleId =@0", Id); _role.Rolename = Title; _role.Roledesc = Desc; _role.Isroleactive = Status; _db.Update(_role); return(true); } catch (Exception ex) { Log.ErrorFormat("UpdateRole", ex.Message); return(false); } }
public bool UpdatePassword(string Username, string Password) { try { var _user = _db.SingleOrDefault <DolUser>("where UserName =@0", Username); _user.Password = Password; _db.Update(_user); return(true); } catch (Exception ex) { return(false); } }
public bool LogOffUser(LoginRequest request) { try { var param = _db.SingleOrDefault <UserTracking>("where UserName=@0 and SystemIp=@1 and IsUserLogOut=@2 and IsUserLogOff=@2", request.UserName, request.SystemIp, false); param.Isuserlogoff = true; _db.Update(param); return(true); } catch (Exception ex) { log.ErrorFormat("UserLogOff", ex); return(false); } }
//Get terminal details public TerminalDetailsObj GetTerminalDetails(int?TerminalId) { var terminal = _db.SingleOrDefault <DolTerminal>("where TerminalId=@0", TerminalId); var state = _db.FirstOrDefault <DolState>("where StateId=@0", terminal.Stateid); var region = _db.FirstOrDefault <DolRegion>("where RegionId=@0", state.Regionid); var brand = _db.FirstOrDefault <DolBrand>("where BrandId=@0", terminal.Brandid); var user = _db.FirstOrDefault <DolUser>("where UserName=@0", terminal.Engineer); var client = _db.FirstOrDefault <DolClient>("where ClientId=@0", terminal.Clientid); var param = new TerminalDetailsObj { TerminalId = terminal.Terminalid, TerminalNo = terminal.Terminalno, TerminalRef = terminal.Terminalref, BrandId = terminal.Brandid, BrandName = brand.Brandname, ClientId = terminal.Clientid, ClientName = client.Clientname, Engineer = terminal.Engineer, FirstName = user.Firstname, MiddleName = user.Middlename, LastName = user.Lastname, IsTerminalActive = terminal.Isterminalactive, IsUnderSupport = terminal.Isundersupport, Location = terminal.Location, RegionTitle = region.Regiontitle, SerialNo = terminal.Serialno, StateTitle = state.Statetitle, StateId = terminal.Stateid, TerminalAlias = terminal.Terminalalias, CreatedBy = terminal.Createdby, CreatedOn = terminal.Createdon }; return(param); }
public bool UpdateClient(string ClientName, string ClientAlias, HttpPostedFileBase ClientBanner, int RespTime, int RestTime, bool IsClientActive, string ExtClientBanner, int ClientId) { try { var client = _db.SingleOrDefault <DolClient>("WHERE ClientId=@0", ClientId); client.Clientname = ClientName; client.Clientalias = ClientAlias; client.Isclientactive = IsClientActive; client.Clientbanner = DoFileUpload(ClientBanner, ExtClientBanner); client.Resptime = RespTime; client.Resttime = RestTime; _db.Update(client); return(true); } catch (Exception) { return(false); } }
public bool UpdateBrandDetails(string BrandName, string BrandDesc, bool IsBrandActive, string CreatedBy, int BrandId) { try { var brand = _db.SingleOrDefault <DolBrand>("WHERE BrandId=@0", BrandId); brand.Brandname = BrandName; brand.Branddesc = BrandDesc; brand.Isbrandactive = IsBrandActive; brand.Createdby = CreatedBy; brand.Createdon = DateTime.Now; brand.Createdby = CreatedBy; _db.Update(brand); return(true); } catch (Exception) { return(false); } }
public bool UpdateClient(ClientRequest request) { try { var client = _db.SingleOrDefault <DolClient>("WHERE ClientId=@0", request.ClientId); client.Clientname = request.ClientName; client.Clientalias = request.ClientAlias; client.Isclientactive = request.IsClientActive; client.Clientbanner = request.ClientBanner; client.Resptimein = request.RespTimeIn; client.Resttimein = request.RestTimeIn; client.Resptimeout = request.RespTimeOut; client.Resttimeout = request.RestTimeOut; _db.Update(client); return(true); } catch (Exception ex) { Log.ErrorFormat("UpdateClient", ex); return(false); } }