Beispiel #1
0
        /// <summary>
        /// 更新改订单状态
        /// </summary>
        public bool UpdateStates(EccmRepairOrderModel model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update eccm_repair_order set ");
            strSql.Append("r_state=@r_state,");
            strSql.Append("r_etime=@r_etime");
            strSql.Append(" where order_id=@order_id");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@r_state",  MySqlDbType.Int32,     11),
                new MySqlParameter("@r_etime",  MySqlDbType.DateTime),
                new MySqlParameter("@order_id", MySqlDbType.Int32)
            };
            parameters[0].Value = model.r_state;
            parameters[1].Value = model.r_etime;
            parameters[2].Value = model.order_id;

            int rows = MySQLHelper.ExecuteNonQuery(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 添加维修实施记录
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string AddRepairImplement(HttpContext context)
        {
            var jr = new JsonResultModel <int>()
            {
                IsSucceed   = false,
                Data        = 0,
                Msg         = "添加失败",
                RedirectUrl = string.Empty
            };

            //获取传递参数
            string     orderid = context.Request.Params["orderid"];
            string     ordersn = context.Request.Params["ordersn"];
            string     content = context.Request.Params["content"];
            HttpCookie cook    = HttpContext.Current.Request.Cookies["EccmUserinfo"];

            if (cook != null)
            {
                //解密Cookie
                HttpCookie decodeCookie = HttpSecureCookie.Decode(cook);
                string     uid          = decodeCookie.Values["userid"];
                string     imgurl       = context.Request.Params["imgurl"];
                string     type         = context.Request.Params["type"];//1巡检2维保3维修

                //给对象赋值
                EccmRepairOrderImplementModel model = new EccmRepairOrderImplementModel();
                model.order_id          = int.Parse(orderid);
                model.equCode           = "";//该处没有设备编码
                model.implement_content = content;
                model.implement_time    = DateTime.Now;
                model.uid_handle        = int.Parse(uid);

                EccmRepairOrderImplementBLL bll = new EccmRepairOrderImplementBLL();
                int id = bll.Add(model); //插入并获取id
                if (id > 0)              //实施内容插入成功
                {
                    EccmImplementImgModel imgModel = new EccmImplementImgModel();
                    imgModel.implement_id = id;
                    imgModel.img_path     = imgurl;
                    imgModel.img_type     = int.Parse(type);; //1巡检2维保3维修
                    EccmImplementImgBLL img_bll = new EccmImplementImgBLL();
                    if (img_bll.Add(imgModel))                //插入实施图片
                    {
                        EccmRepairOrderModel repairModel = new EccmRepairOrderModel();
                        repairModel.order_id = int.Parse(orderid);
                        repairModel.r_state  = 4;//0未派单1已派单2已接单3处理中4完成
                        repairModel.r_etime  = DateTime.Now;
                        EccmRepairOrderBLL repairBLL = new EccmRepairOrderBLL();
                        repairBLL.UpdateStates(repairModel);//更改订单为完成
                        jr.IsSucceed = true;
                        jr.Msg       = "添加成功";
                    }
                }
            }
            return(JsonConvert.SerializeObject(jr));
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int orderID = string.IsNullOrEmpty(Request.Params["orderID"]) ? 0 : int.Parse(Request.Params["orderID"]);

            if (orderID == 0)
            {
                Response.Write("参数错误");
                Response.End();
            }
            EccmRepairOrderModel         model = _bll.GetRepairOrderDetail(orderID);
            List <EccmReceiverUserModel> list  = _userBLL.GetEccmReceiverUserList(orderID, 3);

            //订单基本信息
            if (model != null)
            {
                this.orderID.Value      = orderID.ToString();
                this.orderSN.Value      = model.order_sn;
                this.dispatchName.Value = model.dispatchName;
                this.createTime.Value   = model.r_stime.ToString();
                this.termTime.Value     = model.term_time.ToString();
                this.reason.Value       = model.r_reason;
                this.endTime.Value      = "暂无完成";
                switch (model.r_state)
                {
                case 0:
                    this.orderStatus.Value = "未派单";
                    break;

                case 1:
                    this.orderStatus.Value = "已派单";
                    break;

                case 2:
                    this.orderStatus.Value = "已接单";
                    break;

                case 3:
                    this.orderStatus.Value = "处理中";
                    break;

                case 4:
                    this.orderStatus.Value = "完成";
                    this.endTime.Value     = model.r_etime.ToString();
                    break;
                }
            }
            //责任人和协同人员
            if (list.Count > 0)
            {
                this.receiverName.Value      = list.Where(p => p.is_duty == 1).FirstOrDefault().nickName;
                this.coordinationNames.Value = string.Join(",", list.Where(p => p.is_duty == 0).Select(p => p.nickName).ToArray());;
            }
        }
Beispiel #4
0
 /// <summary>
 /// 更新改订单状态
 /// </summary>
 public bool UpdateStates(EccmRepairOrderModel model)
 {
     return(_dal.UpdateStates(model));
 }