public async Task <IHttpActionResult> PutJF_Tasks(Guid id, JF_Tasks jF_Tasks) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != jF_Tasks.TasksID) { return(BadRequest()); } db.Entry(jF_Tasks).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!JF_TasksExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <ActionResult> Create([Bind(Include = "DDid,DDCode,DDName,DDType,DDSort")] SYS_DD sys_dd) { if (ModelState.IsValid) { sys_dd.DDid = Guid.NewGuid(); db.SYS_DD.Add(sys_dd); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(sys_dd)); }
public async Task <ActionResult> Create([Bind(Include = "NewsID,NewsColumnID,NewsTitle,NewsContent,NewsAuthor,OrderByNum,CreateTime,CreateBy")] News news) { if (ModelState.IsValid) { news.NewsID = Guid.NewGuid(); db.News.Add(news); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(news)); }
public async Task <ActionResult> Create([Bind(Include = "EmID,EMUserName,EMPassWord,EMRealName,EmType,Mobile,IsDisabled,CreatedOn,CreatedBy")] EM_Employee em_employee) { if (ModelState.IsValid) { em_employee.EmID = Guid.NewGuid(); db.EM_Employee.Add(em_employee); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(em_employee)); }
public async Task <ActionResult> Create([Bind(Include = "ColumnID,ColumnPID,ColumnName,CreateTime,CreateBy,IsDeleted")] NewsColumn newscolumn) { if (ModelState.IsValid) { newscolumn.ColumnID = Guid.NewGuid(); db.NewsColumn.Add(newscolumn); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(newscolumn)); }
public async Task <ActionResult> Create([Bind(Include = "TasksID,TaskNeeds,ExecutorScore,TechnicalFactor,TimeFactor,DemandDetailFactor,TestEvaluteFactor,NeedsEvaluteFactor,ExecutorGetScore,Executor,TestFactor,OnlinePublishFactor,TestScore,TestEmployee,DemandFactor,DemandScore,DemandEmployee,FinishStatus")] JF_Tasks jf_tasks) { if (ModelState.IsValid) { jf_tasks.TasksID = Guid.NewGuid(); jf_tasks.ExecutorGetScore = jf_tasks.ExecutorScore * jf_tasks.TechnicalFactor * jf_tasks.TimeFactor * jf_tasks.DemandDetailFactor * jf_tasks.TestEvaluteFactor * jf_tasks.NeedsEvaluteFactor; jf_tasks.TestScore = jf_tasks.TestFactor * jf_tasks.ExecutorGetScore * jf_tasks.OnlinePublishFactor; jf_tasks.DemandScore = jf_tasks.DemandFactor * jf_tasks.ExecutorGetScore; jf_tasks.CreatedOn = DateTime.Now; jf_tasks.CreatedBy = Common.SessionClass.GetSession.EmID; db.JF_Tasks.Add(jf_tasks); await db.SaveChangesAsync(); SetJF_TasksLog(jf_tasks.TasksID, jf_tasks.FinishStatus); return(Content("ok")); } return(View(jf_tasks)); }