/// <summary> /// 新增人员信息 /// </summary> /// <param name="cus"></param> /// <returns></returns> public bool AddCusInfo(Admin_KSCustomer cus) { DataAccess.Admin_KSCustomer customer = new DataAccess.Admin_KSCustomer(); if (customer != null) { customer.RealName = cus.RealName; customer.RoleID = (int)KSOAEnum.Role.普通员工; customer.CusName = cus.CusName; customer.Gender = cus.Gender; customer.Age = cus.Age; customer.CusPwd = cus.CusPwd; customer.CusEmail = cus.CusEmail; customer.CusPhoneNum = cus.CusPhoneNum; customer.QQ = cus.QQ; } _db.Admin_KSCustomer.AddObject(customer); int result = _db.SaveChanges(); if (result == 1) { return true; } else { return false; } }
/// <summary> /// 新增原创组信息 /// </summary> /// <returns></returns> public bool AddOriginalGroup(Bank_OriginalGroup s, Admin_KSCustomer aks) { DataAccess.Bank_OriginalGroup wnote = new DataAccess.Bank_OriginalGroup(); wnote.OpusCopyright = s.OpusCopyright; wnote.CreationInfo = s.CreationInfo; wnote.OpusName = s.OpusName; wnote.OpusAuthor = s.OpusAuthor; wnote.SalePrice = s.SalePrice; wnote.AccreditPlatform = s.AccreditPlatform; wnote.AccreditCompany = s.AccreditCompany; wnote.AccreditTime = s.AccreditTime; wnote.AccreditType = s.AccreditType; wnote.Awards = s.Awards; wnote.OpusMascot = s.OpusMascot; wnote.AddTime = DateTime.Now; _db.Bank_OriginalGroup.AddObject(wnote); int result = _db.SaveChanges(); if (result == 1) { return true; } else { return false; } }
/// <summary> /// 编辑工作进度 /// </summary> /// <param name="wn"></param> /// <returns></returns> public bool EditSchedule(Work_Schedule wn, Admin_KSCustomer aks, int id) { DataAccess.Work_Schedule wnote = _db.Work_Schedule.Where(s => s.ID == id).FirstOrDefault(); wnote.ItemName = wn.ItemName; wnote.ItemLaunchTime = wn.ItemLaunchTime; wnote.ItemIntro = wn.ItemIntro; wnote.AddTime = DateTime.Now; int result = _db.SaveChanges(); if (result == 1) { return true; } else { return false; } }
/// <summary> /// 编辑作品 /// </summary> /// <param name="wn"></param> /// <returns></returns> public bool EditCommercialOpus(Bank_CommercialOpus wn, Admin_KSCustomer aks, int id) { DataAccess.Bank_CommercialOpus wnote = _db.Bank_CommercialOpus.Where(s => s.ID == id).FirstOrDefault(); wnote.CompanyName = wn.CompanyName; wnote.ChannelAddress = wn.ChannelAddress; wnote.CpAddress = wn.CpAddress; wnote.AddTime = DateTime.Now; int result = _db.SaveChanges(); if (result == 1) { return true; } else { return false; } }
/// <summary> /// 新增项目进度 /// </summary> /// <returns></returns> public bool AddSchedule(Work_Schedule wn, Admin_KSCustomer aks) { DataAccess.Work_Schedule wnote = new DataAccess.Work_Schedule(); wnote.ItemName = wn.ItemName; wnote.ItemLaunchTime = wn.ItemLaunchTime; wnote.ItemIntro = wn.ItemIntro; wnote.AddTime = DateTime.Now; _db.Work_Schedule.AddObject(wnote); int result = _db.SaveChanges(); if (result == 1) { return true; } else { return false; } }
/// <summary> /// 编辑公告 /// </summary> /// <param name="wn"></param> /// <returns></returns> public bool EditNotice(Work_Notice wn, Admin_KSCustomer aks,int id) { DataAccess.Work_Notice wnote = _db.Work_Notice.Where(s => s.ID == id).FirstOrDefault(); wnote.NTitle = wn.NTitle; wnote.NContent = wn.NContent; wnote.NCustomerID = aks.ID; wnote.NCustomerName = aks.CusName; wnote.Nlevel = wnote.Nlevel; int result = _db.SaveChanges(); if (result == 1) { return true; } else { return false; } }
/// <summary> /// 编辑作品 /// </summary> /// <param name="wn"></param> /// <returns></returns> public bool EditOpus(Bank_Opus wn, Admin_KSCustomer aks, int id) { DataAccess.Bank_Opus wnote = _db.Bank_Opus.Where(s => s.ID == id).FirstOrDefault(); wnote.OpTitle = wn.OpTitle; wnote.OpBeginTime = wn.OpBeginTime; wnote.OpAuthor = wn.OpAuthor; wnote.OpType = wn.OpType; wnote.AddTime = DateTime.Now; int result = _db.SaveChanges(); if (result == 1) { return true; } else { return false; } }
/// <summary> /// 新增作品 /// </summary> /// <returns></returns> public bool AddOpus(Bank_Opus s, Admin_KSCustomer aks) { DataAccess.Bank_Opus wnote = new DataAccess.Bank_Opus(); wnote.OpTitle = s.OpTitle; wnote.OpBeginTime = s.OpBeginTime; wnote.OpAuthor = s.OpAuthor; wnote.OpType = s.OpType; wnote.AddTime = DateTime.Now; _db.Bank_Opus.AddObject(wnote); int result = _db.SaveChanges(); if (result == 1) { return true; } else { return false; } }
/// <summary> /// 新增作品 /// </summary> /// <returns></returns> public bool AddCommercialOpus(Bank_CommercialOpus s, Admin_KSCustomer aks) { DataAccess.Bank_CommercialOpus wnote = new DataAccess.Bank_CommercialOpus(); wnote.CompanyName = s.CompanyName; wnote.ChannelAddress = s.ChannelAddress; wnote.CpAddress = s.CpAddress; wnote.OpusID = s.OpusID; wnote.AddTime = DateTime.Now; _db.Bank_CommercialOpus.AddObject(wnote); int result = _db.SaveChanges(); if (result == 1) { return true; } else { return false; } }
/// <summary> /// 新增公告 /// </summary> /// <param name="wn"></param> /// <returns></returns> public bool AddNotice(Work_Notice wn, Admin_KSCustomer aks) { DataAccess.Work_Notice wnote = new DataAccess.Work_Notice(); wnote.NTitle = wn.NTitle; wnote.NContent = wn.NContent; wnote.AddTime = DateTime.Now; wnote.NCustomerID = aks.ID; wnote.NCustomerName = aks.CusName; wnote.Nlevel = wnote.Nlevel; _db.Work_Notice.AddObject(wnote); int result = _db.SaveChanges(); if (result == 1) { return true; } else { return false; } }
/// <summary> /// 新增工作报告 /// </summary> /// <returns></returns> public bool AddWorkNote(Work_Note wn, Admin_KSCustomer aks) { DataAccess.Work_Note wnote = new DataAccess.Work_Note(); wnote.WTitle = wn.WTitle; wnote.WConetent = wn.WConetent; wnote.AddTime = DateTime.Now; wnote.WriterID = aks.ID; wnote.WriterName = aks.CusName; wnote.WType = wn.WType; wnote.WTaster = wn.WTaster; _db.Work_Note.AddObject(wnote); int result = _db.SaveChanges(); if (result == 1) { return true; } else { return false; } }
/// <summary> /// 编辑原创组信息 /// </summary> /// <param name="wn"></param> /// <returns></returns> public bool EditOriginalGroup(Bank_OriginalGroup wn, Admin_KSCustomer aks, int id) { DataAccess.Bank_OriginalGroup wnote = _db.Bank_OriginalGroup.Where(s => s.ID == id).FirstOrDefault(); wnote.OpusCopyright = wn.OpusCopyright; wnote.CreationInfo = wn.CreationInfo; wnote.OpusName = wn.OpusName; wnote.OpusAuthor = wn.OpusAuthor; wnote.SalePrice = wn.SalePrice; wnote.AccreditPlatform = wn.AccreditPlatform; wnote.AccreditCompany = wn.AccreditCompany; wnote.AccreditTime = wn.AccreditTime; wnote.AccreditType = wn.AccreditType; wnote.Awards = wn.Awards; wnote.OpusMascot = wn.OpusMascot; int result = _db.SaveChanges(); if (result == 1) { return true; } else { return false; } }
/// <summary> /// 编辑人员信息 /// </summary> /// <returns></returns> public bool EditCusInfo(Admin_KSCustomer cus, int id) { var customer = _db.Admin_KSCustomer.Where(s => s.ID == id && s.IsDelete == false).FirstOrDefault(); if (customer != null) { customer.RealName = cus.RealName; customer.CusName = cus.CusName; customer.Gender = cus.Gender; customer.Age = cus.Age; customer.CusPwd = cus.CusPwd; customer.CusEmail = cus.CusEmail; customer.CusPhoneNum = cus.CusPhoneNum; customer.QQ = cus.QQ; } int result = _db.SaveChanges(); if (result == 1) { return true; } else { return false; } }
public ActionResult AddPop(FormCollection form) { Admin_KSCustomer aks = new Admin_KSCustomer(); aks.RealName = form["RealName"]; aks.CusName = form["CusName"]; aks.Gender = "Y"; aks.Age = Convert.ToInt32(form["Age"] == "" ? "0" : form["Age"]); aks.CusPwd = form["CusPwd"]; aks.CusEmail = form["CusEmail"] ?? ""; aks.CusPhoneNum = form["CusPhoneNum"] ?? ""; aks.QQ = form["QQ"] ?? ""; if (new Admin_KSCustomerLogic().AddCusInfo(aks)) { ViewBag.msg = "添加成功!"; } else { ViewBag.msg = "添加失败!"; } return View(); }
public ActionResult PopEdit(FormCollection form) { int id = Convert.ToInt32(form["aksID"]); Admin_KSCustomer aks = new Admin_KSCustomer(); aks.RealName = form["RealName"]; aks.CusName = form["CusName"]; aks.Gender = form["Gender"]; aks.Age = Convert.ToInt32(form["Age"]); aks.CusPwd = form["CusPwd"]; aks.CusEmail = form["CusEmail"]; aks.CusPhoneNum = form["CusPhoneNum"]; aks.QQ = form["QQ"]; if (new Admin_KSCustomerLogic().EditCusInfo(aks, id)) { Session["peMsg"] = "修改成功!"; } else { Session["peMsg"] = "修改失败!"; } return RedirectPermanent("../PopEdit/" + id); }
/// <summary> /// 更新用户(密码)信息 /// </summary> /// <param name="cus"></param> /// <returns></returns> public bool UpdateCusInfo(Admin_KSCustomer cus) { var customer = _db.Admin_KSCustomer.Where(s => s.CusName == cus.CusName && s.CusPwd == cus.Oldcuspwd && s.IsDelete == false).FirstOrDefault(); if (customer != null) { customer.CusPwd = cus.CusPwd; } int result = _db.SaveChanges(); if (result == 1) { return true; } else { return false; } }
public ActionResult Managerpwd(FormCollection form) { Admin_KSCustomer cus = new Admin_KSCustomer(); cus.CusName = form["txtUserName"]; cus.CusPwd = form["txtUserPwd"]; cus.Oldcuspwd = form["txtoldpwd"]; cus.RealName = form["txtRealName"] ?? ""; cus.CusPhoneNum = form["txtTelephone"]; cus.CusEmail = form["txtEmail"]; //验证旧密码是否正确 Admin_KSCustomer result = new Admin_KSCustomerLogic().CheckLogin(cus.CusName, cus.Oldcuspwd); if (result != null) { if (new Admin_KSCustomerLogic().UpdateCusInfo(cus)) { Session["mpdMsg"] = "更新成功"; return RedirectToAction("Managerpwd"); } else { Session["mpdMsg"] = "更新失败"; return RedirectToAction("Managerpwd"); } } Session["mpdMsg"] = "旧登录密码错误"; return RedirectToAction("Managerpwd"); }