示例#1
0
 /// <summary>
 /// 新增或更新销售机会对象
 /// </summary>
 /// <param name="sal"></param>
 public void AddOrUpdateSal(sal_chance sal)
 {
     //补全分配信息
     if (sal.chc_status == 0)
     {
         sal.chc_due_date = DateTime.Now;
     }
     if (sal.chc_due_id > 0)
     {
         sal.chc_due_to = new sys_userRepository().GetUserByUserId(sal.chc_due_id.Value).usr_name;
         sal.chc_status = 1;
     }
     else
     {
         sal.chc_status = 0;
     }
     //新增或修改
     if (sal.chc_id > 0)
     {
         salDao.UpdateSal(sal);
     }
     else
     {
         sal.chc_create_date = DateTime.Now;
         salDao.AddSal(sal);
     }
 }
示例#2
0
        //
        // GET: /SalesLeads/
        /// <summary>
        /// 销售机会管理
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            sal_chance searchEntity = new sal_chance();

            searchEntity.chc_status = 0;
            ViewData["pagerHelper"] = new PageHelper <sal_chance>(new sal_chanceService().GetAllSal(), 1, 3);
            return(View(new sal_chance()));
        }
示例#3
0
        /// <summary>
        /// 根据机会查询对象获得机会集合
        /// </summary>
        /// <param name="searchEntity"></param>
        /// <returns></returns>
        public List <sal_chance> GetSalsBySearchEntity(sal_chance searchEntity)
        {
            List <sal_chance> list = new List <sal_chance>();

            list = (from s in LinqHelper.GetDataContext().sal_chance
                    where s.chc_cust_name.Contains(searchEntity.chc_cust_name == null ? "" : searchEntity.chc_cust_name) &&
                    s.chc_title.Contains(searchEntity.chc_title == null ? "" : searchEntity.chc_title) &&
                    s.chc_linkman.Contains(searchEntity.chc_linkman == null ? "" : searchEntity.chc_linkman)
                    orderby s.chc_id descending
                    select s).ToList();
            return(list);
        }
示例#4
0
        public ActionResult AddSal(FormCollection forms)
        {
            sal_chance sal = new sal_chance();

            ////如果是修改,则补全原有数据
            UpdateModel <sal_chance>(sal);
            if (!(sal.chc_id > 0))
            {
                sal.chc_create_by = (Session["user"] as sys_user).usr_name;
                sal.chc_create_id = (Session["user"] as sys_user).usr_id;
            }
            new sal_chanceService().AddOrUpdateSal(sal);
            return(RedirectToAction("Index"));
        }
示例#5
0
        public ActionResult Index(FormCollection forms)
        {
            int        curPage              = int.Parse(forms["curPage"]);
            sal_chance searchEntity         = new sal_chance();
            Dictionary <string, object> dic = new Dictionary <string, object>();

            foreach (var key in forms.AllKeys)
            {
                dic.Add(key, forms[key]);
            }
            var expression = LinqHelper.GetExpress <sal_chance>(dic);

            var li = new LinqHelper().Db.sal_chance.Where(expression).ToList();

            ViewData["pagerHelper"] = new PageHelper <sal_chance>(li, curPage, 3);
            return(View(searchEntity));
        }
示例#6
0
 /// <summary>
 /// 根据机会查询对象获得已指派的机会集合
 /// </summary>
 /// <param name="searchEntity"></param>
 /// <returns></returns>
 public List <sal_chance> GetAppointSalsBySearchEntity(sal_chance searchEntity)
 {
     return(salDao.GetSalsBySearchEntity(searchEntity).Where(s => s.chc_status > 0).ToList());
 }
示例#7
0
 /// <summary>
 /// 新增销售机会
 /// </summary>
 /// <param name="sal"></param>
 public void AddSal(sal_chance sal)
 {
     helper.InsertEntity <sal_chance>(sal);
 }
示例#8
0
 /// <summary>
 /// 更新销售机会
 /// </summary>
 /// <param name="sal"></param>
 public void UpdateSal(sal_chance sal)
 {
     helper.UpadateEntity <sal_chance>(sal);
 }