예제 #1
0
        /// <summary>
        /// 功能设定后对功能设定表POS_FUNCSET的部分字段的更新
        /// </summary>
        /// <param name="pos_FuncSet">POS_FUNCSET类的一个实体</param>
        /// <returns>true或false</returns>
        public bool UpdateFunctionSet(POS_FUNCSET pos_FuncSet)
        {
            SqlParameter[] para = new SqlParameter[9];
            para[0]       = new SqlParameter("@FUNC_ID", SqlDbType.Int);
            para[1]       = new SqlParameter("@POSITION_ID", SqlDbType.Int);
            para[2]       = new SqlParameter("@DISP_NAME", SqlDbType.NVarChar);
            para[3]       = new SqlParameter("@EMP_LEVEL", SqlDbType.NChar);
            para[4]       = new SqlParameter("@COLOR", SqlDbType.NVarChar);
            para[5]       = new SqlParameter("@FONT_COLOR", SqlDbType.NVarChar);
            para[6]       = new SqlParameter("@FONT_SIZE", SqlDbType.Int);
            para[7]       = new SqlParameter("@FONT_NAME", SqlDbType.NVarChar);
            para[8]       = new SqlParameter("@HOTKEY", SqlDbType.Int);
            para[0].Value = pos_FuncSet.FUNC_ID1;
            para[1].Value = pos_FuncSet.POSITION_ID1;
            para[2].Value = pos_FuncSet.DISP_NAME1;
            para[3].Value = pos_FuncSet.EMP_LEVEL1;
            para[4].Value = pos_FuncSet.COLOR1;
            para[5].Value = pos_FuncSet.FONT_COLOR1;
            para[6].Value = pos_FuncSet.FONT_SIZE1;
            para[7].Value = pos_FuncSet.FONT_NAME1;
            para[8].Value = pos_FuncSet.HOTKEY1;
            int    HOTKEY      = pos_FuncSet.HOTKEY1;
            int    POSITION_ID = pos_FuncSet.POSITION_ID1;
            string sql1        = "update POS_FUNCSET set HOTKEY=" + pos_FuncSet.BeforeSetHOTKEY + " from POS_FUNCSET where HOTKEY=" + HOTKEY;
            string sql2;

            sql2 = "select * from pos_funcset where position_id=" + POSITION_ID;
            if (base.CreateDataSet(sql2).Tables [0].Rows.Count == 0)
            {
                sql2 = "update POS_FUNCSET set POSITION_ID=" + 1 + " from POS_FUNCSET where POSITION_ID=" + 1;
                //    pos_FuncSet.BefortSetPOSITION_ID = 1;
                //    POSITION_ID = 1;
            }
            else
            {
                sql2 = "update POS_FUNCSET set POSITION_ID=" + pos_FuncSet.BefortSetPOSITION_ID + " from POS_FUNCSET where POSITION_ID=" + POSITION_ID;
            }
            bool a = false;

            if (base.RunSQL(sql1).Equals(true))
            {
                a = true;
            }
            bool b = false;

            if (base.RunSQL(sql2).Equals(true))
            {
                b = true;
            }
            if (a && b)
            {
                string sql3 = "update POS_FUNCSET set POSITION_ID=@POSITION_ID,DISP_NAME=@DISP_NAME,EMP_LEVEL=@EMP_LEVEL," +
                              "COLOR=@COLOR,FONT_COLOR=@FONT_COLOR,FONT_SIZE=@FONT_SIZE,FONT_NAME=@FONT_NAME,HOTKEY=@HOTKEY" + " from POS_FUNCSET where FUNC_ID=@FUNC_ID";
                return(base.RunSQL(sql3, para));
            }
            else
            {
                return(false);
            }
        }
예제 #2
0
 /// <summary>
 /// 功能设定后对功能设定表POS_FUNCSET的部分字段的更新
 /// </summary>
 /// <param name="pos_FuncSet">POS_FUNCSET类的一个实体</param>
 /// <returns>true或false</returns>
 public bool UpdateFunctionSet(POS_FUNCSET pos_FuncSet)
 {
     try
     {
         return(DataGetFunctons.InitDataGetFunctons().UpdateFunctionSet(pos_FuncSet));
     }
     catch { return(false); }
 }