Exemple #1
0
        public void ProcessRequest(HttpContext context)
        {
            bool result = isTrue(context);

            if (result)
            {
                context.Response.ContentType = "text/html";
                PersonalInfo info = getData(context);

                PersonalService service = new PersonalService();
                if (service.Add(info))
                {
                    Alert.AlertMessage("入职成功");
                    context.Response.Redirect("../asp/Backstage/EmployeeAdd.aspx");
                }
                else
                {
                    Alert.AlertFailed("入职失败");
                }
            }
            else
            {
                Alert.AlertFailed("入职失败,请检查填写数据是否完整");
            }
        }
        protected int Count        = 0; //循环次数

        protected void Page_Load(object sender, EventArgs e)
        {
            PersonalService service      = new PersonalService();
            PersonalInfo    personalInfo = new PersonalInfo();

            personalInfo.Id = Session["personalID"].ToString();
            personalInfo    = service.SelectWithParameter(personalInfo)[0];
            if (personalInfo.Limit.Equals("010"))
            {
                personalInfos = new PersonalService().SelectPersonalNoParameter();
            }
            else if (personalInfo.Limit.Equals("002"))
            {
                PersonalInfo ParameterInfo = new PersonalInfo();
                ParameterInfo.Id         = null;
                ParameterInfo.Department = personalInfo.Department;
                personalInfos            = new PersonalService().SelectWithParameter(ParameterInfo);
            }

            if (Request["pageIndex"] != null)
            {
                pageIndex    = Convert.ToInt16(Request["pageIndex"]);
                contentIndex = (pageIndex - 1) * 15;
                if (Request["pageIndex"].Equals("1"))
                {
                    contentIndex = 0;
                }
            }
            total     = personalInfos.ToArray().Length;
            pageTotal = (total / 15) + 1;
        }
Exemple #3
0
        /// <summary>
        /// 检查是否看过该帖子,没看过,金币是否足够查看
        /// </summary>
        public ApiResult CanViewPlan(int id, int ltype, int uid, int coin)
        {
            //step1.查询用户是否点阅过该帖子
            string readRecordSql = @"select count(1) from ComeOutRecord where [Type]=@Type and UserId=@UserId and OrderId=@Id";

            var readRecordParameter = new[]
            {
                new SqlParameter("@Type", (int)TransactionTypeEnum.点阅),
                new SqlParameter("@UserId", uid),
                new SqlParameter("@Id", id),
            };

            object objReadRecord = SqlHelper.ExecuteScalar(readRecordSql, readRecordParameter);

            if (objReadRecord != null && Convert.ToInt32(objReadRecord) > 0)
            {
                //已经点阅过,直接跳转
                return(new ApiResult());
            }
            UserInfo user = PersonalService.GetUser(uid);

            //step2.判断当前用户积分是否小于查看帖子所需金币
            if (coin > user.Coin)
            {
                return(new ApiResult(60015, "金币数不足"));
            }
            return(new ApiResult());
        }
        public void ProcessRequest(HttpContext context)
        {
            bool result = isTrue(context);

            if (result)
            {
                context.Response.ContentType = "text/html";
                PersonalInfo info = getData(context);

                PersonalService service = new PersonalService();
                if (service.Update(info))
                {
                    Alert.AlertMessage("修改成功");
                    context.Session.Add("personalID", info.Id);
                    context.Response.Redirect("../asp/Backstage/EmployeePersonalCenter.aspx");
                }
                else
                {
                    Alert.AlertFailed("修改失败");
                }
            }
            else
            {
                Alert.AlertFailed("修改失败,请检查输入信息是否为空");
            }
        }
