Пример #1
0
        public static List <IndividualPointsVO> SearchIndividualPointsLists(IndividualPointsFilter filter)
        {
            switch (filter.statisticsMode)
            {
            case 1:
                var cmd1 = new DataCommand("MockTest.IndividualPoints1");
                cmd1.SetParameter("@userTag", DbType.Int32, filter.UserTag);
                return(cmd1.ExecuteEntityList <IndividualPointsVO>());

            case 2:
                var cmd2 = new DataCommand("MockTest.IndividualPoints2");
                cmd2.SetParameter("@userTag", DbType.Int32, filter.UserTag);
                cmd2.SetParameter("@year", DbType.String, filter.statisticsYear);
                return(cmd2.ExecuteEntityList <IndividualPointsVO>());

            case 3:
                var cmd3 = new DataCommand("MockTest.IndividualPoints3");
                cmd3.SetParameter("@userTag", DbType.Int32, filter.UserTag);
                cmd3.SetParameter("@year", DbType.String, filter.statisticsYear);
                return(cmd3.ExecuteEntityList <IndividualPointsVO>());

            default:
                break;
            }
            return(new List <IndividualPointsVO>());
        }
        public static void UpdateAddressMapCoordinateBatch(List <AddressMap> list, CurrentUser currentUser)
        {
            if (list == null)
            {
                return;
            }

            DataCommand cmd = new DataCommand("UpdateAddressMapCoordinate");
            var         sql = new StringBuilder();
            int         i   = 0;

            list.ForEach(addressmap => {
                sql.Append($@"UPDATE smoke.AddressMap SET 
                SmokeCoordinate=@SmokeCoordinate{i},
                `EditUserSysNo` = {currentUser.UserSysNo},
                `EditUserName` = @EditUserName,
                `EditDate` = now(3) WHERE SysNo ={ addressmap.SysNo} ;");

                cmd.SetParameter("SmokeCoordinate" + i, DbType.String, addressmap.SmokeCoordinate);

                i++;
            });


            cmd.CommandText = sql.ToString();
            cmd.SetParameter("EditUserName", DbType.String, currentUser.UserDisplayName);

            if (string.IsNullOrEmpty(cmd.CommandText))
            {
                return;
            }
            cmd.ExecuteNonQuery();
        }
Пример #3
0
        public static List <AuthFunctionModel> LoadFunctionsByUserSysNo(int userSysNo, string applicationKey, string topName)
        {
            DataCommand cmd = new DataCommand("LoadFunctionsByUserSysNo");

            cmd.SetParameter("@UserSysNo", DbType.Int32, userSysNo);
            cmd.SetParameter("@ApplicationKey", DbType.AnsiString, applicationKey);

            var ds = cmd.ExecuteDataSet();

            var permissions = DataMapper.GetEntityList <AuthPermissionModel, List <AuthPermissionModel> >(ds.Tables[0].Rows);
            var functions   = DataMapper.GetEntityList <AuthFunctionModel, List <AuthFunctionModel> >(ds.Tables[1].Rows);

            if (!string.IsNullOrWhiteSpace(topName))
            {
                var topEntity = functions.FirstOrDefault(x => x.FunctionName == topName);
                if (topEntity != null)
                {
                    functions.RemoveAll(x => !x.SysCode.StartsWith(topEntity.SysCode));
                }
            }

            for (int i = 0; i < functions.Count; i++)
            {
                functions[i].Permissions = permissions.FindAll(x => x.FunctionSysNo == functions[i].SysNo);
            }

            return(functions);
        }
Пример #4
0
        /// <summary>
        /// 检查在单位时间间隔内,该号码是否发送过短信
        /// </summary>
        /// <param name="cellPhoneNumber">手机号码</param>
        /// <param name="timeSpanSecond">时间间隔,以秒为单位</param>
        /// <returns></returns>
        public static bool CheckSendSMSTimespan(string cellPhoneNumber, int timeSpanSecond)
        {
            var cmd = new DataCommand("CheckSendSMSTimespan");

            cmd.SetParameter("@CellPhoneNumber", DbType.String, cellPhoneNumber);
            cmd.SetParameter("@TimeSpanSecond", DbType.Int32, timeSpanSecond);
            return(cmd.ExecuteScalar <bool>());
        }
Пример #5
0
        public static List <MessageEntity> WillBeSendMessgesBySpanSeconds(MsgType?msgType, int seconds)
        {
            var cmd = new DataCommand("WillSendMessgeBySpanSeconds");

            cmd.SetParameter("@MsgType", DbType.Int32, msgType);
            cmd.SetParameter("@SpanSeconds", DbType.Int32, seconds);
            return(cmd.ExecuteEntityList <MessageEntity>());
        }
Пример #6
0
        public static void SaveTopicCategoryPriority(TopicCategory info)
        {
            DataCommand cmd = new DataCommand("SaveTopicCategoryPriority");

            cmd.SetParameter("@SysNo", DbType.Int32, info.SysNo);
            cmd.SetParameter("@Priority", DbType.Int32, info.Priority);
            cmd.ExecuteNonQuery();
        }
Пример #7
0
        public static bool CheckUserLoginNameExist(string loginName, int selfId)
        {
            var cmd = new DataCommand("User.CheckUserLoginNameExist");

            cmd.SetParameter("@LoginName", DbType.String, loginName);
            cmd.SetParameter("@SelfId", DbType.String, selfId);
            return(cmd.ExecuteScalar <int>() > 0);
        }
Пример #8
0
        /// <summary>
        /// 根据账号和密码获取用户信息
        /// </summary>
        /// <param name="loginName"></param>
        /// <param name="loginPassword"></param>
        /// <returns></returns>
        public static UserEntity GetByLoginNameAndPassword(string loginName, string loginPassword)
        {
            var cmd = new DataCommand("User.GetByLoginNameAndPassword");

            cmd.SetParameter("@LoginName", DbType.String, loginName);
            cmd.SetParameter("@LoginPassword", DbType.String, loginPassword);
            return(cmd.ExecuteEntity <UserEntity>());
        }
        public static void BuildDayReport(DateTime startdate, DateTime enddate)
        {
            DataCommand cmd = new DataCommand("BuildDayReport");

            cmd.SetParameter("@startdate", DbType.Date, startdate);
            cmd.SetParameter("@enddate", DbType.Date, enddate);
            cmd.ExecuteNonQuery();
        }
Пример #10
0
        /// <summary>
        /// 更新SystemUser信息
        /// </summary>
        public static int UpdateSystemUser(SystemUser entity, string applicationID)
        {
            DataCommand cmd = new DataCommand("UpdateSystemUser");

            cmd.SetParameter <SystemUser>(entity);
            cmd.SetParameter("@ApplicationID", DbType.String, applicationID);
            return(cmd.ExecuteScalar <int>());
        }
Пример #11
0
        public static int CountLoginName(string loginName, string applicationID)
        {
            DataCommand cmd = new DataCommand("CountLoginName");

            cmd.SetParameter("@LoginName", DbType.String, loginName);
            cmd.SetParameter("@ApplicationID", DbType.String, applicationID);
            return(cmd.ExecuteScalar <int>());
        }
Пример #12
0
        /// <summary>
        /// 根据账号获取用户信息
        /// </summary>
        /// <param name="loginName"></param>
        /// <param name="applicationID"></param>
        /// <returns></returns>
        public static SystemUser LoadSystemUserByLoginName(string loginName, string applicationID)
        {
            DataCommand cmd = new DataCommand("LoadSystemUserByLoginName");

            cmd.SetParameter("@LoginName", DbType.String, loginName);
            cmd.SetParameter("@ApplicationID", DbType.String, applicationID);
            return(cmd.ExecuteEntity <SystemUser>());
        }
Пример #13
0
        /// <summary>
        /// 删除地址
        /// </summary>
        /// <param name="sysNo">要删除的节点编号</param>
        /// <param name="isDeleteMoreNode">是否同时删除同级节点中比此节点以后的节点</param>
        public static bool DeleteAddress(int sysNo, bool isDeleteMoreNode = true)
        {
            DataCommand cmd = new DataCommand("DeleteAddress");

            cmd.SetParameter("@SysNo", DbType.Int32, sysNo);
            cmd.SetParameter("@IsDeleteMore", DbType.Boolean, @isDeleteMoreNode);
            return(cmd.ExecuteNonQuery() > 0);
        }
Пример #14
0
        /// <summary>
        /// 查询地址下级
        /// </summary>
        /// <param name="companySysNo"></param>
        /// <param name="code"></param>
        /// <returns></returns>
        public static List <Address> LoadSubsetAddressByAddressSysNo(int companySysNo, int addressSysNo)
        {
            DataCommand cmd = new DataCommand("LoadSubsetAddressByAddressSysNo");

            cmd.SetParameter("@CompanySysNo", DbType.Int32, companySysNo);
            cmd.SetParameter("@AddressSysNo", DbType.Int32, addressSysNo);
            return(cmd.ExecuteEntityList <Address>());
        }
Пример #15
0
        /// <summary>
        /// 根据Code获取地址树
        /// </summary>
        /// <param name="addressCode"></param>
        /// <param name="companySysNo"></param>
        /// <returns></returns>
        public static List <Address> LoadAddressByAddressCode(string addressCode, int companySysNo)
        {
            DataCommand cmd = new DataCommand("LoadAddressByAddressCode");

            cmd.SetParameter("@AddressCode", DbType.String, addressCode);
            cmd.SetParameter("@CompanySysNo", DbType.Int32, companySysNo);
            return(cmd.ExecuteEntityList <Address>());
        }
Пример #16
0
        public static void DeleteAddressManagerByCode(string addressCode, int companySysNo)
        {
            DataCommand cmd = new DataCommand("DeleteAddressManagerByCode");

            cmd.SetParameter("@AddressCode", DbType.String, addressCode);
            cmd.SetParameter("@CompanySysNo", DbType.Int32, companySysNo);
            cmd.ExecuteNonQuery();
        }
Пример #17
0
        /// <summary>
        /// 单位、活动查询
        /// </summary>
        /// <param name="documentname"></param>
        /// <param name="orderNum"></param>
        /// <returns></returns>
        public static DepartmentPlanRankValid LoadPlanRankDeptAndPlanValid(string plan_name, string dept_name)
        {
            DataCommand cmd = new DataCommand("Plan.PlanRankDeptAndPlan");

            cmd.SetParameter("@plan_name", DbType.String, plan_name);
            cmd.SetParameter("@dept_name", DbType.String, dept_name);
            return(cmd.ExecuteEntity <DepartmentPlanRankValid>());
        }
Пример #18
0
        /// <summary>
        /// 文档 序号验证
        /// </summary>
        /// <param name="documentname"></param>
        /// <param name="orderNum"></param>
        /// <returns></returns>
        public static DocumentValid LoadDocumentValid(string documentname, int orderNum)
        {
            DataCommand cmd = new DataCommand("MockTest.LoadDocumentValid");

            cmd.SetParameter("@order_num", DbType.Int32, orderNum);
            cmd.SetParameter("@name", DbType.String, documentname);
            return(cmd.ExecuteEntity <DocumentValid>());
        }
Пример #19
0
        /// <summary>
        /// 修改重要置顶
        /// </summary>
        /// <param name="weight"></param>
        /// <param name="subjectId"></param>
        public static void UpdateWeight(int?weight, int subjectId)
        {
            var cmd = new DataCommand("Subject.UpdateWeight");

            cmd.SetParameter("@Id", DbType.Int32, subjectId);
            cmd.SetParameter("@weight", DbType.Int32, weight);
            cmd.ExecuteNonQuery();
        }
Пример #20
0
        /// <summary>
        /// 单位、活动查询
        /// </summary>
        /// <param name="documentname"></param>
        /// <param name="orderNum"></param>
        /// <returns></returns>
        public static UserPlanRankValid LoadPlanRankUserAndPlanValid(string plan_name, string user_name)
        {
            DataCommand cmd = new DataCommand("Plan.PlanRankUserAndPlan");

            cmd.SetParameter("@plan_name", DbType.String, plan_name);
            cmd.SetParameter("@user_name", DbType.String, user_name);
            return(cmd.ExecuteEntity <UserPlanRankValid>());
        }
Пример #21
0
        /// <summary>
        /// 查询主题导出列表
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        public static List <SearchExportAvgVO> SearchExportAvg(QF_Subject filter)
        {
            var cmd = new DataCommand("Subject.SearchExportAvg");

            cmd.SetParameter("@startTime", DbType.String, filter.StartTime?.ToString("yyyy-MM-dd"));
            cmd.SetParameter("@endTime", DbType.String, filter.EndTime?.ToString("yyyy-MM-dd"));
            return(cmd.ExecuteEntityList <SearchExportAvgVO>());
        }
Пример #22
0
        /// <summary>
        /// 修改重要置顶
        /// </summary>
        /// <param name="weight"></param>
        /// <param name="subjectId"></param>
        public static int ValidWeight(int?weight, int subjectId)
        {
            var cmd = new DataCommand("Subject.ValidWeight");

            cmd.SetParameter("@Id", DbType.Int32, subjectId);
            cmd.SetParameter("@weight", DbType.Int32, weight);
            return(cmd.ExecuteScalar <int>());
        }
Пример #23
0
        public static void UpdateCompanyStatus(int sysNo, CompanyStatus status)
        {
            DataCommand cmd = new DataCommand("UpdateCompanyStatus");

            cmd.SetParameter("@SysNo", DbType.Int32, sysNo);
            cmd.SetParameter("@CompanyStatus", DbType.Int32, (int)status);
            cmd.ExecuteNonQuery();
        }
Пример #24
0
        public static void UpdateCategoryIsLeaf(string categoryCode, CommonYesOrNo isLeaf)
        {
            DataCommand cmd = new DataCommand("UpdateCategoryIsLeaf");

            cmd.SetParameter("@CategoryCode", DbType.String, categoryCode);
            cmd.SetParameter("@IsLeaf", DbType.Int32, isLeaf);
            cmd.ExecuteNonQuery();
        }
Пример #25
0
        /// <summary>
        /// 找回密码
        /// </summary>
        /// <param name="loginName"></param>
        /// <param name="newPassword"></param>
        /// <param name="applicationKey"></param>
        /// <returns></returns>
        public static void FindSystemUserPwd(int sysNo, string newPassword)
        {
            DataCommand cmd = new DataCommand("FindSystemUserPwd");

            cmd.SetParameter("@SysNo", DbType.Int32, sysNo);
            cmd.SetParameter("@NewPassword", DbType.String, newPassword);

            cmd.ExecuteNonQuery();
        }
Пример #26
0
        public static void DeleteSystemUserBatch(IEnumerable <int> sysNos, string applicationID, int EditUserSysNo, string EditUserName)
        {
            DataCommand cmd = new DataCommand("DeleteSystemUserBatch");

            cmd.CommandText = cmd.CommandText.Replace("#BatchSysNo#", string.Join(",", from s in sysNos select s.ToString()));
            cmd.SetParameter("@EditUserSysNo", DbType.Int32, EditUserSysNo);
            cmd.SetParameter("@EditUserName", DbType.String, EditUserName);
            cmd.ExecuteNonQuery();
        }
Пример #27
0
        public static void DeleteFileInfo(FileMasterType masterType, int masterID, string categoryName)
        {
            DataCommand cmd = new DataCommand("DeleteOthersFileInfo");

            cmd.SetParameter("@MasterType", DbType.Int32, (int)masterType);
            cmd.SetParameter("@MasterID", DbType.Int32, masterID);
            cmd.SetParameter("@CategoryName", DbType.String, categoryName);
            cmd.ExecuteNonQuery();
        }
Пример #28
0
        /// <summary>
        /// 修改子节点状态
        /// </summary>
        /// <param name="parentCategoryCode"></param>
        /// <param name="status"></param>
        public static void UpdateChildStatus(string parentCategoryCode, string tenantID, CommonStatus status)
        {
            DataCommand cmd = new DataCommand("UpdateChildStatus");

            cmd.SetParameter("@CategoryCode", DbType.StringFixedLength, parentCategoryCode);
            cmd.SetParameter("@CommonStatus", DbType.Int32, status);
            cmd.SetParameter("@TenantID", DbType.String, tenantID);
            cmd.ExecuteNonQuery();
        }
Пример #29
0
        /// <summary>
        /// 根据名称查询文档
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static t_document LoadDocumentByName(string name, UserTagEnums?user_tag)
        {
            var cmd = new DataCommand("MockTest.LoadDocumentByName");

            cmd.SetParameter("@name", DbType.String, name);
            cmd.SetParameter("@user_tag", DbType.Int32, user_tag);
            var result = cmd.ExecuteEntity <t_document>();

            return(result);
        }
Пример #30
0
        public static string GetChildrenMaxCode(int companySysNo, int parentSysNo)
        {
            DataCommand cmd = new DataCommand("AddressGetChildrenMaxCode");

            cmd.SetParameter("@ParentSysNo", DbType.Int32, parentSysNo);
            cmd.SetParameter("@CompanySysNo", DbType.Int32, companySysNo);
            string result = cmd.ExecuteScalar <string>();

            return(result);
        }