Ejemplo n.º 1
0
        public List <RankListTop20> GetRankListTop20List(ref DataPage dp, RankListTop20 searchRankListTop20)
        {
            Expression <Func <RankListTop20, bool> > exp = CreateDydaminWhereAndExpression <RankListTop20>(searchRankListTop20);
            List <RankListTop20> resultlist = GetEntityQueryList(ref dp, exp, p => p.Id);

            return(resultlist);
        }
Ejemplo n.º 2
0
        public int InsertRankListTop20(RankListTop20 ranklisttop20)
        {
            int rs = 0;

            ctx.RankListTop20s.Add(ranklisttop20);
            rs = ctx.SaveChanges();
            return(rs);
        }
Ejemplo n.º 3
0
        public ActionResult AddRankListTop20(RankListTop20 rankListTop20)
        {
            int rs = CampEventsBll.InsertRankListTop20(rankListTop20);

            //记录日志
            Log(string.Format("新增RankListTop20 数据:{0}", rankListTop20.ToString()));

            return(EditResult(rs, "操作失败", "RankListTop20List"));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="rankListTop20">要删除的 实际使用Id删除</param>
        /// <returns></returns>
        public ActionResult DelRankListTop20(RankListTop20 rankListTop20)
        {
            int rs = CampEventsBll.DeleteRankListTop20(rankListTop20);

            //记录日志
            Log(string.Format("删除[RankListTop20]数据:{0}", rankListTop20.ToString()));

            return(DelResult(rs, "RankListTop20List"));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 增加
        /// </summary>
        /// <returns></returns>
        public ActionResult AddRankListTop20()
        {
            RankListTop20 rankListTop20 = new RankListTop20();

            //记录日志
            Log(string.Format("查看[RankListTop20]新增页面"));

            return(View(rankListTop20));
        }
Ejemplo n.º 6
0
        public int DeleteRankListTop20(RankListTop20 ranklisttop20)
        {
            int           rs         = 0;
            RankListTop20 ranktentry = ctx.RankListTop20s.Find(ranklisttop20.Id);

            if (ranktentry == null)
            {
                return(rs);
            }
            ctx.RankListTop20s.Remove(ranktentry);
            rs = ctx.SaveChanges();
            return(rs);
        }
 public int CalculateRankPacket(RankListTop20 rankinfo, int packetid)
 {
     _admin = new CampEventsAdminService.CampEventsAdminServiceClient();
     try
     {
         int rs = _admin.CalculateRankPacket(rankinfo, packetid);
         _admin.Close();
         return(rs);
     }
     catch (Exception ex)
     {
         _admin.CloseCatch(ex, "CalculateRankPacket failed");
         return(0);
     }
 }
 public int DeleteRankListTop20(RankListTop20 ranklisttop20)
 {
     _admin = new CampEventsAdminService.CampEventsAdminServiceClient();
     try
     {
         int rs = _admin.DeleteRankListTop20(ranklisttop20);
         _admin.Close();
         return(rs);
     }
     catch (Exception ex)
     {
         _admin.CloseCatch(ex, "DeleteRankListTop20 failed");
         return(0);
     }
 }
Ejemplo n.º 9
0
        public int CalculateRankPacket(RankListTop20 rankinfo, int packetid)
        {
            int    rs     = 0;
            string source = "CampEvents_RankPacket";

            rankinfo = ctx.RankListTop20s.Where(p => p.Id == rankinfo.Id).Single();
            int         sex         = ctx.UserCampLogs.Where(p => p.AreaId == rankinfo.AreaId && p.AvatarId == rankinfo.AvatarId && p.UserId == rankinfo.UserId).Select(p => p.Sex).Single();
            PacketQueue packetqueue = new PacketQueue()
            {
                UserId = rankinfo.UserId, AreaId = rankinfo.AreaId, AvatarId = rankinfo.AvatarId, Source = source, Sex = sex, PacketId = packetid
            };

            ctx.PacketQueues.Add(packetqueue);
            rs = ctx.SaveChanges();
            return(rs);
        }
        public List <RankListTop20> GetRankListTop20List(ref DataPage dp, RankListTop20 searchRankListTop20)
        {
            _admin = new CampEventsAdminService.CampEventsAdminServiceClient();
            List <RankListTop20> lists = new List <RankListTop20>();

            try
            {
                lists = _admin.GetRankListTop20List(ref dp, searchRankListTop20);
                _admin.Close();
                return(lists);
            }
            catch (Exception ex)
            {
                _admin.CloseCatch(ex, "GetRankListTop20List failed");
                return(lists);
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        ///  列表
        /// </summary>
        /// <param name="searchSort">用来搜索的实例</param>
        /// <returns></returns>
        public ActionResult RankListTop20List(DataPage dp, RankListTop20 model)
        {
            model.CreateTime = defaultDate;
            List <RankListTop20> lists = new List <RankListTop20>();

            if (Request["btnExportExcel"] == null)//导出Excel
            {
                lists = CampEventsBll.GetRankListTop20List(ref dp, model);
                GetDataPage(dp);
            }
            else
            {
                dp.PageSize = 0;
                lists       = CampEventsBll.GetRankListTop20List(ref dp, model);
                string fileName = "nothing";
                if (lists.Count() > 0)
                {
                    fileName = "RankListTop20List" + lists.Count() + "_Item";
                }
                Dictionary <string, Func <RankListTop20, string> > showFields = new Dictionary <string, Func <RankListTop20, string> >();
                showFields.Add("Id", z => "'" + z.Id.ToString());
                showFields.Add("UserId", z => "'" + z.UserId.ToString());
                showFields.Add("AvatarId", z => "'" + z.AvatarId.ToString());
                showFields.Add("AvatarName", z => "'" + z.AvatarName.ToString());
                showFields.Add("AreaId", z => "'" + z.AreaId.ToString());
                showFields.Add("AreaName", z => "'" + z.AreaName.ToString());
                showFields.Add("TotalGetPoints", z => "'" + z.TotalGetPoints.ToString());
                showFields.Add("CreateTime", z => "'" + z.CreateTime.ToString());
                showFields.Add("RankOrder", z => "'" + z.RankOrder.ToString());
                showFields.Add("CutOffDate", z => "'" + z.CutOffDate.ToString());
                showFields.Add("CampId", z => "'" + z.CampId.ToString());
                ObjectUtil.Common.ExcelHelper2 <RankListTop20> elh = new ObjectUtil.Common.ExcelHelper2 <RankListTop20>(lists, null, showFields);
                elh.FileWebSaveAs(Response, fileName);
            }
            //记录日志
            Log(string.Format("查看[RankListTop20]列表页面 搜索数据:{0}", model.ToString()));

            return(View(lists));
        }
Ejemplo n.º 12
0
        public ActionResult CalculateRankPacket(List <int> RankId, List <int> PacketId)
        {
            int rs = 0;

            for (int i = 0; i < RankId.Count; i++)
            {
                int rankid   = RankId[i];
                int packetid = PacketId[i];
                if (rankid < 1 || packetid < 1)
                {
                    continue;
                }
                RankListTop20 rank = new RankListTop20 {
                    Id = rankid
                };
                rs = CampEventsBll.CalculateRankPacket(rank, packetid) + rs;
            }

            //记录日志
            Log(string.Format("发送礼包[RankListTop20]数据:{0},{1}", RankId.ToString(), PacketId));

            return(DelResult(rs, "RankListTop20List"));
        }
Ejemplo n.º 13
0
 public int CalculateRankPacket(RankListTop20 rankinfo, int packetid)
 {
     return(_dal.CalculateRankPacket(rankinfo, packetid));
 }
Ejemplo n.º 14
0
 public List <RankListTop20> GetRankListTop20List(ref DataPage dp, RankListTop20 searchRankListTop20)
 {
     return(_dal.GetRankListTop20List(ref dp, searchRankListTop20));
 }
Ejemplo n.º 15
0
 public int DeleteRankListTop20(RankListTop20 ranklisttop20)
 {
     return(_dal.DeleteRankListTop20(ranklisttop20));
 }
Ejemplo n.º 16
0
 public int InsertRankListTop20(RankListTop20 ranklisttop20)
 {
     return(_dal.InsertRankListTop20(ranklisttop20));
 }