Exemple #1
0
        public JsonResult OpenTask(string ID)
        {
            try
            {
                T_OutStockTaskInfo model = new T_OutStockTaskInfo();
                model.ID = Convert.ToInt32(ID);
                string strError = "";
                if (!tfunc_task.GetModelByID(ref model, ref strError))
                {
                    return(Json(new { state = false, obj = strError }, JsonRequestBehavior.AllowGet));
                }
                if (model.Status != 5)
                {
                    return(Json(new { state = false, obj = "当前任务未关闭,请不要重复打开!" }, JsonRequestBehavior.AllowGet));
                }

                string strmsg = "";
                List <T_OutStockTaskInfo> model1 = new List <T_OutStockTaskInfo>();

                tfunc_task.GetModelListByFilter(ref model1, ref strmsg, "", "erpvoucherno='" + model.ErpVoucherNo + "'");
                model.Status = 1;
                if (tfunc_task.UpadteModelByModelSql(currentUser, model, ref strError))
                {
                    return(Json(new { state = true, obj = "当前任务打开成功!" }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(new { state = false, obj = "打开失败!" }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                return(Json(new { state = false, obj = ex.ToString() }, JsonRequestBehavior.AllowGet));
            }
        }
        public JsonResult CloseTask(string ID)
        {
            try
            {
                //判断当前用户,只有admin,能操作
                if (currentUser.UserNo != "admin" && currentUser.UserNo != "2008050001" && currentUser.UserNo != "2012020004")
                {
                    return(Json(new { state = false, obj = "任务关闭权限只有admin,(叶盼盼)2008050001,(游亚勇)2012020004才能操作!" }, JsonRequestBehavior.AllowGet));
                }

                T_OutStockTaskInfo model = new T_OutStockTaskInfo();
                model.ID = Convert.ToInt32(ID);
                string strError = "";
                if (!tfunc_task.GetModelByID(ref model, ref strError))
                {
                    return(Json(new { state = false, obj = strError }, JsonRequestBehavior.AllowGet));
                }
                if (model.Status == 5)
                {
                    return(Json(new { state = false, obj = "当前任务已关闭,请不要重复关闭!" }, JsonRequestBehavior.AllowGet));
                }
                //if (model.Status == 3)
                //{
                //    return Json(new { state = false, obj = "当前任务完成,不能关闭!" }, JsonRequestBehavior.AllowGet);
                //}
                model.Status = 5;
                if (tfunc_task.UpadteModelByModelSql(currentUser, model, ref strError))
                {
                    return(Json(new { state = true, obj = "当前任务关闭成功!" }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(new { state = false, obj = "关闭失败!" }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                return(Json(new { state = false, obj = ex.ToString() }, JsonRequestBehavior.AllowGet));
            }
        }
Exemple #3
0
        public bool UpdateT_OutTaskStatus(UserInfo user, ref T_OutStockTaskInfo t_task, ref string strError)
        {
            T_OutStockTask_Func tfunc = new T_OutStockTask_Func();

            return(tfunc.UpadteModelByModelSql(user, t_task, ref strError));
        }