Ejemplo n.º 1
0
        public JsonResult DeleteWebBuiding(int buidingID)
        {
            WebBuidingService service = new WebBuidingService();

            service.DeleteWebBuiding(buidingID);
            return(Json(new { RetCode = 1 }));
        }
Ejemplo n.º 2
0
        public ActionResult BuidingStagesList()
        {
            WebBuidingService service = new WebBuidingService();
            int Workerid = Convert.ToInt32(SessionHelper.Get("PositionID"));
            List <WebBuiding> buidingList = service.GetWebBuidingListByWorkerID(Workerid, true);

            return(View(buidingList));
        }
Ejemplo n.º 3
0
        public ActionResult DesignCaseList(int peopleID)
        {
            WebBuidingService buidingService = new WebBuidingService();
            List <WebBuiding> caseList       = buidingService.GetWebBuidingList(peopleID);

            ViewBag.CaseList = caseList;
            return(View());
        }
Ejemplo n.º 4
0
        public ActionResult WorkerDetail(int peopleID)
        {
            WebPeopleService  peopleService  = new WebPeopleService();
            WebPeople         worker         = peopleService.GetWebPeopleByID(peopleID);
            WebBuidingService buidingService = new WebBuidingService();
            List <WebBuiding> caseList       = buidingService.GetWebBuidingList(1);

            ViewBag.CaseList = caseList;
            return(View(worker));
        }
Ejemplo n.º 5
0
        public JsonResult AddOrEditBuidingStages(WebBuiding webBuiding)
        {
            WebBuidingService service = new WebBuidingService();

            if (webBuiding.BuidingID > 0)
            {
                service.UpdateWebBuiding(webBuiding);
            }
            else
            {
                webBuiding.WorkerID = Convert.ToInt32(SessionHelper.Get("PositionID"));
                service.AddWebBuiding(webBuiding);
            }

            return(Json(new { RetCode = 1 }));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 获取worker分页
        /// </summary>
        public void GetDecWorkList()
        {
            int    pageIndex      = string.IsNullOrEmpty(context.Request["pageIndex"]) ? 1 : Convert.ToInt32(context.Request["pageIndex"]);
            int    PageSize       = Convert.ToInt32(context.Request["PageSize"]);
            string mkjcitycode    = context.Request["mkjcitycode"];
            string WorkerCategory = context.Request["WorkerCategory"];
            string positionID     = context.Request["positionID"];
            string AreasID        = context.Request["AreasID"];
            string SortOrder      = context.Request["SortOrder"];
            string SortParameters = "";
            int    pageCount      = 0;
            int    recordcount    = 0;

            string SelectParameters = string.Format("[WorkerID],[WorkerName],[WorkerCategory],[WorkerPhone],[WorkerMail],[Address]"
                                                    + ",[WorkerInfo],[WorkerLevel],[WorkerMotto],[IsBond],[BondMoney],[IsAuthentication],[IsHot],[IsTop],[ShowOrder]"
                                                    + ",[WorkerImage],[thumbnailImage],[AddOn],[EditOn],[DeleteOn],[FlagDelete],[ProvinceID],[ProvinceName],[CityID]"
                                                    + ",[CityName],[AreasID],[AreasName],[UserID],[PriceID],[PriceName],[WorkYearsID],[WorkYears],[WorkerPositionID]"
                                                    + ",[WorkerPosition],[GoodAtStyleID],[GoodAtStyle],[PageViewCount],[CollectCount],[CommentCount],[BuildingCount]"
                                                    + ",[IsBuildingCount],[IsApproved],[Stars],"
                                                    + "Stars/25 as Huang,Stars%25/5 as Ying,Stars%25%5 as Xing");

            SortParameters = string.Format("IsApproved=1 and FlagDelete=0 {0} {1} {2} {3}",
                                           "and CityID='" + mkjcitycode + "'",
                                           positionID == "0" || string.IsNullOrEmpty(positionID) ? "" : "and WorkerPositionID='" + positionID + "'",
                                           AreasID == "0" || string.IsNullOrEmpty(AreasID) ? "" : "and (AreasID='0' or AreasID like '%" + AreasID + "%')",
                                           "and WorkerCategory='" + WorkerCategory + "'");

            Pagination paginfo = new Pagination();

            paginfo.SelectParameters = SelectParameters;
            paginfo.PageIndex        = pageIndex;
            paginfo.PageSize         = PageSize;
            paginfo.EntityName       = "WebWorker";
            paginfo.SortParameters   = SortParameters;
            paginfo.SortOrder        = SortOrder + " ShowOrder desc,WorkerID desc";
            var result = PageList.GetPageListBySQL <WebWorker>(paginfo, out recordcount, out pageCount);
            List <WorkerAndBuidingList> list    = new List <WorkerAndBuidingList>();
            WebBuidingService           sercive = new WebBuidingService();
            var obj = new Object();

            if (WorkerCategory == "装修工长")
            {
                if (result != null)
                {
                    foreach (var item in result)
                    {
                        WorkerAndBuidingList eq = new WorkerAndBuidingList();
                        eq.worker  = item;
                        eq.biuding = sercive.GetWebBuidingListByCount(item.WorkerID, 3);
                        list.Add(eq);
                    }
                }

                obj = new
                {
                    list        = list,
                    recordcount = recordcount,
                    pageCount   = pageCount
                };
            }
            else
            {
                obj = new
                {
                    list        = result,
                    recordcount = recordcount,
                    pageCount   = pageCount
                };
            }


            string msg = JsonConvert.SerializeObject(obj);

            context.Response.Write(msg);
        }