コード例 #1
0
 /// <summary>
 /// 获取页面数据
 /// </summary>
 private bool GetPageVal(MProfitDistribute model, ref string msg)
 {
     model.Id = Utils.GetInt(Utils.GetFormValue("Id"));
     if (Utils.GetFormValue("radio") == "order")
     {
         model.OrderId   = Utils.GetFormValue("Ids");
         model.OrderCode = Utils.GetFormValue("OrderList");
         msg            += model.OrderId.Length > 0 ? string.Empty : "请选择订单";
     }
     model.TourId   = Utils.GetFormValue("TourId");
     model.TourCode = Utils.GetFormValue("TourCode");
     //分配类型
     model.DistributeType = Utils.GetFormValue(txt_distributeType.ClientID);
     //分配金额
     model.Amount = Utils.GetDecimal(Utils.GetFormValue(txt_amount.ClientID));
     //公司编号
     model.CompanyId = CurrentUserCompanyID;
     //操作时间
     model.IssueTime = DateTime.Now;
     //操作人编号
     model.OperatorId = SiteUserInfo.UserId;
     model.Staff      = Utils.GetFormValue("Staffs");
     model.Gross      = Utils.GetDecimal(Utils.GetFormValue("Price"));
     //备注
     model.Remark = Utils.GetFormValue(txt_remark.ClientID);
     return(msg.Length <= 0);
 }
コード例 #2
0
        /// <summary>
        /// 保存
        /// </summary>
        private void Save()
        {
            string            doType = Utils.GetQueryStringValue("doType");
            MProfitDistribute model  = new MProfitDistribute();
            string            msg    = string.Empty;

            if (GetPageVal(model, ref msg))
            {
                AjaxResponse(UtilsCommons.AjaxReturnJson((model.Id > 0 ? new BFinance().UpdProfitDistribute(model) : new BFinance().AddProfitDistribute(model)) ? "1" : "-1", "提交失败!"));
            }
            else
            {
                AjaxResponse(UtilsCommons.AjaxReturnJson("-1", msg));
            }
        }