public async Task <IActionResult> CreateUserFromMobile([FromBody] EBaseEntity eNewUser)
        {
            EUserAuth eUserAuth = await SBaseEntities.CreateUserFromMobile(eNewUser);

            if (eUserAuth != null)
            {
                return(Ok(eUserAuth));
            }
            else
            {
                return(BadRequest());
            }
        }
Exemple #2
0
        static public List <ELogisticsDriverIncident> GetAll(string companyID, int listCount = -1, int pageNumber = 0, string orderBy = "creationdateutc desc")
        {
            using var context = new SMySQLContext();
            List <ELogisticsDriverIncident> list = null;

            if (listCount == -1)
            {
                list = context.LogisticsDriverIncidents.Where(x => x.companyID == companyID).OrderBy(orderBy).ToList();
            }
            else
            {
                list = context.LogisticsDriverIncidents.Where(x => x.companyID == companyID).OrderBy(orderBy).Skip(pageNumber * listCount).Take(listCount).ToList();
            }
            foreach (var eLogisticsDriverIncident in list)
            {
                eLogisticsDriverIncident.driverName = SBaseEntities.GetByID(eLogisticsDriverIncident.driverID).name;
            }
            return(list);
        }
Exemple #3
0
 static public List <ECompanyProposal> GetAll(string companyID, int listCount = -1, int pageNumber = 0, string orderBy = "id desc")
 {
     using (var context = new SMySQLContext()) {
         List <ECompanyProposal> list = null;
         if (listCount == -1)
         {
             list = context.CompanyProposals.Where(x => x.companyID == companyID).OrderBy(orderBy).ToList();
         }
         else
         {
             list = context.CompanyProposals.Where(x => x.companyID == companyID).OrderBy(orderBy).Skip(pageNumber * listCount).Take(listCount).ToList();
         }
         foreach (var eCompanyProposal in list)
         {
             if (string.IsNullOrEmpty(eCompanyProposal.toEntityID))
             {
                 continue;
             }
             eCompanyProposal.toEntityName = SBaseEntities.GetByID(eCompanyProposal.toEntityID, false).name;
         }
         return(list);
     }
 }
        static public List <EDeliveryOrder> GetAll(string companyID, int listCount = -1, int pageNumber = 0, string orderBy = "id desc")
        {
            using var context = new SMySQLContext();
            List <EDeliveryOrder> list = null;

            if (listCount == -1)
            {
                list = context.DeliveryOrders.Where(x => x.companyID == companyID).OrderBy(orderBy).ToList();
            }
            else
            {
                list = context.DeliveryOrders.Where(x => x.companyID == companyID).Skip(pageNumber * listCount).Take(listCount).OrderBy(orderBy).ToList();
            }
            foreach (EDeliveryOrder eDeliveryOrder in list)
            {
                if (string.IsNullOrEmpty(eDeliveryOrder.entityID))
                {
                    continue;
                }
                eDeliveryOrder.entityName = SBaseEntities.GetByID(eDeliveryOrder.entityID, false).name;
                eDeliveryOrder.statusName = GetStatusName(eDeliveryOrder.status);
            }
            return(list);
        }
        public async Task <IActionResult> Remove(string id)
        {
            var ok = await SBaseEntities.Remove(id);

            return(Ok(ok));
        }
        public async Task <IActionResult> Save([FromBody] EBaseEntity eBaseEntity)
        {
            string id = await SBaseEntities.Save(eBaseEntity);

            return(Ok(id));
        }
 public IActionResult SaveProfile([FromBody] EBaseEntity eBaseEntity)
 {
     return(Ok(SBaseEntities.SaveProfile(eBaseEntity)));
 }
        public IActionResult Authenticate(string email, string password)
        {
            EUserAuth eUserAuth = SBaseEntities.Authenticate(email, password);

            return(Ok(eUserAuth));
        }
        public IActionResult SearchByName(string companyID, string name)
        {
            var result = SBaseEntities.SearchByName(companyID, name);

            return(Ok(result));
        }
        public IActionResult GetByID(string id)
        {
            var eBaseEntity = SBaseEntities.GetByID(id, true);

            return(Ok(eBaseEntity));
        }
        public IActionResult GetAll(string companyID, int listCount = -1, int pageNumber = 0, string orderBy = "name asc")
        {
            var list = SBaseEntities.GetAll(companyID, listCount, pageNumber, orderBy);

            return(Ok(list));
        }