示例#1
0
        //[B_MenuRightsTag("查看")]
        //public ActionResult InCreaseIndex()
        //{
        //    return View();
        //}

        public ActionResult GetAgentIncrease(SaleSearch condition)
        {
            string where = string.Empty;
            string wheres = string.Empty;

            //关键字搜索
            if (!string.IsNullOrWhiteSpace(condition.keyword))
            {
                condition.keyword = Common.Filter(condition.keyword);
                wheres           += string.Format(@" and Name like '%{0}%'  ", condition.keyword);
            }
            //订单创建时间
            where += string.Format(" and DatAudit >='{0}/01 00:00:00' and DatAudit<'{1}/01 00:00:00'", Common.Filter(condition.DatCreateB), DateTime.Parse(Common.Filter(condition.DatCreateB) + "/01").AddMonths(1).ToString("yyyy-MM"));

            if (condition.C_UserTypeID != 0)
            {
                wheres += string.Format(" and C_UserTypeID ='{0}' ", condition.C_UserTypeID);
            }
            string OldSumPrice                = "(select Sum(o.SumPrice)  from [C_User] c left join [Order] o on c.UserName=o.UserName  where c.UserName=oc.UserName and OrderState='已发货' and DatAudit<'" + Common.Filter(condition.DatCreateB) + "/01 00:00:00')";
            string TheMonthSumPrice           = "(select Sum(o.SumPrice)  from [C_User] c left join [Order] o on c.UserName=o.UserName  where c.UserName=oc.UserName and OrderState='已发货'  " + where + ")";
            PageJsonModel <SaleInCrease> page = new PageJsonModel <SaleInCrease>();

            page.pageIndex = condition.pageIndex;
            page.strForm   = @"(select " + OldSumPrice + " OldSumPrice," + TheMonthSumPrice + " TheMonthSumPrice ," + TheMonthSumPrice + "/" + OldSumPrice + " Increase,  SUM(od.SumPrice) SumPrice,oc.Name Name,oc.Identifier Identifier,oc.C_UserTypeID C_UserTypeID from [C_User] oc left join [Order] od on od.UserName=oc.UserName   where od.OrderState='已发货'  group by oc.UserName, Name,Identifier,oc.C_UserTypeID  ) as show";
            page.strSelect = " * ";
            page.pageSize  = condition.pageSize;
            page.strWhere  = wheres;
            page.strOrder  = " Increase,TheMonthSumPrice desc";
            page.LoadList();

            return(Json(page.pageResponse, JsonRequestBehavior.AllowGet));
        }
示例#2
0
        public ActionResult GetSaleAgent(SaleSearch condition)
        {
            string where = "and Chief=0 and UserName!='m2000' and c.state='已审核'";
            //关键字搜索
            if (!string.IsNullOrWhiteSpace(condition.keyword))
            {
                condition.keyword = Common.Filter(condition.keyword);
                where            += string.Format(@" and (c.Name like '%{0}%' or c.Phone like '%{0}%')  ", condition.keyword);
            }

            if (condition.C_UserTypeID != 0)
            {
                where += string.Format(" and c.C_UserTypeID ='{0}' ", condition.C_UserTypeID);
            }

            PageJsonModel <C_User> page = new PageJsonModel <C_User>();

            page.pageIndex = condition.pageIndex;
            page.strForm   = @" (select c.ID,c.Name,c.UserName,c.Phone,t.Name C_UserTypeName,(select COUNT(*) from [ScaleOutStoke] where  Consignee=c.UserName  and State='启用') count from [C_User] c  left join [C_UserType] t on c.C_UserTypeID=t.Lever  where 1=1  " + where + "  group by c.ID,c.Name,c.UserName,c.Phone,t.Name   ) as show";
            //  page.strForm = @" (select c.ID,c.Name,c.UserName,c.Phone,t.Name C_UserTypeName,count(s.ID) count from [C_User] c left join [ScaleOutStoke] s on c.UserName=s.Consignee  left join [C_UserType] t on c.C_UserTypeID=t.Lever   where s.State='启用'  " + where + " group by c.ID,c.Name,c.UserName,c.Phone,t.Name) as show";
            page.strSelect = " * ";
            page.pageSize  = condition.pageSize;
            page.strWhere  = "";
            page.strOrder  = " ID Desc";
            page.LoadList();

            return(Json(page.pageResponse, JsonRequestBehavior.AllowGet));
        }
示例#3
0
 public void InsertSaleSearch(SaleSearch newsale)
 {
     using (var dbConn = new SQLiteConnection(App.DB_PATH))
     {
         dbConn.RunInTransaction(() =>
         {
             dbConn.Insert(newsale);
         });
     }
 }
示例#4
0
        public ActionResult GetSaleAgent(SaleSearch condition)
        {
            string where = string.Empty;
            //关键字搜索
            if (!string.IsNullOrWhiteSpace(condition.keyword))
            {
                condition.keyword = Common.Filter(condition.keyword);
                where            += string.Format(@" and Name like '%{0}%'  ", condition.keyword);
            }
            //订单创建时间
            if (!string.IsNullOrWhiteSpace(condition.DatCreateB))
            {
                where += string.Format(" and DatAudit >='{0} 00:00:00' ", Common.Filter(condition.DatCreateB));
            }
            if (!string.IsNullOrWhiteSpace(condition.DatCreateE))
            {
                where += string.Format(" and DatAudit <'{0} 23:59:59' ", Common.Filter(condition.DatCreateE));
            }


            if (condition.C_UserTypeID != 0)
            {
                where += string.Format(" and C_UserTypeID ='{0}' ", condition.C_UserTypeID);
            }

            PageJsonModel <Sale> page = new PageJsonModel <Sale>();

            page.pageIndex = condition.pageIndex;
            page.strForm   = @" (select c.Name Name ,SUM(o.SumPrice) SumPrice,c.Identifier Identifier from [C_User] c left join [Order] o on c.UserName=o.UserName   where OrderState='已发货'  " + where + " group by Name,Identifier) as show";
            page.strSelect = " * ";
            page.pageSize  = condition.pageSize;
            page.strWhere  = "";
            page.strOrder  = " SumPrice Desc";
            page.LoadList();

            return(Json(page.pageResponse, JsonRequestBehavior.AllowGet));
        }
示例#5
0
 private void select_Function(int Id)
 {
     //선택된 값의 객체를 가리키는 함수
     select_sale       = Id;
     currentsalesearch = Db_salesearch.ReadSaleSearch(select_sale);
 }