Exemple #1
0
        public ActionResult Detail(Guid ID)
        {
            var model = Customer.FindByIdAndCrId(ID, DBUserInfo.UserID.ToGuid());

            if (model != null)
            {
                var query = from row in Order.GetList("CusID='{0}' AND CrUserID='{1}'".FormatWith(ID, DBUserInfo.UserID)).AsEnumerable()
                            select new OrderQuery
                {
                    CrTime    = row.Field <DateTime>("CrTime").ToString("yyyy-MM-dd"),
                    CusName   = row.Field <string>("CusName"),
                    CusPhone  = row.Field <string>("CusPhone"),
                    ID        = row.Field <int>("ID"),
                    Name      = row.Field <string>("Name"),
                    OrderNo   = row.Field <string>("OrderNo"),
                    ProMoney  = row.Field <decimal>("ProMoney"),
                    State     = row.Field <string>("State"),
                    StateInfo = row.Field <string>("StateInfo"),
                    TrueName  = row.Field <string>("TrueName"),
                    UserName  = row.Field <string>("UserName")
                };
                ViewBag.OrderList = query.ToList();

                ViewBag.StateList = BasicInfoContent.GetBasicContent(StateType.OrderSate);

                return(View(model));
            }
            else
            {
                FileHelper.WriteLog("ID={0} UID={1}的客户没有查到".FormatWith(ID, DBUserInfo.UserID));
                return(RedirectToAction("ErrorPage", "Error", new { msg = "没有查询到客户" }));
            }
        }
Exemple #2
0
 public ActionResult BasicContentAdd(BasicInfoContent model)
 {
     if (model.TypeName.IsEmpty())
     {
         ModelState.AddModelError(nameof(model.TypeName), "请输入名称");
     }
     else if (model.TypeID == 0)
     {
         ModelState.AddModelError(nameof(model.TypeID), "请输入类型");
     }
     else
     {
         if (ModelState.IsValid)
         {
             if (model.ID == 0)
             {
                 //新增
                 model.CrTime   = model.UpTime = DateTime.Now;
                 model.CrUserId = LUser.UserId.ToGuid();
                 model.CreateAndFlush();
             }
             else
             {
                 model.UpTime = DateTime.Now;
                 model.UpUser = LUser.UserName;
                 model.UpdateAndFlush();
             }
             return(RedirectToAction("BasicContentList"));
         }
     }
     return(View(model));
 }
Exemple #3
0
 public ActionResult BasicContentAdd()
 {
     ViewBag.BasicTypeList = BasicInfoType.GetTypeList();
     if (Request.RequestContext.RouteData.Values["id"] != null)
     {
         ViewBag.Title = "基本代码修改";
         var model = BasicInfoContent.TryFind(Request.RequestContext.RouteData.Values["id"].ToString().ToInt());
         return(View(model));
     }
     else
     {
         var model = new BasicInfoContent();
         model.ID      = 0;
         model.DelFlag = false;
         model.TypeID  = BasicInfoContent.GetMaxSeq() + 1;
         model.CrUser  = LUser.UserName;
         model.UpUser  = LUser.UserName;
         return(View(model));
     }
 }
Exemple #4
0
        public ActionResult BasicContentList()
        {
            var query = from row in BasicInfoContent.GetBasicContentList().AsEnumerable()
                        select new BasicInfoContent
            {
                CrTime        = row.Field <DateTime>("CrTime"),
                CrUser        = row.Field <string>("CrUser"),
                CrUserId      = row.Field <Guid>("CrUserId"),
                DelFlag       = row.Field <bool>("DelFlag"),
                ID            = row.Field <int>("ID"),
                TypeID        = row.Field <int>("TypeID"),
                TypeName      = row.Field <string>("TypeName"),
                UpTime        = row.Field <DateTime>("UpTime"),
                UpUser        = row.Field <string>("UpUser"),
                BasicTypeName = row.Field <string>("BasicTypeName"),
                SequenceOrder = row.Field <int>("SequenceOrder")
            };

            ViewBag.Source = query.ToList();
            return(View());
        }