Пример #1
0
 public int CreateOrder(OrderDto dto)
 {
     dto.OrderNo = DateTime.Now.ToString("yyyyMMddHHmmssfffffff");    //互助单号
     Dictionary<string, object> dic;
     int result = 0;
     _dal.CreateOrder(dto.OrderNo, dto.PeoperNum, dto.PeoperIds, dto.PeoperMoney, dto.LowestMoney, dto.TouUserid, (int)dto.MoneySendType, dto.MeetType, dto.MeetNum, dto.Meetextnum, dto.FirstDate, dto.FirstExtraDate, dto.ExtraDate,dto.Address, dto.Remark, out dic);
     if (Convert.ToInt32(dic["@ReturnValue"]) == 1)
     {
         result = 1;
     }
     return result;
 }
Пример #2
0
        /// <summary>
        /// 创建会单
        /// </summary>
        /// <returns></returns>
        public ActionResult CreateOrder()
        {
            if (Session["uid"] == null)
            {
                return JsonFormat(new ExtJsonPage { success = false, code = -1000, msg = "登入状态已失效!" });
            }
            string TouUserid = Session["uid"].ToString();
            string PeoperNum = Request.Form["peonum"];              //会员人数
            string Peoper = Request.Form["uids"];                   //会员列表
            string PeoperMoney = Request.Form["peomoney"];          //会费金额
            string LowestMoney = Request.Form["lowestmoney"];       //最低标会金额
            string Remark = Request.Form["remark"];                 //备注
            string MoneySendType = Request.Form["moneystype"];      //会费发放方式
            string MeetType = Request.Form["meettype"];             //标会类型
            string MeetNum = Request.Form["meetnum"];               //每N月标会次数
            string Meetextnum = Request.Form["meetextnum"];         //每N月加标次数
            string Address = Request.Form["address"];               //标会地址
            string FirstDate = Request.Form["firstdate"];           //首次标会日期
            string FirstExtraDate = CommonManager.WebObj.RequestForm("firstextradate", DateTime.Now.ToString());            //首次加标日期时间
            string ExtraDate = CommonManager.WebObj.RequestForm("extradate", "");            //自定义加标日期列表

            OrderDto dto = new OrderDto();
            dto.PeoperNum = Convert.ToInt32(PeoperNum);
            IList<UListDto> list = SerializeJson<UListDto>.JSONStringToList(Peoper);    //会员列表
            dto.PeoperIds = _bll.ListToString(list);    //会员ids
            dto.PeoperMoney = Convert.ToInt32(PeoperMoney);
            dto.LowestMoney = Convert.ToInt32(LowestMoney);
            dto.Remark = Remark;
            dto.TouUserid = Convert.ToInt32(TouUserid);
            dto.MoneySendType = (MnSdTypeEnum)Convert.ToInt32(MoneySendType);
            dto.MeetType = Convert.ToInt32(MeetType);
            dto.MeetNum = Convert.ToInt32(MeetNum);
            dto.Meetextnum = Convert.ToInt32(Meetextnum);
            //if (dto.MeetType == 1 || dto.MeetType == 2) {
            //    dto.MeetNum = 1;
            //}
            dto.Address = Address;
            dto.FirstDate = Convert.ToDateTime(FirstDate);
            if (!string.IsNullOrEmpty(FirstExtraDate))
            {
                dto.FirstExtraDate = Convert.ToDateTime(FirstExtraDate);
            }
            int result = _bll.CreateOrder(dto);
            if (result == 1)
            {
                return JsonFormat(new ExtJson { success = true, msg = "添加成功!" });
            }
            else {
                return JsonFormat(new ExtJson { success = false, msg = "添加失败!" });
            }
        }
Пример #3
0
 public ActionResult AddOrder()
 {
     OrderDto dto = new OrderDto();
     dto.OrderNo = DateTime.Now.ToString("yyyyMMddHHmmssfffffff");
     dto.PeoperNum = 20;
     dto.PeoperMoney = 2000;
     dto.MoneySendType = (MnSdTypeEnum)1;
     dto.MeetType = 1;
     dto.MeetNum = 1;
     dto.FirstExtraDate = DateTime.Now;
     dto.ExtraDate = "";
     dto.InputDate = DateTime.Now;
     dto.State = 1;
     dto.Remark = "测试";
     _bll.AddOrder(dto);
     return JsonFormat(new ExtJson { success = true, msg = "添加成功!" });
 }
Пример #4
0
 /// <summary>
 /// 添加会单
 /// </summary>
 /// <param name="dto"></param>
 public void AddOrder(OrderDto dto)
 {
     if (dto == null)
         throw new ArgumentNullException();
     var _unitOfWork = _repostory.UnitOfWork;
     var _build = OrderFactory.Create(
         dto.OrderNo,
         dto.PeoperNum,
         dto.PeoperMoney,
         (int)dto.MoneySendType,
         dto.MeetType,
         dto.MeetNum,
         dto.FirstExtraDate,
         dto.ExtraDate,
         dto.InputDate,
         dto.State,
         dto.Remark
         );
     _repostory.Add(_build);
     _unitOfWork.Commit();
 }