Exemple #5
0
        protected int Count        = 0;          //循环次数

        protected void Page_Load(object sender, EventArgs e)
        {
            PersonalService service      = new PersonalService();
            PersonalInfo    personalInfo = new PersonalInfo();

            personalInfo.Id = Session["personalID"].ToString();
            personalInfo    = service.SelectWithParameter(personalInfo)[0];
            BookInfo info = new BookInfo();

            info.Id           = null;
            info.IsDelete     = "0";
            info.IsTrue       = "0";
            info.IsPass       = "******";
            info.AuditOpinion = null;
            if (personalInfo.Limit.Equals("010"))
            {
                bookInfos = new BookService().SelectBookWithParameter(info);
            }
            else
            {
                info.BookTypeID = personalInfo.Department;
                bookInfos       = new BookService().SelectBookWithParameter(info);
            }
            if (Request["pageIndex"] != null)
            {
                pageIndex    = Convert.ToInt16(Request["pageIndex"]);
                contentIndex = (pageIndex - 1) * 15;
                if (Request["pageIndex"].Equals("1"))
                {
                    contentIndex = 0;
                }
            }
            total     = bookInfos.ToArray().Length;
            pageTotal = (total / 15) + 1;
        }
Exemple #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PersonalService service = new PersonalService();

            info.Id = Session["personalID"].ToString();
            info    = service.SelectWithParameter(info)[0];
        }
Exemple #7
0
        public IActionResult Panel(string username, string password)
        {
            PersonalService personalService = new PersonalService();

            ViewData["error"] = true;

            ViewData["url"] = "../Home/Panel";

            Personal p = personalService.getPersonalByRut(username);

            //rut oka
            if (p.Rut_personal != null || p.Rut_personal != "")
            {
                //contraseña
                //string passwordHash = BCrypt.Net.BCrypt.HashPassword(password, BCrypt.Net.BCrypt.GenerateSalt());


                bool verificado = BCrypt.Net.BCrypt.Verify(password, p.Contrasena_personal);


                if (verificado)
                {
                    //falta arrancar la sesión
                    ViewData["personal"] = p;

                    return(View("Panel"));
                }
                else
                {
                    return(View("Index"));
                }
            }

            return(View("Index"));
        }
 public SalesController()
 {
     salesService    = new SalesService();
     productService  = new ProductService();
     personalService = new PersonalService();
     brandService    = new BrandService();
     customerService = new CustomerService();
 }
Exemple #9
0
        public Monobank(HttpClient client, string apiKey = null)
        {
            if (client == null)
            {
                throw new Exception("HttpClient cannot be null");
            }

            Currency = new CurrencyService(client);
            Personal = new PersonalService(client, apiKey);
        }
Exemple #10
0
        public ApiResult IFollow(long followedUserId)
        {
            if (followedUserId <= 0)
            {
                return(new ApiResult(60009, "已关注的会员ID不正确"));
            }
            PersonalService service = new PersonalService();

            return(service.IFollow(followedUserId, this.UserInfo.UserId));
        }
Exemple #11
0
        public ApiResult <PagedListP <BetModel> > GetBet(int pid = 0, int pageIndex = 1, int pageSize = 20)
        {
            PersonalService       service = new PersonalService();
            PagedListP <BetModel> resDto  = service.GetBet(pid, pageIndex, pageSize, this.UserInfo.UserId);

            return(new ApiResult <PagedListP <BetModel> >()
            {
                Data = resDto
            });
        }
Exemple #12
0
        public ApiResult <PagedListP <AchievementModel> > GetMyBet(int lType, string PlayName, int pageIndex = 1, int pageSize = 20)
        {
            PersonalService service = new PersonalService();
            PagedListP <AchievementModel> resDto = service.GetMyBet(lType, PlayName, pageIndex, pageSize, this.UserInfo.UserId);

            return(new ApiResult <PagedListP <AchievementModel> >()
            {
                Data = resDto
            });
        }
Exemple #13
0
        public ApiResult <PagedListP <AccessRecord> > GetVisitRecord(long uid = 0, int pageIndex = 1, int pageSize = 20)
        {
            PersonalService           service = new PersonalService();
            PagedListP <AccessRecord> resDto  = service.GetVisitRecord(uid, pageIndex, pageSize, this.UserInfo.UserId);

            return(new ApiResult <PagedListP <AccessRecord> >()
            {
                Data = resDto
            });
        }
