Ejemplo n.º 1
0
        public BrandResp GetBrandDetails(int?BrandId)
        {
            string sql    = "Select * from Dol_Brand where BrandId =@0";
            var    actual = _db.FirstOrDefault <DolBrand>(sql, BrandId);

            if (actual != null)
            {
                return(new BrandResp
                {
                    RespCode = "00",
                    RespMessage = "Success",
                    BrandName = actual.Brandname,
                    BrandDesc = actual.Branddesc,
                    IsBrandActive = actual.Isbrandactive,
                    BrandId = actual.Brandid
                });
            }
            else
            {
                return(new BrandResp
                {
                    RespCode = "04",
                    RespMessage = "Failure"
                });
            }
        }
Ejemplo n.º 2
0
        //private readonly AuditManagement _audit = new AuditManagement();
        //private readonly RoleManagement _role = new RoleManagement();
        //private readonly ClientManagement _client = new ClientManagement();



        public UserDetailsObj GetUserInfo(string UserName)
        {
            string sql  = "select A.*,B.*,C.ClientAlias from Dol_User A inner join User_Role B on A.RoleId=B.RoleId inner join Dol_Client C on C.ClientId=A.ClientId where A.UserName=@0 and A.IsDelete='false' ";
            var    info = _db.FirstOrDefault <UserDetailsObj>(sql, UserName);

            return(info);
        }
Ejemplo n.º 3
0
        public ClientResp GetClientDetails(int?ClientId)
        {
            string sql    = "Select * from Dol_Client where ClientId =@0";
            var    actual = _db.FirstOrDefault <DolClient>(sql, ClientId);

            if (actual != null)
            {
                return(new ClientResp
                {
                    RespCode = "00",
                    RespMessage = "Success",
                    ClientId = actual.Clientid,
                    ClientBanner = actual.Clientbanner,
                    ClientAlias = actual.Clientalias,
                    ClientName = actual.Clientname,
                    RestTime = actual.Resttime,
                    RespTime = actual.Resptime,
                    IsClientActive = actual.Isclientactive,
                    CreatedBy = actual.Createdby,
                    CreatedOn = actual.Createdon
                });
            }
            else
            {
                return(new ClientResp
                {
                    RespCode = "04",
                    RespMessage = "Failure"
                });
            }
        }
Ejemplo n.º 4
0
        public UserInfo GetUserInfo(UserObj userLogin)
        {
            string sql     = "select A.*,B.*,C.ClientAlias from Dol_User A inner join User_Role B on A.RoleId=B.RoleId inner join Dol_Client C on C.ClientId=A.ClientId where A.UserName=@0 and A.IsDelete='false' ";
            var    _actual = _db.FirstOrDefault <UserInfo>(sql, userLogin.Username);

            return(_actual);
        }
Ejemplo n.º 5
0
        public UserTracking TrackLogin(string username)
        {
            string sql    = "select * from User_Tracking where UserName =@0";
            var    actual = _db.FirstOrDefault <UserTracking>(sql, username);

            return(actual);
        }
Ejemplo n.º 6
0
        public DolMenuItem GetMenuByName(string MenuName)
        {
            string SQL    = "Select * from DolMenu where MenuName =@0";
            var    actual = _db.FirstOrDefault <DolMenuItem>(SQL, MenuName);

            return(actual);
        }
Ejemplo n.º 7
0
        public RoleResp GetRoleDetails(int RoleId)
        {
            string sql     = "select * from User_Role where RoleId=@0";
            var    _actual = _db.FirstOrDefault <RoleResp>(sql, RoleId);

            if (_actual != null)
            {
                return(new RoleResp
                {
                    RespCode = "00",
                    RespMessage = "Success",
                    RoleId = _actual.RoleId,
                    Title = _actual.Title,
                    _Desc = _actual._Desc,
                    IsRoleActive = _actual.IsRoleActive
                });
            }
            else
            {
                return(new RoleResp
                {
                    RespCode = "04",
                    RespMessage = "Failed",
                });
            }
        }
Ejemplo n.º 8
0
        //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);
        }
Ejemplo n.º 9
0
 public UserTracking TrackLogin(string username)
 {
     return(_db.FirstOrDefault <UserTracking>("select * from User_Tracking where UserName =@0", username));
 }
 public StockDetailsObj GetStockDetailsById(int StockId)
 {
     return(_db.FirstOrDefault <StockDetailsObj>("select * from Dol_Stocked_Part where StockId=@0", StockId));
 }
 public IncidentDetailsObj GetIncidentDetails(int IncidentNo)
 {
     //string IncidentNo = GenerateIncidentNo(IncidentId);
     return(_db.FirstOrDefault <IncidentDetailsObj>("select * from Dol_Incident where IncidentId=@0", IncidentNo));
 }
Ejemplo n.º 12
0
 public ClientDetailsObj GetClientDetailsById(int?ClientId)
 {
     return(_db.FirstOrDefault <ClientDetailsObj>("Select * from Dol_Client where ClientId =@0", ClientId));
 }
Ejemplo n.º 13
0
 public UserRole RoleDetailsByName(string RoleName)
 {
     return(_db.FirstOrDefault <UserRole>("select * from User_Role where RoleDesc =@0", RoleName));
 }
Ejemplo n.º 14
0
        public BrandDetailsObj GetBrandDetails(int?BrandId)
        {
            string sql = "Select * from Dol_Brand where BrandId =@0";

            return(_db.FirstOrDefault <BrandDetailsObj>(sql, BrandId));
        }
Ejemplo n.º 15
0
 public DolMenuItem GetMenuByName(string MenuName)
 {
     return(_db.FirstOrDefault <DolMenuItem>("Select * from DolMenu where MenuName =@0", MenuName));
 }