public void Arrive_Add(M_Arrive avMod) { M_Store_Info storeMod = storeBll.SelModelByUser(mu.UserID); if (Mid < 1)//添加优惠券 { avMod.CUser = mu.UserID; avMod.StoreID = storeMod.ID; avMod.State = DataConvert.CLng(Request.Form["state_chk"]); int num = DataConverter.CLng(Request.Form["txtCreateNum"]); CommonReturn retMod = avBll.CreateArrive(avMod, num, "1", Request.Form["UserID_Hid"]); if (retMod.isok) { function.WriteSuccessMsg("批量添加成功!", "ArriveManage"); } else { function.WriteErrMsg(retMod.err); } } else { avMod = avBll.SelReturnModel(Mid); avMod.ArriveName = Request.Form["ArriveName"]; avMod.Amount = DataConvert.CLng(Request.Form["Amount"]); avMod.MinAmount = Convert.ToDouble(Request.Form["MinAmount"]); avMod.MaxAmount = Convert.ToDouble(Request.Form["MaxAmount"]); avMod.AgainTime = DataConvert.CDate(Request.Form["AgainTime"]); avMod.EndTime = DataConvert.CDate(Request.Form["EndTime"]); avBll.GetUpdate(avMod); function.WriteSuccessMsg("修改成功!", "ArriveManage"); } }
public IActionResult ArriveAdd_Submit() { M_Arrive avMod = new M_Arrive(); if (Mid > 0) { avMod = avBll.SelReturnModel(Mid); } avMod.ArriveName = GetParam("txtName"); avMod.MinAmount = DataConverter.CDouble(GetParam("minAmount_T")); avMod.MaxAmount = DataConverter.CDouble(GetParam("maxAmount_T")); avMod.Amount_Max = DataConverter.CDouble(GetParam("Amount2_Max")); avMod.DateDays = DataConverter.CLng(GetParam("DateDays_T")); avMod.AgainTime = DataConverter.CDate(GetParam("AgainTime_T")); avMod.EndTime = DataConverter.CDate(GetParam("EndTime_T")); avMod.Type = DataConverter.CLng(Request.Form["Type_Rad"]); avMod.DateType = DataConverter.CLng(Request.Form["date_rad"]); avMod.ProIDS = GetParam("UProIDS_Hid"); avMod.StoreID = DataConverter.CLng(GetParam("Store_DP")); avMod.State = DataConvert.CLng(GetParam("state_chk")); avMod.CAdmin = adminMod.AdminId; switch (avMod.Type) { case 1: avMod.Amount = DataConverter.CDouble(GetParam("Amount2_T")); break; default: avMod.Amount = DataConverter.CDouble(GetParam("Amount_T")); break; } //---------------------------------------- if (avMod.ID < 1)//添加优惠券 { int num = DataConverter.CLng(GetParam("txtCreateNum")); CommonReturn retMod = avBll.CreateArrive(avMod, num, GetParam("EcodeType"), GetParam("UserID_Hid")); if (retMod.isok) { return(WriteOK("批量添加成功!", "ArriveManage?name=" + avMod.ArriveName)); } else { return(WriteErr(retMod.err)); } } else { avMod.ArriveNO = GetParam("txtNo"); avMod.ArrivePwd = GetParam("txtPwd"); avBll.GetUpdate(avMod); return(WriteOK("操作成功", "ArriveManage")); } }