Ejemplo n.º 1
0
 public IActionResult GetArea()
 {
     try
     {
         SugarHandler db = new SugarHandler();
         return(new JsonResult(db.Queryable <retail_area>().OrderBy(x => x.CityId).ToList()));
     }
     catch (SqlSugar.SqlSugarException ex)
     {
         return(Problem(ex.Message));
     }
 }
Ejemplo n.º 2
0
 public IActionResult GetCity()
 {
     try
     {
         SugarHandler db = new SugarHandler();
         return(Ok(db.Queryable <retail_city>().OrderBy(x => x.ProvinceId).ToList()));
     }
     catch (SqlSugar.SqlSugarException ex)
     {
         return(Problem(ex.Message));
     }
 }
Ejemplo n.º 3
0
        public IActionResult GetUnit()
        {
            var companyId = Request.Headers["CompanyId"].ObjToInt();

            try
            {
                SugarHandler db    = new SugarHandler();
                var          units = db.Queryable <retail_unit, retail_ref_company_unit>((t1, t2) => new object[] { JoinType.Inner, t1.Id == t2.UnitId }).Where((t1, t2) => t2.CompanyId == companyId).ToList();
                return(Ok(units));
            }
            catch (SqlSugar.SqlSugarException ex)
            {
                return(Problem(ex.Message));
            }
        }
Ejemplo n.º 4
0
        public IActionResult GetProductSizeInfo()
        {
            var companyId = Request.Headers["CompanyId"].ToString().ToInt();

            try
            {
                SugarHandler db       = new SugarHandler();
                var          products = db.Queryable <retail_product_size, retail_product, retail_ref_company_product>((t1, t2, t3) => new object[] { JoinType.Inner, t1.ProductId == t2.Id, JoinType.Inner, t2.Id == t3.ProductId }).Where((t1, t2, t3) => (t3.CompanyId == companyId && t2.Status == 1)).ToList();
                return(Ok(products));
            }
            catch (SqlSugarException ex)
            {
                return(Problem(ex.Message));
            }
        }
Ejemplo n.º 5
0
        public IActionResult GetCustom()
        {
            var companyId  = Request.Headers["CompanyId"].ObjToInt();
            var companyPid = Request.Headers["CompanyPid"].ObjToInt();

            try
            {
                SugarHandler db      = new SugarHandler();
                var          customs = db.Queryable <retail_custom, retail_ref_company_custom>((t1, t2) => new object[] { JoinType.Inner, t1.Id == t2.CustomId }).Where((t1, t2) => t2.CompanyId == companyId && t1.CompanyPid == companyPid && t1.Status == 1).ToList();
                return(Ok(customs));
            }
            catch (SqlSugar.SqlSugarException ex)
            {
                return(Problem(ex.Message));
            }
        }