/// <summary>
        /// 修改部门提成
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool UpdateInputDepatmentRoyalty(InputDepatmentRoyaltyModel model)
        {

            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
            //登陆日志
            try
            {
                bool succ = false;
                LogInfoModel logModel = InitLogInfo(model.DeptID);
                logModel.Element = ConstUtil.LOG_PROCESS_UPDATE;
                succ = InputDepatmentRoyaltyDBHelper.UpdateInputDepatmentRoyalty(model);
                if (!succ)
                    logModel.Remark = ConstUtil.LOG_PROCESS_FAILED;
                else
                    logModel.Remark = ConstUtil.LOG_PROCESS_SUCCESS;
                LogDBHelper.InsertLog(logModel);
                return succ;
            }
            catch (Exception)
            {
                return false;
                throw;
            }

        }
        /// <summary>
        /// 插入部门提成
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool InsertInputDepatmentRoyalty(InputDepatmentRoyaltyModel model)
        {

            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
            //登陆日志
            try
            {
                bool succ = false;
                LogInfoModel logModel = InitLogInfo(model.DeptID);
                logModel.Element = ConstUtil.LOG_PROCESS_INSERT;
                succ = InputDepatmentRoyaltyDBHelper.InsertInputDepatmentRoyalty(model);
                if (!succ)
                    logModel.Remark = ConstUtil.LOG_PROCESS_FAILED;
                else
                    logModel.Remark = ConstUtil.LOG_PROCESS_SUCCESS;
                LogDBHelper.InsertLog(logModel);
                return succ;
            }
            catch (Exception ex)
            {
                WriteSystemLog(userInfo, ex);
                return false;
            }

        }
        /// <summary>
        /// 修改部门提成
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool UpdateInputDepatmentRoyalty(InputDepatmentRoyaltyModel model)
        {
            StringBuilder sql = new StringBuilder();
            sql.AppendLine("UPDATE officedba.InputDepatmentRoyalty   ");
            sql.AppendLine("   SET                                   ");
            sql.AppendLine("       BusinessMoney = @BusinessMoney              ");
            sql.AppendLine("      ,CreateTime = @CreateTime          ");
            sql.AppendLine("      ,ModifiedDate = @ModifiedDate      ");
            sql.AppendLine("      ,ModifiedUserID = @ModifiedUserID  ");
            sql.AppendLine(" WHERE ID=@ID ");

            //设置参数
            SqlParameter[] param = new SqlParameter[5];
            int i = 0;
            param[i++] = SqlHelper.GetParameter("@BusinessMoney", model.BusinessMoney);
            param[i++] = SqlHelper.GetParameter("@ID", model.ID);
            param[i++] = SqlHelper.GetParameter("@CreateTime", model.CreateTime);
            param[i++] = SqlHelper.GetParameter("@ModifiedDate", System.DateTime.Now);
            param[i++] = SqlHelper.GetParameter("@ModifiedUserID", model.ModifiedUserID);
            SqlHelper.ExecuteTransSql(sql.ToString(), param);
            return SqlHelper.Result.OprateCount > 0 ? true : false;

        }
        /// <summary>
        /// 插入部门提成
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool InsertInputDepatmentRoyalty(InputDepatmentRoyaltyModel model)
        {
            StringBuilder sql = new StringBuilder();
            sql.AppendLine("INSERT INTO officedba.InputDepatmentRoyalty");
            sql.AppendLine("           (CompanyCD                     ");
            sql.AppendLine("           ,DeptID                      ");
            sql.AppendLine("           ,BusinessMoney                      ");
            sql.AppendLine("           ,CreateTime                      ");
            sql.AppendLine("           ,ModifiedDate                  ");
            sql.AppendLine("           ,ModifiedUserID)               ");
            sql.AppendLine("     VALUES                               ");
            sql.AppendLine("           (@CompanyCD                    ");
            sql.AppendLine("           ,@DeptID                     ");
            sql.AppendLine("           ,@BusinessMoney                     ");
            sql.AppendLine("           ,@CreateTime                     ");
            sql.AppendLine("           ,@ModifiedDate                 ");
            sql.AppendLine("           ,@ModifiedUserID)               ");
            //设置参数
            SqlParameter[] param = new SqlParameter[6];
            int i = 0;
            param[i++] = SqlHelper.GetParameter("@CompanyCD", model.CompanyCD);
            param[i++] = SqlHelper.GetParameter("@DeptID", model.DeptID);
            param[i++] = SqlHelper.GetParameter("@BusinessMoney", model.BusinessMoney);
            param[i++] = SqlHelper.GetParameter("@CreateTime", model.CreateTime);
            param[i++] = SqlHelper.GetParameter("@ModifiedDate", System.DateTime.Now);
            param[i++] = SqlHelper.GetParameter("@ModifiedUserID", model.ModifiedUserID);
            SqlHelper.ExecuteTransSql(sql.ToString(), param);
            return SqlHelper.Result.OprateCount > 0 ? true : false;

        }