Exemple #14
0
        public ApiResult <PagedListP <SystemMessage> > GetSysMessage(long uid = 0, int pageIndex = 1, int pageSize = 20)
        {
            PersonalService            service = new PersonalService();
            PagedListP <SystemMessage> resDto  = service.GetSysMessage(uid, pageIndex, pageSize, this.UserInfo.UserId);

            return(new ApiResult <PagedListP <SystemMessage> >()
            {
                Data = resDto
            });
        }
Exemple #15
0
        public ApiResult <List <TaskResDto> > GetTaskList()
        {
            PersonalService   service = new PersonalService();
            List <TaskResDto> resDto  = service.GetTaskList(this.UserInfo.UserId);

            return(new ApiResult <List <TaskResDto> >()
            {
                Code = 100, Desc = "", Data = resDto
            });
        }
Exemple #16
0
        public ApiResult <PagedListP <BettingRecord> > GetPlan(long uid = 0, int ltype = 0, int winState = 0, int pageIndex = 1, int pageSize = 20)
        {
            PersonalService            service = new PersonalService();
            PagedListP <BettingRecord> resDto  = service.GetPlan(uid, ltype, winState, pageIndex, pageSize, this.UserInfo.UserId);

            return(new ApiResult <PagedListP <BettingRecord> >()
            {
                Data = resDto
            });
        }
Exemple #17
0
        public ApiResult <List <MyFanResDto> > GetMyFans(int lastId = 0, int pageSize = 10)
        {
            PersonalService    service = new PersonalService();
            List <MyFanResDto> resDto  = service.GetMyFans(pageSize, this.UserInfo.UserId, lastId);

            return(new ApiResult <List <MyFanResDto> >()
            {
                Data = resDto
            });
        }
Exemple #18
0
        public ApiResult <PagedListP <ComeOutRecordModel> > GetMyCommissionList(int Type, int pageIndex = 1, int pageSize = 20)
        {
            PersonalService service = new PersonalService();
            PagedListP <ComeOutRecordModel> resDto = service.GetMyCommissionList(Type, pageIndex, pageSize, this.UserInfo.UserId);

            return(new ApiResult <PagedListP <ComeOutRecordModel> >()
            {
                Data = resDto
            });
        }
Exemple #19
0
        public ApiResult <PagedListP <Comment> > GetDenamic(long uid = 0, int pageIndex = 1, int pageSize = 20)
        {
            PersonalService      service = new PersonalService();
            PagedListP <Comment> resDto  = service.GetDenamic(uid, pageIndex, pageSize, this.UserInfo.UserId);


            return(new ApiResult <PagedListP <Comment> >()
            {
                Data = resDto
            });
        }
