public ActionResult Create(FormCollection fc) { var model = new tblteams(); model.teamid = Guid.NewGuid().ToString(); model.Teamname = fc["Teamname"].ToString(); model.Userid = fc["Userid"]; model.Company = fc["optCompany"].ToString(); model.Lineid = fc["optLine"].ToString(); model.Createtime = DateTime.Now; model.Status = Int32.Parse(fc["optStatus"].ToString()); var bll = new TeamBll(); try { bll.AddTeam(model); } catch (ValidException ex) { this.ModelState.AddModelError(ex.Name, ex.Message); return(View(model)); } return(this.RefreshParent()); }
public JsonResult CheckTeamName(string Teamname) { bool isValidate = true; var tblteam = new TeamBll().GetTeamByName(Teamname); if (tblteam != null) { isValidate = false; } return(Json(isValidate, JsonRequestBehavior.AllowGet)); }
// // GET: /Main/Team/ public ActionResult Index(string teamname, string company, int?pageIndex) { var teams = new List <tblteamsVew>(); try { teams = new TeamBll().GetTeams(teamname, company, pageIndex.GetValueOrDefault(1)); } catch (Exception e) { } return(View(teams)); }
public ActionResult Delete(List <string> ids) { var bll = new TeamBll(); try { bll.DeleteTeam(ids); } catch (ValidException ex) { return(Alert(ex.Message)); } return(RedirectToAction("Index")); }
public ActionResult Edit(string id, FormCollection fc) { var bll = new TeamBll(); var model = bll.GetTeamById(id); model.Userid = fc["Userid"]; model.Company = fc["optCompany"].ToString(); model.Lineid = fc["optLine"].ToString(); model.Status = Int32.Parse(fc["optStatus"].ToString()); try { bll.EditTeam(model); } catch (ValidException ex) { this.ModelState.AddModelError(ex.Name, ex.Message); List <SelectListItem> company = bll.GetCompany(); List <SelectListItem> line = bll.GetLine(); List <SelectListItem> Status = new MemberBll().GetDict(3); foreach (SelectListItem r in company) { ViewBag.company += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } foreach (SelectListItem r in line) { ViewBag.line += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } foreach (SelectListItem r in Status) { ViewBag.Status += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } return(View(model)); } return(this.RefreshParent()); }
public ActionResult Create() { var bll = new TeamBll(); List <SelectListItem> company = bll.GetCompany(); List <SelectListItem> line = bll.GetLine(); List <SelectListItem> Status = new MemberBll().GetDict(3); foreach (SelectListItem r in company) { ViewBag.company += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } foreach (SelectListItem r in line) { ViewBag.line += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } foreach (SelectListItem r in Status) { ViewBag.Status += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } return(View()); }
public ActionResult Edit(string id) { var bll = new TeamBll(); var model = bll.GetTeamById(id); List <SelectListItem> company = bll.GetCompany(); List <SelectListItem> line = bll.GetLine(); List <SelectListItem> Status = new MemberBll().GetDict(3); foreach (SelectListItem r in company) { if (model.Company != null) { if (model.Company.ToString() == r.Value) { ViewBag.company += "<option value='" + r.Value.ToString() + "'selected>" + r.Text.ToString() + "</option>"; } else { ViewBag.company += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } } else { if (r.Value == "3cd53ba4-5c76-11e6-a2c5-6c92bf314f0b") { ViewBag.company += "<option value='" + r.Value.ToString() + "'selected>" + r.Text.ToString() + "</option>"; } else { ViewBag.company += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } } } foreach (SelectListItem r in line) { if (model.Lineid.ToString() == r.Value) { ViewBag.line += "<option value='" + r.Value.ToString() + "'selected>" + r.Text.ToString() + "</option>"; } else { ViewBag.line += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } } foreach (SelectListItem r in Status) { if (model.Status.ToString() == r.Value) { ViewBag.Status += "<option value='" + r.Value.ToString() + "'selected>" + r.Text.ToString() + "</option>"; } else { ViewBag.Status += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } } return(View(model)); }
public void createpay(string teamid) { MembershipBll bll = new MembershipBll(); var order = bll.GetOrderByTeamId(teamid); var cnt = new TeamBll().GetPaycountByTeamid(teamid); var tm = new TeamRegBll().GetTeamById(teamid); if (tm.Teamtype != 1) { string msg = bll.CheckPay(order.Id, cnt, order.Match_Id); if (!string.IsNullOrEmpty(msg) && msg != "正在支付,请等待") { ViewBag.msg = msg; return; } } //商户订单号,商户网站订单系统中唯一订单号,必填 string out_trade_no = order.Orderid; //订单名称,必填 string subject = order.Title; //付款金额,必填 string total_fee = order.Ordertotal; //商品描述,可空 string body = order.Title; ViewBag.title = order.Title; ViewBag.total = order.Ordertotal; //把请求参数打包成数组 SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>(); sParaTemp.Add("service", Config.service); sParaTemp.Add("partner", Config.partner); sParaTemp.Add("seller_id", Config.seller_id); sParaTemp.Add("_input_charset", Config.input_charset.ToLower()); sParaTemp.Add("payment_type", Config.payment_type); sParaTemp.Add("notify_url", Config.notify_url); sParaTemp.Add("return_url", Config.return_url); sParaTemp.Add("anti_phishing_key", Config.anti_phishing_key); sParaTemp.Add("exter_invoke_ip", Config.exter_invoke_ip); sParaTemp.Add("out_trade_no", out_trade_no); sParaTemp.Add("subject", subject); sParaTemp.Add("total_fee", total_fee); sParaTemp.Add("body", body); sParaTemp.Add("it_b_pay", Config.it_b_pay); //其他业务参数根据在线开发文档,添加参数.文档地址:https://doc.open.alipay.com/doc2/detail.htm?spm=a219a.7629140.0.0.O9yorI&treeId=62&articleId=103740&docType=1 //如sParaTemp.Add("参数名","参数值"); //建立请求 string sHtmlText = Submit.BuildRequest(sParaTemp, "get", "确认"); Response.Write(sHtmlText); }