public async Task <ActionResult> Create(config_file_third_kind ck) { try { string[] sz = ck.first_kind_name.Split(','); ck.first_kind_id = sz[0]; ck.first_kind_name = sz[1]; string[] sz2 = ck.second_kind_name.Split(','); ck.second_kind_id = sz2[0]; ck.second_kind_name = sz2[1]; int result = await itk.CTKAdd(ck); if (result > 0) { return(RedirectToAction("Index")); } else { return(View(ck)); } } catch (Exception) { return(View(ck)); } }
public ActionResult index(human_file hf) { config_file_first_kind s = ifkb.selectWhere(e => e.first_kind_id == hf.first_kind_id).FirstOrDefault(); config_file_second_kind s1 = iskb.SelectWhere(e => e.second_kind_id == hf.second_kind_id).FirstOrDefault(); config_file_third_kind s2 = itkb.SelectWhere(e => e.third_kind_id == hf.third_kind_id).FirstOrDefault(); config_major s3 = imb.SelectWhere(e => e.major_id == hf.human_major_id).FirstOrDefault(); config_major_kind s4 = imkb.SelectWhere(e => e.major_kind_id == hf.human_major_kind_id).FirstOrDefault(); salary_standard ssd = issdb.SelectWhere(e => e.standard_id == hf.salary_standard_id).FirstOrDefault(); hf.salary_standard_name = ssd.standard_name; hf.first_kind_name = s.first_kind_name; hf.second_kind_name = s1.second_kind_name; hf.third_kind_name = s2.third_kind_name; hf.hunma_major_name = s3.major_name; hf.human_major_kind_name = s4.major_kind_name; hf.check_status = 0; hf.salary_sum = ssd.salary_sum; hf.demand_salaray_sum = ssd.salary_sum; hf.paid_salary_sum = ssd.salary_sum; hf.file_chang_amount = 0; hf.lastly_change_time = DateTime.Now; if (ihdb.Update(hf) > 0) { return(Content("<script>location.href='/Human_file/Top_file/" + hf.huf_id + "'</script>")); } else { return(Content("<script>alert('登记失败');location.href='/Human_file/index'</script>")); } }
public ActionResult third_kind_change(short id) { List <config_file_third_kind> list = thirdbll.config_file_third_kindselectWhere(e => e.ftk_id == id); config_file_third_kind th = list.FirstOrDefault();//转成对象返回一个元素 return(View(th)); }
public Task <int> CTKDel(config_file_third_kind ck) { Econfig_file_third_kind tk = new Econfig_file_third_kind() { ftk_id = ck.ftk_id }; return(Del(tk)); }
/// <summary> /// 按条件查询三级机构 /// </summary> /// <returns></returns> public ActionResult MajorSelect() { config_file_third_kind third = new config_file_third_kind() { second_kind_id = Request["fatherId"] }; List <config_file_third_kind> thirdList = third_bll.GetThird(third); return(Content(JsonConvert.SerializeObject(thirdList))); }
/// <summary> /// 查询三级机构 /// </summary> /// <returns></returns> public ActionResult GetThree() { config_file_third_kind thi = new config_file_third_kind() { second_kind_id = Request["fatherId"] }; List <config_file_third_kind> list = thi_bll.GetThird(thi); return(Content(JsonConvert.SerializeObject(list))); }
public ActionResult third_kind_change(short id) { config_file_third_kind cffk = new config_file_third_kind() { ftk_id = id }; config_file_third_kind cff = cftks.SelectOne(cffk); ViewData.Model = cff; return(View()); }
//删除 public Task <int> Delete(int id) { config_file_third_kind cfsk = new config_file_third_kind() { ftk_id = id }; tescDbContext.third.Attach(cfsk); tescDbContext.third.Remove(cfsk); return(tescDbContext.SaveChangesAsync()); }
public ActionResult third_kind_register(config_file_third_kind t) { if (Itk.Add(t) > 0) { return(Content("<script>window.location.href='/client/third_kind_register_success'</script>")); } else { return(Content("<script>alert('添加失败');window.location.href='/client/third_kind_register'</script>")); } }
public ActionResult third_kind_change_success(config_file_third_kind cffk) { bool pd = cftks.Upd(cffk); if (pd) { return(View()); } else { return(RedirectToAction("third_kind")); } }
public ActionResult third_kind_register_success(config_file_third_kind cftk) { bool pd = cftks.Add(cftk); if (pd) { return(View()); } else { return(RedirectToAction("third_kind")); } }
public ActionResult third_kind_change(config_file_third_kind third) { int num = thirdbll.config_file_third_kindUpdate(third, third.ftk_id); if (num > 0) { return(RedirectToAction("third_kind_change_success")); } else { return(View(num)); } }
public ActionResult third_kind_register(config_file_third_kind third) { int num = thirdbll.config_file_third_kindInsert(third); if (num > 0) { return(RedirectToAction("third_kind_register_success")); } else { return(View()); } }
private static Econfig_file_third_kind GetCs(config_file_third_kind ck) { return(new Econfig_file_third_kind() { ftk_id = ck.ftk_id, first_kind_id = ck.first_kind_id, first_kind_name = ck.first_kind_name, second_kind_id = ck.second_kind_id, second_kind_name = ck.second_kind_name, third_kind_id = ck.third_kind_id, third_kind_name = ck.third_kind_name, third_kind_sale_id = ck.third_kind_sale_id, third_kind_is_retail = ck.third_kind_is_retail, }); }
//删除 public async Task <ActionResult> Delete(int id) { config_file_third_kind ck = new config_file_third_kind() { ftk_id = id }; int result = await itk.CTKDel(ck); if (result > 0) { return(Content("<script>alert('删除成功');window.location.href='/third_kind/Index'</script>")); } else { return(Content("<script>alert('删除失败');window.location.href='/third_kind/Index'</script>")); } }
public ActionResult third_delete_success(short id) { config_file_third_kind cffk = new config_file_third_kind() { ftk_id = id }; bool pd = cftks.Del(cffk); if (pd) { return(View()); } else { return(RedirectToAction("third_kind")); } }
//修改 public ActionResult Edit(int id) { Econfig_file_third_kind ck = hr.Econfig_file_third_kind.AsNoTracking().Where(e => e.ftk_id.Equals(id)).FirstOrDefault(); config_file_third_kind st2 = new config_file_third_kind() { ftk_id = ck.ftk_id, first_kind_id = ck.first_kind_id, first_kind_name = ck.first_kind_name, second_kind_id = ck.second_kind_id, second_kind_name = ck.second_kind_name, third_kind_id = ck.third_kind_id, third_kind_name = ck.third_kind_name, third_kind_sale_id = ck.third_kind_sale_id, third_kind_is_retail = ck.third_kind_is_retail }; return(View(st2)); }
//添加 public async Task <int> ADD(config_file_third_kindModel1 cftkm) { config_file_third_kind cffsk = new config_file_third_kind() { first_kind_id = cftkm.first_kind_id, first_kind_name = cftkm.first_kind_name, ftk_id = cftkm.ftk_id, second_kind_id = cftkm.second_kind_id, second_kind_name = cftkm.second_kind_name, third_kind_id = cftkm.third_kind_id, third_kind_is_retail = cftkm.third_kind_is_retail, third_kind_name = cftkm.third_kind_name, third_kind_sale_id = cftkm.third_kind_sale_id }; tescDbContext.third.Add(cffsk); return(await tescDbContext.SaveChangesAsync()); }
//修改查询 public async Task <config_file_third_kindModel1> UpSelect(int id) { config_file_third_kind cffsk = await tescDbContext.third.FindAsync(id); config_file_third_kindModel1 cffskm = new config_file_third_kindModel1() { first_kind_id = cffsk.first_kind_id, first_kind_name = cffsk.first_kind_name, ftk_id = cffsk.ftk_id, second_kind_id = cffsk.second_kind_id, second_kind_name = cffsk.second_kind_name, third_kind_id = cffsk.third_kind_id, third_kind_is_retail = cffsk.third_kind_is_retail, third_kind_name = cffsk.third_kind_name, third_kind_sale_id = cffsk.third_kind_sale_id }; return(cffskm); }
//修改 public async Task <int> Update(config_file_third_kindModel1 cftkm) { config_file_third_kind cftk = new config_file_third_kind() { first_kind_id = cftkm.first_kind_id, first_kind_name = cftkm.first_kind_name, ftk_id = cftkm.ftk_id, second_kind_id = cftkm.second_kind_id, second_kind_name = cftkm.second_kind_name, third_kind_id = cftkm.third_kind_id, third_kind_is_retail = cftkm.third_kind_is_retail, third_kind_name = cftkm.third_kind_name, third_kind_sale_id = cftkm.third_kind_sale_id }; tescDbContext.third.Attach(cftk); tescDbContext.Entry(cftk).State = Microsoft.EntityFrameworkCore.EntityState.Modified; return(await tescDbContext.SaveChangesAsync()); }
public ActionResult third_kind_change(config_file_third_kind t) { config_file_third_kind list = Itk.SelectWhere(t.ftk_id).FirstOrDefault(); list.first_kind_name = t.first_kind_name; list.second_kind_name = t.second_kind_name; list.second_kind_id = t.second_kind_id; list.third_kind_name = t.third_kind_name; list.third_kind_sale_id = t.third_kind_sale_id; t.third_kind_is_retail = t.third_kind_is_retail; if (Itk.Change(list) > 0) { return(Content("<script>window.location.href='/client/third_kind_change_success'</script>")); } else { return(Content("<script>alert('修改失败');window.location.href='/client/third_kind_change'</script>")); } }
public async Task <ActionResult> Edit(config_file_third_kind st) { try { string[] ps = new string[] { "ftk_id", "first_kind_id", "first_kind_name", "second_kind_id", "second_kind_name", "third_kind_id", "third_kind_name", "third_kind_sale_id", "third_kind_is_retail" }; int result = await itk.CTKUpdate(st, ps); if (result > 0) { return(RedirectToAction("Index")); } else { return(View(st)); } } catch (Exception ex) { throw ex; } }
public ActionResult Carate(engage_major_release en) { config_file_first_kind s = ifkb.selectWhere(e => e.first_kind_id == en.first_kind_id).FirstOrDefault(); config_file_second_kind s1 = iskb.SelectWhere(e => e.second_kind_id == en.second_kind_id).FirstOrDefault(); config_file_third_kind s2 = itkb.SelectWhere(e => e.third_kind_id == en.third_kind_id).FirstOrDefault(); config_major s3 = imb.SelectWhere(e => e.major_id == en.major_id).FirstOrDefault(); config_major_kind s4 = imkb.SelectWhere(e => e.major_kind_id == en.major_kind_id).FirstOrDefault(); //string sa= ; en.first_kind_name = s.first_kind_name; en.second_kind_name = s1.second_kind_name; en.third_kind_name = s2.third_kind_name; en.major_name = s3.major_name; en.major_kind_name = s4.major_kind_name; if (imrb.Add(en) > 0) { return(Content("<script>alert('发布成功');location.href='/Major_release/Index2'</script>")); } else { return(Content("<script>alert('发布失败');location.href='/Major_release/Index'</script>")); } }
public async Task <List <config_file_third_kind> > CTKSelect() { List <Econfig_file_third_kind> cs = await GetAll(); List <config_file_third_kind> cs2 = new List <config_file_third_kind>(); foreach (var ck in cs) { config_file_third_kind st = new config_file_third_kind() { ftk_id = ck.ftk_id, first_kind_id = ck.first_kind_id, first_kind_name = ck.first_kind_name, second_kind_id = ck.second_kind_id, second_kind_name = ck.second_kind_name, third_kind_id = ck.third_kind_id, third_kind_name = ck.third_kind_name, third_kind_sale_id = ck.third_kind_sale_id, third_kind_is_retail = ck.third_kind_is_retail, }; cs2.Add(st); } return(cs2); }
public config_file_third_kind SelectOne(config_file_third_kind us) { return(ist.SelectBy(e => e.ftk_id == us.ftk_id)[0]); }
public Task <int> CTKUpdate(config_file_third_kind ck, params string[] ps) { Econfig_file_third_kind cs = GetCs(ck); return(Update(cs, ps)); }
public int Del(config_file_third_kind t) { return(dao.Del(t)); }
public int Change(config_file_third_kind t) { return(dao.Change(t)); }
public int Add(config_file_third_kind t) { return(dao.Add(t)); }
public Task <int> CTKAdd(config_file_third_kind ck) { Econfig_file_third_kind cs = GetCs(ck); return(Add(cs)); }