Exemple #20
0
        /// <summary>
        /// 打赏
        /// </summary>
        public ApiResult GiftCoin(int id, int coin, long userId)
        {
            var user = PersonalService.GetUser(userId);

            #region 校验
            //step1.验证金币输入是否正确
            if (coin < 10)
            {
                return(new ApiResult(60016, "最低打赏10金币"));
            }
            //step2.验证帖子是否存在
            var model = Util.GetEntityById <BettingRecord>(id);
            if (model == null)
            {
                return(new ApiResult(60017, "该计划不存在"));
            }

            if (model.UserId == userId)
            {
                return(new ApiResult(60019, "不能打赏你自己"));
            }

            //step3.验证用户金币是否充足
            if (user.Coin < coin)
            {
                return(new ApiResult(60018, "金币余额不足"));
            }
            #endregion


            StringBuilder sqlBuilder = new StringBuilder();
            //step4.扣除打赏人账户金币
            sqlBuilder.AppendFormat("UPDATE dbo.UserInfo SET Coin-={1} WHERE Id={0};", user.Id, coin);
            //step5.添加打赏记录
            sqlBuilder.AppendFormat(@"INSERT INTO [dbo].[ComeOutRecord]([UserId],[OrderId],[Type] ,[Money],[State],[SubTime])
                                        VALUES({0},{1},{2},{3}, 1, GETDATE());", user.Id, id, (int)TransactionTypeEnum.打赏, coin);

            var userRateSetting = GetCommissionSetting().FirstOrDefault(x => x.LType == GetlType(model.lType) && x.Type == (int)CommissionTypeEnum.打赏佣金);
            if (userRateSetting != null && userRateSetting.Percentage > 0)
            {
                int commission = (int)(userRateSetting.Percentage * coin);
                //step6.发放发帖人金币账户
                sqlBuilder.AppendFormat("UPDATE dbo.UserInfo SET Money+={1} WHERE Id={0};", model.UserId, commission);
                //step7.添加打赏佣金记录
                sqlBuilder.AppendFormat(@"INSERT INTO [dbo].[ComeOutRecord]([UserId],[OrderId],[Type] ,[Money],[State],[SubTime])
                                            VALUES({0},{1},{2},{3}, 1, GETDATE());", user.Id, id, (int)TransactionTypeEnum.打赏佣金, commission);
            }

            //LogHelper.WriteLog(sqlBuilder.ToString());
            SqlHelper.ExecuteTransaction(sqlBuilder.ToString());

            return(new ApiResult(100, "打赏成功"));
        }
Exemple #21
0
        public ApiResult <PagedListP <UserCoupon> > UserCouponList(int type, int pageIndex = 1, int pageSize = 20)
        {
            long userId = this.UserInfo.UserId;

            PersonalService         service = new PersonalService();
            PagedListP <UserCoupon> resDto  = service.GetMyUserCouponList(type, pageIndex, pageSize, userId);

            return(new ApiResult <PagedListP <UserCoupon> >()
            {
                Data = resDto
            });
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            PersonalService service = new PersonalService();

            personalInfo.Id = Session["personalID"].ToString();
            personalInfo    = service.SelectWithParameter(personalInfo)[0];
            if (personalInfo.Limit.Equals("010"))
            {
                departmentInfos = new DepartmentService().SelectDepartmentNoParameter();
                limitInfos      = new LimitService().SelectNoParameter();
            }
        }
Exemple #23
0
        public ApiResult AddVisitRecord(AddVisitRecordReqDto reqDto)
        {
            #region 校验

            if (reqDto == null)
            {
                return(new ApiResult(40000, "验证参数失败"));
            }

            #endregion

            PersonalService service = new PersonalService();
            return(service.AddVisitRecord(reqDto.Id, this.UserInfo.UserId, reqDto.Module));
        }
Exemple #24
0
        public ApiResult EditUserInfo(EditUserInfoReqDto model)
        {
            if (string.IsNullOrWhiteSpace(model.value))
            {
                return(new ApiResult(60005, "新值不能为空"));
            }
            if (model.type != 1 && model.type != 2 && model.type != 3)
            {
                return(new ApiResult(60006, "类型在1-3之间"));
            }
            PersonalService service = new PersonalService();

            return(service.EditUserInfo(model.value, model.type, this.UserInfo.UserId));
        }
Exemple #25
0
        //главный де се ри а ли за тор
        public object Deserialize(string filePath)
        {
            int    posInLine = 0;
            string line;
            object myObject = new PersonalService[1];

            using (StreamReader fileStream = new StreamReader(filePath, Encoding.UTF8))
            {
                line = fileStream.ReadLine();
                //определяем главный класс (keyboard|strings|wind|instumentaccessories) и кидаем его в парсер по полям
                Type objType = Type.GetType(GetWord(line, ref posInLine));
                myObject = ObjectDeserializer(objType, line, ref posInLine);
            }
            return(myObject);
        }
Exemple #26
0
        public ApiResult <IndexResDto> PersonalIndexData(long uid)
        {
            PersonalService service = new PersonalService();

            uid = uid > 0 ? uid : UserInfo.UserId;
            IndexResDto resDto = service.GetPersonalIndexData(uid);

            if (resDto == null)
            {
                return(new ApiResult <IndexResDto>(60000, "登录超时,需要重新登录"));
            }

            return(new ApiResult <IndexResDto>()
            {
                Data = resDto
            });
        }
Exemple #27
0
        public ApiResult ModifyPWD(ModifyPwdReqDto model)
        {
            if (string.IsNullOrWhiteSpace(model.oldpwd))
            {
                return(new ApiResult(60001, "旧密码不能为空"));
            }
            if (string.IsNullOrWhiteSpace(model.newpwd))
            {
                return(new ApiResult(60002, "新密码不能为空"));
            }
            if (model.newpwd.Length < 6 || model.newpwd.Length > 12)
            {
                return(new ApiResult(60003, "新密码长度要在6-12位之间"));
            }

            PersonalService service = new PersonalService();

            return(service.ModifyPWD(model.oldpwd, model.newpwd, this.UserInfo.UserId));
        }
Exemple #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PersonalService service = new PersonalService();

            personalInfo.Id = Session["personalID"].ToString();
            personalInfo    = service.SelectWithParameter(personalInfo)[0];
            departmentInfos = new DepartmentService().SelectDepartmentNoParameter();

            if (Request["pageIndex"] != null)
            {
                pageIndex    = Convert.ToInt16(Request["pageIndex"]);
                contentIndex = (pageIndex - 1) * 15;
                if (Request["pageIndex"].Equals("1"))
                {
                    contentIndex = 0;
                }
            }
            total     = departmentInfos.ToArray().Length;
            pageTotal = (total / 15) + 1;
        }
        public void ProcessRequest(HttpContext context)
        {
            bool result = isTrue(context);

            if (result)
            {
                context.Response.ContentType = "text/html";
                PersonalInfo info = getData(context);

                PersonalService     service     = new PersonalService();
                List <PersonalInfo> resultCount = service.SelectWithParameter(info);

                if (resultCount.ToArray().Length > 0)
                {
                    for (int i = 0; i < resultCount.ToArray().Length; i++)
                    {
                        if (resultCount[i].PId.Equals(info.PId) && resultCount[i].Pwd.Equals(info.Pwd))
                        {
                            Alert.AlertMessage("登录成功");
                            context.Session.Add("personalID", resultCount[i].Id);
                            context.Response.Redirect("../asp/Backstage/EmployeePersonalCenter.aspx");
                        }
                        else
                        {
                            Alert.AlertFailed("登录失败,用户名或密码错误");
                        }
                    }
                }
                else
                {
                    Alert.AlertFailed("登录失败,请确定是否有此用户");
                }
            }
            else
            {
                Alert.AlertFailed("登录失败,用户名或密码错误");
            }
        }
Exemple #30
0
        public void ProcessRequest(HttpContext context)
        {
            bool result = isTrue(context);

            if (result)
            {
                HttpRequest request = context.Request;
                context.Response.ContentType = "text/html";
                PersonalInfo info = new PersonalInfo();
                info.Id  = context.Session["personalID"].ToString();
                info.Pwd = request["Pwd"];

                PersonalService service = new PersonalService();
                if (service.SelectWithParameter(info).ToArray().Length > 0)
                {
                    info.Pwd = request["NewPwd"];
                    if (service.Update(info))
                    {
                        Alert.AlertMessage("修改成功");
                        context.Session.Add("personalID", info.Id);
                        context.Response.Redirect("../asp/Backstage/EmployeePwd.aspx");
                    }
                    else
                    {
                        Alert.AlertFailed("修改失败,请重试");
                    }
                }
                else
                {
                    Alert.AlertFailed("修改失败,原密码错误");
                }
            }
            else
            {
                Alert.AlertFailed("修改失败,请检查填写内容是否正确");
            }
        }