示例#1
0
        public ActionResult Details(System.Int64 id)
        {
            if ((_crud & Zippy.SaaS.Entity.CRUD.Read) != Zippy.SaaS.Entity.CRUD.Read)
            {
                return(RedirectToAction("NoPermission", "Error"));
            }
            Z30Communication entity = Z30CommunicationHelper.Create(db, id);

            return(View(entity));
        }
示例#2
0
        public ActionResult Edit(System.Int64?id, string act, long?customerID)
        {
            Z30Communication entity = null;

            if (id.HasValue && id > 0)
            {
                if (act == "detail")
                {
                    if ((_crud & Zippy.SaaS.Entity.CRUD.Read) != Zippy.SaaS.Entity.CRUD.Read)
                    {
                        return(RedirectToAction("NoPermission", "Error"));
                    }
                    ViewBag.VTitle   = "查看沟通记录信息";
                    ViewBag.IsDetail = true;
                }
                else
                {
                    if ((_crud & Zippy.SaaS.Entity.CRUD.Update) != Zippy.SaaS.Entity.CRUD.Update)
                    {
                        return(RedirectToAction("NoPermission", "Error"));
                    }
                    ViewBag.VTitle = "修改沟通记录信息";
                }
                entity = Z30CommunicationHelper.Create(db, id.Value);
            }
            else
            {
                if ((_crud & Zippy.SaaS.Entity.CRUD.Create) != Zippy.SaaS.Entity.CRUD.Create)
                {
                    return(RedirectToAction("NoPermission", "Error"));
                }
                ViewBag.VTitle    = "新增沟通记录";
                entity            = new Z30Communication();
                entity.CustomerID = customerID;
            }
            if (customerID.HasValue)
            {
                var persons = db.Take <Z01Beetle.Entity.Z01CustomerPerson>("CustomerID=@CustomerID", db.CreateParameter("CustomerID", customerID));
                ViewBag.Persons = persons;
            }

            return(View(entity));
        }
示例#3
0
        public ActionResult Index(Int64?id, int?PageIndex, int?PageSize, string qContent, Int32?qWish, Int32?qSuccessRatio, DateTime?qCreateDateStart, DateTime?qCreateDateEnd, int?orderCol)
        {
            if ((_crud & Zippy.SaaS.Entity.CRUD.Read) != Zippy.SaaS.Entity.CRUD.Read)
            {
                return(RedirectToAction("NoPermission", "Error"));
            }

            System.Text.StringBuilder sbMenu = new System.Text.StringBuilder();
            if ((_crud & Zippy.SaaS.Entity.CRUD.Read) == Zippy.SaaS.Entity.CRUD.Read)
            {
                sbMenu.AppendLine("<a href='javascript:;' class='btn list img' id='search'><i class='icon i_search'></i>查询<b></b></a>");
            }
            if ((_crud & Zippy.SaaS.Entity.CRUD.Delete) == Zippy.SaaS.Entity.CRUD.Delete)
            {
                sbMenu.AppendLine("<a href='javascript:;' class='btn img' id='bDelete'><i class='icon i_delete'></i>删除<b></b></a>");
            }
            sbMenu.AppendLine("<a href='javascript:;' class='btn img' id='bReload'><i class='icon i_refresh'></i>刷新<b></b></a>");
            ViewBag.TopMenu = sbMenu.ToString();

            ViewBag.db       = db;
            ViewBag.PageSize = PageSize;
            int currentPageSize  = PageSize ?? 10;
            int currentPageIndex = PageIndex ?? 1;

            Hashtable hs = new Hashtable();

            hs.Add("qCreator", _user.UserID); //我的客户
            hs.Add("qCustomerID", id);
            hs.Add("qContent", qContent);
            hs.Add("qWish", qWish);
            hs.Add("qSuccessRatio", qSuccessRatio);
            hs.Add("qCreateDateStart", qCreateDateStart);
            hs.Add("qCreateDateEnd", qCreateDateEnd);

            PaginatedList <Z30Communication> result = Z30CommunicationHelper.Query(db, _tenant.TenantID.Value, currentPageSize, currentPageIndex, hs, orderCol);

            result.QueryParameters = hs;
            return(View(result));
        }