Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        public async Task <ActionResult> Edit([Bind(Include = "DDid,DDCode,DDName,DDType,DDSort")] SYS_DD sys_dd)
        {
            if (ModelState.IsValid)
            {
                db.Entry(sys_dd).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(sys_dd));
        }
Esempio n. 3
0
        public async Task <ActionResult> Edit([Bind(Include = "NewsID,NewsColumnID,NewsTitle,NewsContent,NewsAuthor,OrderByNum,CreateTime,CreateBy")] News news)
        {
            if (ModelState.IsValid)
            {
                db.Entry(news).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(news));
        }
Esempio n. 4
0
        public async Task <ActionResult> Edit([Bind(Include = "EmID,EMUserName,EMPassWord,EMRealName,EmType,Mobile,IsDisabled,CreatedOn,CreatedBy")] EM_Employee em_employee)
        {
            if (ModelState.IsValid)
            {
                db.Entry(em_employee).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(em_employee));
        }
Esempio n. 5
0
        public async Task <ActionResult> Edit([Bind(Include = "ColumnID,ColumnPID,ColumnName,CreateTime,CreateBy,IsDeleted")] NewsColumn newscolumn)
        {
            if (ModelState.IsValid)
            {
                db.Entry(newscolumn).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(newscolumn));
        }
Esempio n. 6
0
        public async Task <ActionResult> Edit([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.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;

                db.Entry(jf_tasks).State = EntityState.Modified;
                //1.将实体对象a 加入到EF 对象容器中,并 b获取 伪包装类 对象
                DbEntityEntry <JF_Tasks> entry = db.Entry <JF_Tasks>(jf_tasks);
                //2.将包装类对象 的状态设置为 Unchanged
                //entry.State = EntityState.Modified;
                //3.设置 被改变的 属性
                entry.Property(a => a.CreatedOn).IsModified = false;
                entry.Property(a => a.CreatedBy).IsModified = false;
                //db.Entry(jf_tasks).State = EntityState.Modified;
                await db.SaveChangesAsync();

                SetJF_TasksLog(jf_tasks.TasksID, jf_tasks.FinishStatus);
                return(Content("ok"));
            }
            return(View(jf_tasks));
        }