public JsonResult UpdateDz() { string id = Request["id"] ?? ""; string songhuodz = Request["songhuodz"] ?? ""; string Lianxiren = Request["Lianxiren"] ?? ""; string Lianxidianhua = Request["Lianxidianhua"] ?? ""; int uid = int.Parse(id); try { base_shouhuodanwei p = ob_base_shouhuodanweiservice.GetEntityById(base_shouhuodanwei => base_shouhuodanwei.ID == uid); p.SonghuoDZ = songhuodz.Trim(); p.Lianxiren = Lianxiren.Trim(); p.LianxiDH = Lianxidianhua.Trim(); ob_base_shouhuodanweiservice.UpdateEntity(p); ViewBag.saveok = ViewAddTag.ModifyOk; } catch (Exception ex) { Console.WriteLine(ex.Message); ViewBag.saveok = ViewAddTag.ModifyNo; } return(Json(1)); }
public ActionResult Edit(int id) { base_shouhuodanwei tempData = ob_base_shouhuodanweiservice.GetEntityById(base_shouhuodanwei => base_shouhuodanwei.ID == id && base_shouhuodanwei.IsDelete == false); ViewBag.base_shouhuodanwei = tempData; return(View()); }
public ActionResult Update() { string id = Request["id"] ?? ""; string huozhuid = Request["huozhuid"] ?? ""; string mingcheng = Request["mingcheng"] ?? ""; string yingyezhizhaobh = Request["yingyezhizhaobh"] ?? ""; string yingyezhizhaoyxq = Request["yingyezhizhaoyxq"] ?? ""; string yingyezhizhaotp = Request["yingyezhizhaotp"] ?? ""; string jingyingxukebh = Request["jingyingxukebh"] ?? ""; string jingyingxukeyxq = Request["jingyingxukeyxq"] ?? ""; string jingyingxuketp = Request["jingyingxuketp"] ?? ""; string shouying = Request["shouying"] ?? ""; string makedate = Request["makedate"] ?? ""; string makeman = Request["makeman"] ?? ""; string jingyingfanwei = Request["jingyingfanwei"] ?? ""; string jingyingfanweidm = Request["jingyingfanweidm"] ?? ""; string quyu = Request["quyu"] ?? ""; string beianbh = Request["beianbh"] ?? ""; string beianyxq = Request["beianyxq"] ?? ""; string beianpzrq = Request["beianpzrq"] ?? ""; string beianfzjg = Request["beianfzjg"] ?? ""; string beiantp = Request["beiantp"] ?? ""; string xukepzrq = Request["xukepzrq"] ?? ""; string xukefzjg = Request["xukefzjg"] ?? ""; string qiyedz = Request["qiyedz"] ?? ""; string songhuodz = Request["songhuodz"] ?? ""; string shenchasf = Request["shenchasf"] ?? ""; string hezuosf = Request["hezuosf"] ?? ""; if (shenchasf.IndexOf("true") > -1) { shenchasf = "true"; } if (hezuosf.IndexOf("true") > -1) { hezuosf = "true"; } string Lianxiren = Request["Lianxiren"] ?? ""; string LianxiDH = Request["LianxiDH"] ?? ""; int uid = int.Parse(id); try { base_shouhuodanwei p = ob_base_shouhuodanweiservice.GetEntityById(base_shouhuodanwei => base_shouhuodanwei.ID == uid); p.HuozhuID = huozhuid == "" ? 0 : int.Parse(huozhuid); p.Mingcheng = mingcheng.Trim(); p.YingyezhizhaoBH = yingyezhizhaobh.Trim(); p.YingyezhizhaoYXQ = yingyezhizhaoyxq == "" ? DateTime.Now : DateTime.Parse(yingyezhizhaoyxq); p.YingyezhizhaoTP = yingyezhizhaotp.Trim(); p.JingyingxukeBH = jingyingxukebh.Trim(); p.JingyingxukeYXQ = jingyingxukeyxq == "" ? DateTime.Now : DateTime.Parse(jingyingxukeyxq); p.JingyingxukeTP = jingyingxuketp.Trim(); p.Shouying = shouying == "" ? 0 : int.Parse(shouying); p.MakeDate = makedate == "" ? DateTime.Now : DateTime.Parse(makedate); p.MakeMan = makeman == "" ? 0 : int.Parse(makeman); p.Jingyinfanwei = jingyingfanwei.Trim(); p.JingyinfanweiDM = jingyingfanweidm.Trim(); p.Quyu = quyu.Trim(); p.BeianBH = beianbh.Trim(); p.BeianYXQ = beianyxq == "" ? DateTime.Now : DateTime.Parse(beianyxq); p.BeianPZRQ = beianpzrq == "" ? DateTime.Now : DateTime.Parse(beianpzrq); p.BeianFZJG = beianfzjg.Trim(); p.BeianTP = beiantp.Trim(); p.XukePZRQ = xukepzrq == "" ? DateTime.Now : DateTime.Parse(xukepzrq); p.XukeFZJG = xukefzjg.Trim(); p.QiyeDZ = qiyedz.Trim(); p.SonghuoDZ = songhuodz.Trim(); p.ShenchaSF = shenchasf == "" ? false : Boolean.Parse(shenchasf); p.HezuoSF = hezuosf == "" ? false : Boolean.Parse(hezuosf); p.Lianxiren = Lianxiren.Trim(); p.LianxiDH = LianxiDH.Trim(); ob_base_shouhuodanweiservice.UpdateEntity(p); ViewBag.saveok = ViewAddTag.ModifyOk; } catch (Exception ex) { Console.WriteLine(ex.Message); ViewBag.saveok = ViewAddTag.ModifyNo; } return(RedirectToAction("Edit", new { id = int.Parse(id) })); }
public ActionResult Save() { string id = Request["id"] ?? ""; string huozhuid = Request["huozhuid"] ?? ""; string mingcheng = Request["mingcheng"] ?? ""; string yingyezhizhaobh = Request["yingyezhizhaobh"] ?? ""; string yingyezhizhaoyxq = Request["yingyezhizhaoyxq"] ?? ""; string yingyezhizhaotp = Request["yingyezhizhaotp"] ?? ""; string jingyingxukebh = Request["jingyingxukebh"] ?? ""; string jingyingxukeyxq = Request["jingyingxukeyxq"] ?? ""; string jingyingxuketp = Request["jingyingxuketp"] ?? ""; string shouying = Request["shouying"] ?? ""; string makedate = Request["makedate"] ?? ""; string makeman = Request["makeman"] ?? ""; string jingyingfanwei = Request["jingyingfanwei"] ?? ""; string jingyingfanweidm = Request["jingyingfanweidm"] ?? ""; string quyu = Request["quyu"] ?? ""; string beianbh = Request["beianbh"] ?? ""; string beianyxq = Request["beianyxq"] ?? ""; string beianpzrq = Request["beianpzrq"] ?? ""; string beianfzjg = Request["beianfzjg"] ?? ""; string beiantp = Request["beiantp"] ?? ""; string xukepzrq = Request["xukepzrq"] ?? ""; string xukefzjg = Request["xukefzjg"] ?? ""; string qiyedz = Request["qiyedz"] ?? ""; string songhuodz = Request["songhuodz"] ?? ""; string shenchasf = Request["shenchasf"] ?? ""; string hezuosf = Request["hezuosf"] ?? ""; if (shenchasf.IndexOf("true") > -1) { shenchasf = "true"; } if (hezuosf.IndexOf("true") > -1) { hezuosf = "true"; } try { base_shouhuodanwei ob_base_shouhuodanwei = new base_shouhuodanwei(); ob_base_shouhuodanwei.HuozhuID = huozhuid == "" ? 0 : int.Parse(huozhuid); ob_base_shouhuodanwei.Mingcheng = mingcheng.Trim(); ob_base_shouhuodanwei.YingyezhizhaoBH = yingyezhizhaobh.Trim(); ob_base_shouhuodanwei.YingyezhizhaoYXQ = yingyezhizhaoyxq == "" ? DateTime.Now : DateTime.Parse(yingyezhizhaoyxq); ob_base_shouhuodanwei.YingyezhizhaoTP = yingyezhizhaotp.Trim(); ob_base_shouhuodanwei.JingyingxukeBH = jingyingxukebh.Trim(); ob_base_shouhuodanwei.JingyingxukeYXQ = jingyingxukeyxq == "" ? DateTime.Now : DateTime.Parse(jingyingxukeyxq); ob_base_shouhuodanwei.JingyingxukeTP = jingyingxuketp.Trim(); //ob_base_shouhuodanwei.Shouying = shouying == "" ? 0 : int.Parse(shouying); ob_base_shouhuodanwei.Shouying = 1; ob_base_shouhuodanwei.MakeDate = makedate == "" ? DateTime.Now : DateTime.Parse(makedate); ob_base_shouhuodanwei.MakeMan = makeman == "" ? 0 : int.Parse(makeman); ob_base_shouhuodanwei.Jingyinfanwei = jingyingfanwei.Trim(); ob_base_shouhuodanwei.JingyinfanweiDM = jingyingfanweidm.Trim(); ob_base_shouhuodanwei.Quyu = quyu.Trim(); ob_base_shouhuodanwei.BeianBH = beianbh.Trim(); ob_base_shouhuodanwei.BeianYXQ = beianyxq == "" ? DateTime.Now : DateTime.Parse(beianyxq); ob_base_shouhuodanwei.BeianPZRQ = beianpzrq == "" ? DateTime.Now : DateTime.Parse(beianpzrq); ob_base_shouhuodanwei.BeianFZJG = beianfzjg.Trim(); ob_base_shouhuodanwei.BeianTP = beiantp.Trim(); ob_base_shouhuodanwei.XukePZRQ = xukepzrq == "" ? DateTime.Now : DateTime.Parse(xukepzrq); ob_base_shouhuodanwei.XukeFZJG = xukefzjg.Trim(); ob_base_shouhuodanwei.ShenchaSF = shenchasf == "" ? false : Boolean.Parse(shenchasf); ob_base_shouhuodanwei.HezuoSF = hezuosf == "" ? false : Boolean.Parse(hezuosf); ob_base_shouhuodanwei.QiyeDZ = qiyedz.Trim(); ob_base_shouhuodanwei.SonghuoDZ = songhuodz.Trim(); ob_base_shouhuodanwei = ob_base_shouhuodanweiservice.AddEntity(ob_base_shouhuodanwei); id = ob_base_shouhuodanwei.ID.ToString(); ViewBag.base_shouhuodanwei = ob_base_shouhuodanwei; } catch (Exception ex) { Console.WriteLine(ex.Message); } return(RedirectToAction("Edit", new { id = int.Parse(id) })); }