public ViewResult MarketIndex(int?projectid, int?dealcondition, int?distinctnumber)
        {
            var pjs = CH.GetAllData <Project>();
            var pj  = CH.GetDataById <Project>(projectid);

            if (projectid != null)
            {
                pj = pjs.Where(p => p.ID == projectid).FirstOrDefault();
            }
            if (pj == null)
            {
                //pj = CH.GetAllData<Project>().Where(p => p.Market == Employee.CurrentUserName).OrderBy(p=>p.ID).FirstOrDefault();
                pj = CH.DB.Projects.Where(w => w.IsActived == true && w.Market != null).ToList().Where(p => p.Market.Split(new string[] { ";", ";" }, StringSplitOptions.RemoveEmptyEntries).Contains(Employee.CurrentUserName)).OrderBy(p => p.ID).FirstOrDefault();
                if (pj == null)
                {
                    return(View());
                }
            }
            this.AddErrorStateIfCreatorIsTheLoginUserIsNotTheMarketInterface(pj);
            string categories = String.IsNullOrEmpty(Request["Categories"]) ? null : Request["Categories"].Trim();
            string distinct   = String.IsNullOrEmpty(Request["DistinctHidden"]) ? String.Empty : Request["DistinctHidden"].Trim();

            if (distinct != "Page")
            {
                distinctnumber = 0;
            }
            ViewBag.ProjectID = pj.ID;

            string currcate = "";
            var    cateList = CH.GetAllData <Category>(c => c.ProjectID == ViewBag.ProjectID);

            if (cateList != null && cateList.Count > 0)
            {
                currcate = String.Join(",", cateList.Select(s => s.ID));
            }
            if (categories == null)
            {
                categories = currcate;
            }
            else
            {
                var currList = currcate.Split(',').ToList();
                var postList = categories.Split(',').ToList();
                if (postList.Any(p => currList.Any(c => c == p)))
                {
                }
                else
                {
                    categories = currcate;
                }
            }
            ViewBag.Categories     = categories;
            ViewBag.DealCondition  = dealcondition;
            ViewBag.DistinctNumber = distinctnumber;
            //if (ModelState.IsValid)
            //{
            var ls = pj.ProjectLeads(dealcondition, distinctnumber, categories);

            return(View(ls));
            //}
            //else
            //    return View();
        }
 public ViewResult Index()
 {
     return(View(CH.GetAllData <PhoneSaleSupport>()));
 }
 public ViewResult Index()
 {
     return(View(CH.GetAllData <ParticipantType>()));
 }
Exemplo n.º 4
0
 public ActionResult Index()
 {
     return(View(CH.GetAllData <Company>("Leads")));
 }
 public ViewResult Index()
 {
     return(View(CH.GetAllData <LeadCallType>()));
 }
 public ViewResult Index()
 {
     return(View(CH.GetAllData <Progress>()));
 }
Exemplo n.º 7
0
 public ViewResult Index()
 {
     return(View(CH.GetAllData <Message>().OrderByDescending(o => o.CreatedDate).ToList()));
 }
 public ActionResult _DeleteAjaxEditing(int id)
 {
     CH.Delete <ProjectType>(id);
     return(View(new GridModel(CH.GetAllData <ProjectType>())));
 }
Exemplo n.º 9
0
 public ViewResult Index()
 {
     return(View(CH.GetAllData <Role>()));
 }