Exemplo n.º 1
0
        public void CompletePlanManual(string planCode)
        {
            PlanMainModel plan = bllPlan.GetModelByPlanCode(planCode);

            if (plan == null)
            {
                this.View.ShowMessage("信息提示", "");
                return;
            }
            plan.Plan_Status = EnumPlanStatus.完成.ToString();
            bllPlan.Update(plan);
            this.WmsFrame.WriteLog("代办工作逻辑", "", "提示", "计划手动完成成功!");
            QueryPlan(this.querySDate, this.queryEDate, this.queryPlanType, this.queryPlanCode);
        }
Exemplo n.º 2
0
        public static bool UpdatePlanStatus(string planID, EnumPlanStatus planStatus)
        {
            PlanMainModel planModel = bllPlan.GetModel(planID);

            if (planModel == null)
            {
                return(false);
            }
            planModel.Plan_Status = planStatus.ToString();
            if (planStatus == EnumPlanStatus.完成)
            {
                planModel.Plan_End_Time = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            }
            bllPlan.Update(planModel);
            return(true);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 编辑批次
        /// </summary>
        public void EditorPlan()
        {
            string   planName  = Context.Request["editorPlanName"].ToString();
            DateTime startTime = Convert.ToDateTime(Context.Request["editorStartTime"].ToString()),
                     endTime   = Convert.ToDateTime(Context.Request["editorEndTime"].ToString());
            int state          = int.Parse(Context.Request["editorState"].ToString()),
                planId         = int.Parse(Context.Request["editorPlanId"].ToString());
            //collegeId = int.Parse(Context.Request["planCollegeId"].ToString());

            //获取院系id
            Teacher    teacher    = (Teacher)Session["user"];
            string     account    = teacher.TeaAccount;
            TeacherBll teacherBll = new TeacherBll();

            loginUser = teacherBll.GetModel(account);
            College ColID = loginUser.college;

            Plan plan = new Plan()
            {
                PlanId    = planId,
                PlanName  = planName,
                StartTime = startTime,
                EndTime   = endTime,
                State     = state,
                college   = ColID
            };

            try
            {
                PlanBll pBll         = new PlanBll();
                Result  EditorResult = pBll.Update(plan);
                //字符串转日期
                string   start   = Convert.ToDateTime(startTime).ToString("yyyy-MM-dd HH:mm:ss");
                DateTime startdt = Convert.ToDateTime(start);
                string   end     = Convert.ToDateTime(endTime).ToString("yyyy-MM-dd HH:mm:ss");
                DateTime enddt   = Convert.ToDateTime(end);
                TimeSpan ts      = enddt - startdt;
                //间隔天数小于1则不能
                if (ts.Days >= 1)
                {
                    if (EditorResult == Result.更新成功)
                    {
                        LogHelper.Info(this.GetType(), loginUser.TeaAccount + " - " + loginUser.TeaName + " - 编辑" + planId + "批次");
                        Response.Write("更新成功");
                        //Response.End();
                    }
                    else
                    {
                        Response.Write("更新失败");
                        //Response.End();
                    }
                }
                else
                {
                    Response.Write("开始与结束时间间隔必须大于1天");
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(this.GetType(), ex);
            }
            finally
            {
                Response.End();
            }
        }