示例#1
0
        /// <summary>
        /// 修改整改信息
        /// </summary>
        /// <param name="data"></param>
        /// <param name="yh_downid"></param>
        /// <returns></returns>
        public HttpResponseMessage UpdateYinHuan_down(dynamic data, int yh_downid)
        {
            Entity.yinhuan_down d = down.Value.SetData(data);
            string sql            = "update yinhuan_down set yh_no=@yh_no,yh_to_user="******"," +
                                    "yh_state=" + d.yh_state + ",yh_time=" + d.yh_time + " where yh_downid=" + yh_downid + "";

            SqlParameter[] sp =
            {
                new SqlParameter("@yh_no", d.yh_no)
            };
            int i = help.Count(sql, sp);

            if (i > 0)
            {
                obj = new
                {
                    code = 0,
                    msg  = "修改成功"
                };
            }
            else
            {
                obj = new
                {
                    code = 1,
                    msg  = "修改失败"
                };
            }
            return(Zh.Tool.Json.GetJson(obj));
        }
示例#2
0
        /// <summary>
        /// 添加审批上报表
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public HttpResponseMessage AddYinHuan_up(dynamic data, int touser)
        {
            Entity.yinhuan_down u = down.Value.SetData(data);
            string sql            = "insert into yinhuan_up(yh_no,yh_to_userup,yh_state,yh_time) values(" +
                                    "@yh_no," + touser + "," + u.yh_state + "," + u.yh_time + ")";

            SqlParameter[] sp =
            {
                new SqlParameter("@yh_no", u.yh_no)
            };
            int i = help.Count(sql, sp);

            if (i > 0)
            {
                obj = new
                {
                    code = 0,
                    msg  = "上报成功"
                };
            }
            else
            {
                obj = new
                {
                    code = 1,
                    msg  = "上报失败"
                };
            }
            return(Zh.Tool.Json.GetJson(obj));
        }
示例#3
0
        /// <summary>
        /// 修改隐患信息
        /// </summary>
        /// <param name="data"></param>
        /// <param name="yh_no"></param>
        /// <returns></returns>
        public HttpResponseMessage UpdateYinHuan(dynamic data, string yh_no)
        {
            Deparment de = new Deparment();

            Entity.yinhuan_down y = down.Value.SetData(data);
            string sql            = "update yinhuan set yh_applicationName=@yh_applicationName,yh_body=@yh_body,yh_create_time=" + y.yh_create_time + "," +
                                    "yh_area=@yh_area,yh_type=@yh_type,yh_dengji=" + y.yh_dengji + ",yh_desc=@yh_desc,yh_img=@yh_img," +
                                    "yh_imgodd=@yh_imgodd,yh_timestart=" + y.yh_timestart + ",yh_timeend=" + y.yh_timeend + "," +
                                    "yh_user_from=" + y.yh_user_from + ",yh_deparment=" + y.yh_deparment + ",yh_to_deparment=" + y.yh_to_deparment + "," +
                                    "yh_yaoqiu=@yh_yaoqiu,yh_to_user="******",yh_shishi_time=" + y.yh_shishi_time + "," +
                                    "yh_zhenggaihou=@yh_zhenggaihou,yh_queren_user="******",yh_queren_time=" + y.yh_queren_time + "," +
                                    "yh_send_state=" + y.yh_send_state + " where yh_no=@yh_no";

            SqlParameter[] sp =
            {
                new SqlParameter("@yh_no",              yh_no),
                new SqlParameter("@yh_applicationName", y.yh_applicationName),
                new SqlParameter("@yh_body",            y.yh_body),
                new SqlParameter("@yh_area",            y.yh_area),
                new SqlParameter("@yh_type",            y.yh_type),
                new SqlParameter("@yh_desc",            y.yh_desc),
                new SqlParameter("@yh_img",             y.yh_img),
                new SqlParameter("@yh_imgodd",          y.yh_imgodd),
                new SqlParameter("@yh_yaoqiu",          y.yh_yaoqiu),
                new SqlParameter("@yh_zhenggaihou",     y.yh_zhenggaihou)
            };
            int i = help.Count(sql, sp);

            if (i > 0)
            {
                if (y.yh_send_state == 1)
                {
                    int upadmin = de.QueryAdminId(y.yh_deparment);//得到我要上报的领导ID编号
                    int t       = Zh.Tool.Date_Tool.TimeToInt(DateTime.Now);
                    sql = "insert into yinhuan_up(yh_no,yh_to_userup,yh_state,yh_time) values " +
                          "('" + y.yh_no + "'," + upadmin + ",0," + t + ")";
                    help.Count(sql);
                }
                obj = new
                {
                    code = 0,
                    msg  = "修改成功"
                };
            }
            else
            {
                obj = new
                {
                    code = 1,
                    msg  = "修改失败"
                };
            }
            return(Zh.Tool.Json.GetJson(obj));
        }