Example #1
0
        /// <summary>
        /// 删除菜单
        /// </summary>
        /// <param name="?"></param>
        /// <returns></returns>
        public xt_result getShanchucaidan(caidan mCaidan)
        {
            string sql = " delete caidan where xuhao=@xuhao and yingyong=@yingyong;";

            sql = sql + "delete gongneng where xuhao=@xuhao and yingyong=@yingyong;";
            SqlParameter[] param = new SqlParameter[] { new SqlParameter("@yingyong", SqlDbType.VarChar),

                                                        new SqlParameter("@xuhao", SqlDbType.NVarChar) };
            param[0].Value = mCaidan.Yingyong;
            param[1].Value = mCaidan.Xuhao;
            xt_result result = new xt_result();

            result.Message = "删除 成功";
            try
            {
                result.ReturnInt = SQLHelper.ExecuteNonQuery(base.User_Login, CommandType.Text, sql, param);
                if (result.ReturnInt < 1)
                {
                    result.Message = "删除 失败";
                }
            }
            catch (Exception e)
            {
                result.Message = e.Message;
                result.Message = result.Message.Replace("\r\n", "\\n");
                result.Message = result.Message.Replace("'", "");
            }
            return(result);
        }
Example #2
0
        /// <summary>
        /// 插入菜单
        /// </summary>
        /// <param name="?"></param>
        /// <returns></returns>
        public xt_result getCharucaidan(caidan mCaidan, string pDaihao)
        {
            string sql = "insert into caidan(yingyong,bianhao,xuhao,fuxuhao,mingcheng,jiancheng,url,image) values(@yingyong,@bianhao,@xuhao,@fuxuhao,@mingcheng,@jiancheng,@url,@image);";

            sql = sql + "insert into gongneng(daihao,yingyong,bianhao,xuhao,mingcheng,canshu0,canshu1,canshu2,canshu3,canshu4,canshu5,canshu6,canshu7,canshu8,canshu9)values( @pDaihao,@yingyong,@bianhao,@xuhao,@mingcheng,'0','0','0','0','0','0','0','0','0','0')";
            SqlParameter[] param = new SqlParameter[] { new SqlParameter("@yingyong", SqlDbType.VarChar),
                                                        new SqlParameter("@bianhao", SqlDbType.NVarChar),
                                                        new SqlParameter("@xuhao", SqlDbType.NVarChar),
                                                        new SqlParameter("@fuxuhao", SqlDbType.VarChar),
                                                        new SqlParameter("@mingcheng", SqlDbType.VarChar),
                                                        new SqlParameter("@jiancheng", SqlDbType.VarChar),
                                                        new SqlParameter("@url", SqlDbType.VarChar),
                                                        new SqlParameter("@image", SqlDbType.VarChar),
                                                        new SqlParameter("@pDaihao", SqlDbType.VarChar), };
            param[0].Value = mCaidan.Yingyong;
            param[1].Value = mCaidan.Bianhao;
            param[2].Value = mCaidan.Xuhao;
            param[3].Value = mCaidan.Fuxuhao;
            param[4].Value = mCaidan.Mingcheng;
            param[5].Value = mCaidan.Jiancheng;
            param[6].Value = mCaidan.Url;
            param[7].Value = mCaidan.Image;
            param[8].Value = pDaihao;
            xt_result result = new xt_result();

            result.Message = "插入 成功";
            try
            {
                result.ReturnInt = SQLHelper.ExecuteNonQuery(base.User_Login, CommandType.Text, sql, param);
                if (result.ReturnInt < 1)
                {
                    result.Message = "插入 失败";
                }
            }
            catch (Exception e)
            {
                result.Message = e.Message;
                result.Message = result.Message.Replace("\r\n", "\\n");
                result.Message = result.Message.Replace("'", "");
            }
            return(result);
        }
Example #3
0
        /// <summary>
        /// 更新菜单
        /// </summary>
        /// <param name="mCaidan"></param>
        /// <returns></returns>
        public xt_result getGengaicaidan(caidan mCaidan)
        {
            string sql = "update caidan set yingyong=@yingyong,xuhao=@xuhao,fuxuhao=@fuxuhao,mingcheng=@mingcheng,jiancheng=@jiancheng,url=@url,image=@image where bianhao=@bianhao ";

            SqlParameter[] param = new SqlParameter[] { new SqlParameter("@yingyong", SqlDbType.VarChar),
                                                        new SqlParameter("@bianhao", SqlDbType.NVarChar),
                                                        new SqlParameter("@xuhao", SqlDbType.NVarChar),
                                                        new SqlParameter("@fuxuhao", SqlDbType.VarChar),
                                                        new SqlParameter("@mingcheng", SqlDbType.VarChar),
                                                        new SqlParameter("@jiancheng", SqlDbType.VarChar),
                                                        new SqlParameter("@url", SqlDbType.VarChar),
                                                        new SqlParameter("@image", SqlDbType.VarChar), };
            param[0].Value = mCaidan.Yingyong;
            param[1].Value = mCaidan.Bianhao;
            param[2].Value = mCaidan.Xuhao;
            param[3].Value = mCaidan.Fuxuhao;
            param[4].Value = mCaidan.Mingcheng;
            param[5].Value = mCaidan.Jiancheng;
            param[6].Value = mCaidan.Url;
            param[7].Value = mCaidan.Image;

            //开始事务
            xt_result result = new xt_result();

            result.Message = "更新 成功";
            try
            {
                result.ReturnInt = SQLHelper.ExecuteNonQuery(base.User_Login, CommandType.Text, sql, param);
                if (result.ReturnInt < 1)
                {
                    result.Message = "更新 失败";
                }
            }
            catch (Exception e)
            {
                result.Message = e.Message;
                result.Message = result.Message.Replace("\r\n", "\\n");
                result.Message = result.Message.Replace("'", "");
            }
            return(result);
        }
Example #4
0
 /// <summary>
 /// 更新菜单
 /// </summary>
 /// <param name="mCaidan"></param>
 /// <returns></returns>
 public xt_result getGengaicaidan(caidan mCaidan)
 {
     return(dCaidan.getGengaicaidan(mCaidan));
 }
Example #5
0
 /// <summary>
 /// 删除菜单
 /// </summary>
 /// <param name="?"></param>
 /// <returns></returns>
 public xt_result getShanchucaidan(caidan mCaidan)
 {
     return(dCaidan.getShanchucaidan(mCaidan));
 }
Example #6
0
 /// <summary>
 /// 插入菜单
 /// </summary>
 /// <param name="mCaidan"></param>
 /// <returns></returns>
 public xt_result getCharucaidan(caidan mCaidan, string pDaihao)
 {
     return(dCaidan.getCharucaidan(mCaidan, pDaihao));
 }