コード例 #1
0
        public ZhaoPin GetObjById(string id)
        {
            string sql = "select * from Zp_Info where zpId='{0}'";

            sql = string.Format(sql, id);
            SqlDataReader dr  = SQLHelper.GetReader(sql);
            ZhaoPin       obj = null;

            if (dr.Read())
            {
                obj = new ZhaoPin
                {
                    zpId       = Convert.ToInt32(dr["zpId"]),
                    zpXuqiu    = dr["zpXuqiu"].ToString(),
                    zpZhuTilei = dr["zpZhuTilei"].ToString(),
                    zpZhuti    = dr["zpZhuti"].ToString(),
                    zpArea     = dr["zpArea"].ToString(),
                    zpGangwei  = dr["zpGangwei"].ToString(),
                    zpNum      = Convert.ToInt32(dr["zpNum"]),
                    zpPayL     = dr["zpPayL"].ToString(),
                    zpPayH     = dr["zpPayH"].ToString(),
                    zpFuli     = dr["zpFuli"].ToString(),
                    zpDetail   = dr["zpDetail"].ToString(),
                    zpUser     = dr["zpUser"].ToString(),
                    zpPhone    = dr["zpPhone"].ToString(),
                    zpFaburen  = dr["zpFaburen"].ToString(),
                    zpEndtime  = Convert.ToDateTime(dr["zpEndtime"]),
                    zpAddtime  = Convert.ToDateTime(dr["zpAddtime"]),
                    isTuijian  = Convert.ToInt32(dr["isTuijian"]),
                    isRemen    = Convert.ToInt32(dr["isRemen"])
                };
            }

            return(obj);
        }
コード例 #2
0
ファイル: MobileController.cs プロジェクト: wanziR/rencai
        public ActionResult GetAdd(ZhaoPin obj)
        {
            obj = new ZhaoPin
            {
                zpXuqiu    = obj.zpXuqiu,
                zpZhuTilei = obj.zpZhuTilei,
                zpZhuti    = obj.zpZhuti,
                zpArea     = obj.zpArea,
                zpGangwei  = obj.zpGangwei,
                zpNum      = obj.zpNum,
                zpPayL     = obj.zpPayL,
                zpPayH     = obj.zpPayH,
                zpFuli     = obj.zpFuli,
                zpDetail   = obj.zpDetail,
                zpUser     = obj.zpUser,
                zpPhone    = obj.zpPhone,
                zpFaburen  = obj.zpFaburen,
                //zpAddtime = obj.admin_name,
                zpEndtime = obj.zpEndtime
            };
            int    result = new ZhaoPinBLL().Add(obj);
            string info   = "添加成功!";

            return(RedirectToAction("zpFabu", new { info }));
        }
コード例 #3
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Update(ZhaoPin model, SqlTransaction tran = null)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update ZhaoPin set ");
            strSql.Append("Publisher=@Publisher,Gangwei=@Gangwei,Money=@Money,Study=@Study,WorkHistory=@WorkHistory,WorkPlace=@WorkPlace,CName=@CName,CLogo=@CLogo,CPeople=@CPeople,CVip=@CVip,Contact=@Contact,CreateTime=@CreateTime,IsDelete=@IsDelete,JobWord=@JobWord,JobPic=@JobPic,PayType=@PayType,IsPay=@IsPay,CDesc=@CDesc,PVCount=@PVCount,JobRequire=@JobRequire,IsJinghua=@IsJinghua,IsRemen=@IsRemen,IsTop=@IsTop,WorkeType=@WorkeType,WorkTime=@WorkTime,BelongJobTrade=@BelongJobTrade,BelongJob=@BelongJob,JobFuLi=@JobFuLi,NeedCount=@NeedCount,ValidTime=@ValidTime,UpdateTime=@UpdateTime,UpdateUser=@UpdateUser");

            strSql.Append(" where ZhaoPinID=@ZhaoPinID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Publisher",      model.Publisher),
                new SqlParameter("@Gangwei",        model.Gangwei),
                new SqlParameter("@Money",          model.Money),
                new SqlParameter("@Study",          model.Study),
                new SqlParameter("@WorkHistory",    model.WorkHistory),
                new SqlParameter("@WorkPlace",      model.WorkPlace),
                new SqlParameter("@CName",          model.CName),
                new SqlParameter("@CLogo",          model.CLogo),
                new SqlParameter("@CPeople",        model.CPeople),
                new SqlParameter("@CVip",           model.CVip),
                new SqlParameter("@Contact",        model.Contact),
                new SqlParameter("@CreateTime",     model.CreateTime),
                new SqlParameter("@IsDelete",       model.IsDelete),
                new SqlParameter("@JobWord",        model.JobWord),
                new SqlParameter("@JobPic",         model.JobPic),
                new SqlParameter("@PayType",        model.PayType),
                new SqlParameter("@IsPay",          model.IsPay),
                new SqlParameter("@CDesc",          model.CDesc),
                new SqlParameter("@PVCount",        model.PVCount),
                new SqlParameter("@JobRequire",     model.JobRequire),
                new SqlParameter("@IsJinghua",      model.IsJinghua),
                new SqlParameter("@IsRemen",        model.IsRemen),
                new SqlParameter("@IsTop",          model.IsTop),
                new SqlParameter("@WorkeType",      model.WorkeType),
                new SqlParameter("@WorkTime",       model.WorkTime),
                new SqlParameter("@BelongJobTrade", model.BelongJobTrade),
                new SqlParameter("@BelongJob",      model.BelongJob),
                new SqlParameter("@JobFuLi",        model.JobFuLi),
                new SqlParameter("@NeedCount",      model.NeedCount),
                new SqlParameter("@ValidTime",      model.ValidTime),
                new SqlParameter("@UpdateTime",     model.UpdateTime),
                new SqlParameter("@UpdateUser",     model.UpdateUser),


                new SqlParameter("@ZhaoPinID",      model.ZhaoPinID)
            };

            if (tran == null)
            {
                return(SqlHelper.ExecuteSql(strSql.ToString(), CommandType.Text, parameters) > 0);
            }
            else
            {
                return(SqlHelper.ExecuteSql(tran, CommandType.Text, strSql.ToString(), parameters) > 0);
            }
        }
コード例 #4
0
        /// <summary>
        /// 添加一条数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Add(ZhaoPin model, SqlTransaction tran = null)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into ZhaoPin(");
            strSql.Append(" Publisher,Gangwei,Money,Study,WorkHistory,WorkPlace,CName,CLogo,CPeople,CVip,Contact,CreateTime,IsDelete,JobWord,JobPic,PayType,IsPay,CDesc,PVCount,JobRequire,IsJinghua,IsRemen,IsTop,WorkeType,WorkTime,BelongJobTrade,BelongJob,JobFuLi,NeedCount,ValidTime,UpdateTime,UpdateUser )");
            strSql.Append(" values (");
            strSql.Append("@Publisher,@Gangwei,@Money,@Study,@WorkHistory,@WorkPlace,@CName,@CLogo,@CPeople,@CVip,@Contact,@CreateTime,@IsDelete,@JobWord,@JobPic,@PayType,@IsPay,@CDesc,@PVCount,@JobRequire,@IsJinghua,@IsRemen,@IsTop,@WorkeType,@WorkTime,@BelongJobTrade,@BelongJob,@JobFuLi,@NeedCount,@ValidTime,@UpdateTime,@UpdateUser);select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Publisher",      model.Publisher),
                new SqlParameter("@Gangwei",        model.Gangwei),
                new SqlParameter("@Money",          model.Money),
                new SqlParameter("@Study",          model.Study),
                new SqlParameter("@WorkHistory",    model.WorkHistory),
                new SqlParameter("@WorkPlace",      model.WorkPlace),
                new SqlParameter("@CName",          model.CName),
                new SqlParameter("@CLogo",          model.CLogo),
                new SqlParameter("@CPeople",        model.CPeople),
                new SqlParameter("@CVip",           model.CVip),
                new SqlParameter("@Contact",        model.Contact),
                new SqlParameter("@CreateTime",     model.CreateTime),
                new SqlParameter("@IsDelete",       model.IsDelete),
                new SqlParameter("@JobWord",        model.JobWord),
                new SqlParameter("@JobPic",         model.JobPic),
                new SqlParameter("@PayType",        model.PayType),
                new SqlParameter("@IsPay",          model.IsPay),
                new SqlParameter("@CDesc",          model.CDesc),
                new SqlParameter("@PVCount",        model.PVCount),
                new SqlParameter("@JobRequire",     model.JobRequire),
                new SqlParameter("@IsJinghua",      model.IsJinghua),
                new SqlParameter("@IsRemen",        model.IsRemen),
                new SqlParameter("@IsTop",          model.IsTop),
                new SqlParameter("@WorkeType",      model.WorkeType),
                new SqlParameter("@WorkTime",       model.WorkTime),
                new SqlParameter("@BelongJobTrade", model.BelongJobTrade),
                new SqlParameter("@BelongJob",      model.BelongJob),
                new SqlParameter("@JobFuLi",        model.JobFuLi),
                new SqlParameter("@NeedCount",      model.NeedCount),
                new SqlParameter("@ValidTime",      model.ValidTime),
                new SqlParameter("@UpdateTime",     model.UpdateTime),
                new SqlParameter("@UpdateUser",     model.UpdateUser),
            };

            object obj;

            if (tran == null)
            {
                obj = SqlHelper.GetSingle(strSql.ToString(), CommandType.Text, parameters);
            }
            else
            {
                obj = SqlHelper.GetSingle(tran, CommandType.Text, strSql.ToString(), parameters);
            }
            return(obj == null ? 0 : Convert.ToInt32(obj));
        }
コード例 #5
0
ファイル: ZhaoPinBLL.cs プロジェクト: ccxlimin/baixiaotang
        /// <summary>
        /// 修改 (可能有其他业务逻辑检查)
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ResultInfo Update(ZhaoPin model)
        {
            ResultInfo ri = new ResultInfo();

            if (Edit(model))
            {
                ri.Ok  = true;
                ri.Msg = "修改成功";
            }

            return(ri);
        }
コード例 #6
0
ファイル: PayController.cs プロジェクト: ccxlimin/baixiaotang
        public void AliPayNotifyZhaoPin()
        {
            string result = PayCallBack(order =>
            {
                //成功回调
                ZhaoPin model  = ZhaoPinBLL.Instance.GetZhaoPinBuyPay(order.ItemID.Value);
                model.IsDelete = 0;
                if (ZhaoPinBLL.Instance.Update(model).Ok)
                {
                    //通知
                    NoticeBLL.Instance.OnPayPublish_Notice_Author(order.CreateUser.ToInt64(), order.CreateTime.Value, GetDomainName + ConfigHelper.AppSettings("ZhaoPinDetail").FormatWith(order.ItemID), model.Gangwei, 30, order.Fee.ToString(), NoticeTypeEnum.ZhaoPin_Pay_Publish);
                }
            });

            Response.Write(result);
        }
コード例 #7
0
        public int Add(ZhaoPin obj)
        {
            StringBuilder sqlBuilder = new StringBuilder();

            sqlBuilder.Append("insert into Zp_Info(zpXuqiu, zpZhuTilei, zpZhuti, zpArea, zpGangwei, zpNum, zpPayL, zpPayH, zpFuli, zpDetail, zpUser, zpPhone, zpFaburen, zpAddtime, zpEndtime) ");
            sqlBuilder.Append("values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}')");
            string sql = string.Format(sqlBuilder.ToString(), obj.zpXuqiu, obj.zpZhuTilei, obj.zpZhuti, obj.zpArea, obj.zpGangwei, obj.zpNum, obj.zpPayL, obj.zpPayH, obj.zpFuli, obj.zpDetail, obj.zpUser, obj.zpPhone, obj.zpFaburen, DateTime.Now, obj.zpEndtime);

            try
            {
                return(Convert.ToInt32(SQLHelper.Update(sql)));
            }
            catch (SqlException ex)
            {
                throw new Exception("数据库操作出现异常!具体信息:\r\n" + ex.Message);
            }
        }
コード例 #8
0
ファイル: ZhaoPinBLL.cs プロジェクト: ccxlimin/baixiaotang
        /// <summary>
        /// 保存 (可能有其他业务逻辑检查)
        /// </summary>
        /// <param name="model">实体</param>
        /// <returns></returns>
        public ResultInfo Create(ZhaoPin model, SqlTransaction tran)
        {
            ResultInfo ri = new ResultInfo();

            if (model == null)
            {
                return(ri);
            }

            int result = Add(model, tran);

            if (result > 0)
            {
                ri.Ok  = true;
                ri.Msg = "添加成功";
            }

            return(ri);
        }
コード例 #9
0
        public ActionResult Delete(long id)
        {
            ResultInfo ri = new ResultInfo();

            if (UserBaseBLL.Instance.IsRoot)
            {
                if (id > 0)
                {
                    ZhaoPin model = ZhaoPinBLL.Instance.GetModel(id);
                    if (model != null)
                    {
                        if (model.IsDelete == 1)
                        {
                            ri.Msg = "该求职信息已被删除";
                        }
                        else
                        {
                            model.IsDelete = 1;
                            ri             = ZhaoPinBLL.Instance.Update(model);
                        }
                    }
                    else
                    {
                        ri.Msg = "异常";
                    }
                }
                else
                {
                    ri.Msg = "异常";
                }
            }
            else
            {
                ri.Msg = "你没有权限进行此操作";
            }

            return(Result(ri));
        }
コード例 #10
0
        private ResultInfo CheckEmpty(ZhaoPin model)
        {
            ResultInfo ri = new ResultInfo();

            if (CheckPrototype(model.CName, "公司名称", ri))
            {
                if (CheckPrototype(model.CPeople, "公司人数", ri))
                {
                    if (CheckPrototype(model.Gangwei, "招聘岗位", ri))
                    {
                        if (CheckPrototype(model.Money, "薪资待遇", ri))
                        {
                            if (CheckPrototype(model.Study, "学历要求", ri))
                            {
                                if (CheckPrototype(model.WorkHistory, "工作经验", ri))
                                {
                                    if (CheckPrototype(model.WorkPlace, "工作地点", ri))
                                    {
                                        if (CheckPrototype(model.Contact, "联系方式", ri))
                                        {
                                            if (CheckPrototype(model.CDesc, "公司简介", ri))
                                            {
                                                if (CheckPrototype(model.JobRequire, "职位要求", ri))
                                                {
                                                    ri.Ok = true;
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(ri);
        }
コード例 #11
0
        public ActionResult Light(long id = 0)
        {
            ResultInfo <DateTime> ri = new ResultInfo <DateTime>();

            if (id > 0)
            {
                ZhaoPin model = ZhaoPinBLL.Instance.GetModel(id);
                if (model != null)
                {
                    if (DateTime.Now >= model.ValidTime)
                    {
                        DateTime time = DateTime.Now.AddDays(30);
                        model.ValidTime = time;
                        if (ZhaoPinBLL.Instance.Update(model).Ok)
                        {
                            ri.Ok   = true;
                            ri.Msg  = "成功擦亮,有效时间延长30天!";
                            ri.Data = time;
                        }
                    }
                    else
                    {
                        ri.Msg = "招聘信息未失效,无需擦亮!";
                    }
                }
                else
                {
                    ri.Msg = "招聘信息不存在!";
                }
            }
            else
            {
                ri.Msg = "招聘信息不存在!";
            }
            return(Result(ri));
        }
コード例 #12
0
ファイル: ZhaoPinController.cs プロジェクト: wanziR/rencai
         public ActionResult GetAdd(ZhaoPin obj)
 {
     if (obj.zpGangwei == null)
     {
         string warningText = "岗位信息不能为空!";
         return(this.Content("<script>$(function(){warning('" + warningText + "');})</script>"));
     }
     if (obj.zpZhuti == null)
     {
         string warningText = "主体信息不能为空!";
         return(this.Content("<script>$(function(){warning('" + warningText + "');})</script>"));
     }
     if (obj.zpNum < 1)
     {
         string warningText = "招聘人数不能为空!";
         return(this.Content("<script>$(function(){warning('" + warningText + "');})</script>"));
     }
     if (obj.zpArea == null)
     {
         string warningText = "招聘地区不能为空!";
         return(this.Content("<script>$(function(){warning('" + warningText + "');})</script>"));
     }
     if (obj.zpPayL == null)
     {
         string warningText = "薪资待遇不能为空!";
         return(this.Content("<script>$(function(){warning('" + warningText + "');})</script>"));
     }
     if (obj.zpUser == null)
     {
         string warningText = "联系人不能为空!";
         return(this.Content("<script>$(function(){warning('" + warningText + "');})</script>"));
     }
     else
     {
         obj = new ZhaoPin
         {
             zpXuqiu    = obj.zpXuqiu,
             zpZhuTilei = obj.zpZhuTilei,
             zpZhuti    = obj.zpZhuti,
             zpArea     = obj.zpArea,
             zpGangwei  = obj.zpGangwei,
             zpNum      = obj.zpNum,
             zpPayL     = obj.zpPayL,
             zpPayH     = obj.zpPayH,
             zpFuli     = obj.zpFuli,
             zpDetail   = obj.zpDetail,
             zpUser     = obj.zpUser,
             zpPhone    = obj.zpPhone,
             zpFaburen  = obj.zpFaburen,
             //zpAddtime = obj.admin_name,
             zpEndtime = obj.zpEndtime
         };
         int result = new ZhaoPinBLL().Add(obj);
         if (Request.IsAjaxRequest())
         {
             string successText = "添加成功!";
             return(this.Content("<script>$(function(){success('" + successText + "');})</script>"));
         }
         else
         {
             return(this.Content("不是Ajax提交"));
             //return this.Content("<script>window.location='" + Url.Action("GetList", "SysAdmin") + "'</script>");
         }
     }
 }
コード例 #13
0
        public ActionResult Fee(int id = 0, int type = 1)
        {
            ResultInfo <string> ri = new ResultInfo <string>();

            if (IsLogin)
            {
                if (id > 0)
                {
                    string contact = string.Empty;
                    string keyType = string.Empty;
                    if (type == 1)
                    {
                        ZhaoPin model = ZhaoPinBLL.Instance.GetModel(id);
                        keyType = "FeeHRZhaoPinValue";
                        contact = model.Contact;
                    }
                    else if (type == 2)
                    {
                        keyType = "FeeHRQiuZhiValue";
                        QiuZhi model = QiuZhiBLL.Instance.GetModel(id);
                        contact = model.Contact;
                        ri.Url  = model.JianLiPic;
                    }
                    else
                    {
                        keyType = "FeeHRProductValue";
                        Product model = ProductBLL.Instance.GetModel(id);
                        contact = model.Contact;
                    }

                    BeginTran();

                    int value    = Convert.ToInt32(ConfigHelper.AppSettings(keyType));
                    int cointype = 2;

                    //判断有无足够vip分
                    if (UserExtBLL.Instance.HasEnoughCoin(cointype, value, UserID))
                    {
                        //扣除相应分数
                        if (UserExtBLL.Instance.SubScore(UserID, value, cointype, Tran))
                        {
                            //记录流水
                            if (ScoreCoinLogBLL.Instance.Log(-value, cointype, CoinSourceEnum.SeeZhaoPinInfo, UserID, UserInfo.UserName, Tran))
                            {
                                //记录答案表
                                FeeHR fee = new FeeHR()
                                {
                                    FeeTime     = DateTime.Now,
                                    FeeType     = type,
                                    IsDelete    = 0,
                                    MainID      = id,
                                    UserID      = UserID,
                                    FeeCoin     = value,
                                    FeeCoinType = cointype
                                };
                                int result = FeeHRBLL.Instance.Add(fee, Tran);
                                if (result > 0)
                                {
                                    ri.Ok   = true;
                                    ri.Data = contact;
                                    Commit();
                                }
                                else
                                {
                                    RollBack();
                                    ri.Msg = "消费失败";
                                }
                            }
                            else
                            {
                                RollBack();
                                ri.Msg = "消费失败";
                            }
                        }
                        else
                        {
                            RollBack();
                            ri.Msg = "消费失败";
                        }
                    }
                    else
                    {
                        ri.Msg = "VIP分不足,请前往个人中心充值";
                    }
                }
                else
                {
                    ri.Msg = "信息不存在";
                }
            }
            else
            {
                ri.Msg = "请先登录";
                ri.Url = "/Account/Login";
            }
            return(Result(ri));
        }
コード例 #14
0
        public void TD(long actionid, string actionid2, string actionid3 = "-1")
        {
            string msg = string.Empty;

            try
            {
                int    mainType = Convert.ToInt32(actionid3);
                long   mainID   = actionid;
                long   authorID = 0;
                string title    = string.Empty;

                if (mainType != -1)
                {
                    bool ok = false;
                    if (mainType == 1)
                    {
                        Question qmodel = QuestionBLL.Instance.GetModel(actionid);
                        if (qmodel == null)
                        {
                            msg = "邮件校验不成功,退订不成功";
                        }
                        else
                        {
                            authorID = Convert.ToInt64(qmodel.UserID);
                            title    = qmodel.Title;
                            ok       = true;
                        }
                    }
                    else if (mainType == 5)
                    {
                        ZhaoPin zmodel = ZhaoPinBLL.Instance.GetModel(mainID);
                        if (zmodel == null)
                        {
                            msg = "邮件校验不成功,退订不成功";
                        }
                        else
                        {
                            authorID = Convert.ToInt64(zmodel.Publisher);
                            title    = zmodel.Gangwei;
                            ok       = true;
                        }
                    }
                    if (ok)
                    {
                        EmailNotice emodel = EmailNoticeBLL.Instance.GetModelByAuthor(authorID, mainType, actionid);
                        if (emodel == null)
                        {
                            msg = "邮件退订状态不正常";
                        }
                        else
                        {
                            //比较签名
                            if (emodel.MD5Sign == actionid2)
                            {
                                if (emodel.EmailNoticeAuthor == 0)
                                {
                                    msg = "您已退订";
                                }
                                else
                                {
                                    emodel.EmailNoticeAuthor = 0;
                                    emodel.CreateTime        = DateTime.Now;
                                    if (EmailNoticeBLL.Instance.Update(emodel).Ok)
                                    {
                                        msg = "退订成功";
                                    }
                                }
                            }
                            else
                            {
                                msg = "邮件校验不成功,退订不成功";
                            }
                        }
                    }
                }
            }
            catch
            {
            }
            Response.Write(msg);
        }
コード例 #15
0
        public ActionResult Edit(ZhaoPin model, int deadTime)
        {
            ResultInfo ri = new ResultInfo();

            if (ModelState.IsValid)
            {
                ZhaoPin _model = ZhaoPinBLL.Instance.GetModel(model.ZhaoPinID);
                if (_model == null)
                {
                    ri.Msg = "该求职信息已被删除";
                }
                else
                {
                    Action <string> action = (imagePath) =>
                    {
                        _model.CName       = model.CName;
                        _model.CPeople     = model.CPeople;
                        _model.Gangwei     = model.Gangwei;
                        _model.Money       = model.Money;
                        _model.Study       = model.Study;
                        _model.WorkHistory = model.WorkHistory;
                        _model.WorkPlace   = model.WorkPlace;
                        _model.Contact     = model.Contact;
                        _model.CDesc       = model.CDesc;
                        _model.JobRequire  = model.JobRequire;
                        _model.JobPic      = imagePath;

                        _model.BelongJobTrade = model.BelongJobTrade;
                        _model.BelongJob      = model.BelongJob;
                        _model.WorkeType      = model.WorkeType;
                        _model.WorkTime       = model.WorkTime;
                        _model.NeedCount      = model.NeedCount;
                        _model.JobFuLi        = model.JobFuLi;

                        _model.ValidTime  = DateTime.Now.AddDays(deadTime);
                        _model.UpdateTime = DateTime.Now;
                        if (_model.WorkeType == 1)
                        {
                            _model.WorkTime = null;
                        }

                        ri = ZhaoPinBLL.Instance.Update(_model);
                        if (ri.Ok)
                        {
                            ri.Url = ConfigHelper.AppSettings("ZhaoPinDetail").FormatWith(_model.ZhaoPinID);
                        }
                    };
                    //是否修改上传照片
                    if (GetRequest <bool>("ischange"))
                    {
                        string oldImagePath = _model.JobPic;
                        ri = UpLoadImg("JobPic", "/Content/Job/ZP");
                        if (ri.Ok)
                        {
                            action(ri.Url);
                            UploadHelper.DeleteUpFile(oldImagePath);
                        }
                    }
                    else
                    {
                        action(_model.JobPic);
                    }
                }
            }
            return(Result(ri));
        }
コード例 #16
0
ファイル: PayController.cs プロジェクト: ccxlimin/baixiaotang
        public ActionResult ZhaoPinPay(ZhaoPin model)
        {
            ResultInfo ri     = new ResultInfo();
            int        result = 0;

            try
            {
                ResultInfo ri_ = UpLoadImg("JobPic", "/Content/Job/ZP");
                if (ri_.Ok)
                {
                    var now = DateTime.Now;
                    BeginTran();
                    model.JobPic     = ri_.Url;
                    model.ValidTime  = now.AddDays(GetRequest("deadTime", 30));
                    model.CreateTime = now;
                    model.UpdateTime = now;
                    model.UpdateUser = UserID.ToString();
                    model.Publisher  = UserID.ToString();
                    model.IsDelete   = 1;//先将状态置为失效
                    model.CLogo      = UserInfo.HeadUrl;
                    model.IsTop      = 0;
                    model.IsJinghua  = 0;
                    model.IsRemen    = 0;
                    model.PVCount    = 0;

                    int itemid = ZhaoPinBLL.Instance.Add(model, Tran);
                    if (itemid > 0)
                    {
                        int    publishScore = Convert.ToInt32(ConfigHelper.AppSettings("PUBLISH_ZHAOPIN"));
                        int    vipscorePay  = Convert.ToInt32(ConfigHelper.AppSettings("vipScorePayByRMB"));
                        int    payMoney     = publishScore / vipscorePay;
                        string payOrderID   = string.Empty;
                        string desc         = "招聘信息发布支付";
                        #region 创建订单
                        string _msg_ = _orderService.CreateOrder(UserID, payMoney, itemid, 5, desc, "ZP", 1, now, Tran, out result, out payOrderID);
                        if (result < 1)
                        {
                            ri.Msg = _msg_;
                            RollBack();
                            return(Result(ri));
                        }
                        #endregion
                        #region 跳转支付
                        //, () =>
                        //  {
                        //      OrderDelete(result);
                        //      RollBack();
                        //  }
                        ri = Redirect2Pay(desc, payMoney, payOrderID,
                                          "http://www.baixiaotangtop.com" + ConfigHelper.AppSettings("ZhaoPinDetail").FormatWith(result),
                                          ConfigHelper.AppSettings("AliPayNotify_PublishZhaoPin"));
                        if (ri.Ok)
                        {
                            Commit();
                        }
                        else
                        {
                            RollBack();
                        }
                        #endregion
                    }
                    else
                    {
                        ri.Msg = "发布招聘信息失败";
                        RollBack();
                    }
                }
                else
                {
                    ri = ri_;
                }
            }
            catch
            {
                RollBack();
                ri.Msg = "支付异常,请重试!";
            }
            return(Result(ri));
        }
コード例 #17
0
 /// <summary>
 /// 修改一条记录
 /// </summary>
 /// <param name="model">实体对象</param>
 /// <returns></returns>
 public bool Edit(ZhaoPin model)
 {
     return(dal.Update(model));
 }
コード例 #18
0
 /// <summary>
 /// 添加一条记录,没有任何逻辑
 /// </summary>
 /// <param name="model">实体对象</param>
 /// <returns></returns>
 public int Add(ZhaoPin model, SqlTransaction tran)
 {
     return(dal.Add(model, tran));
 }
コード例 #19
0
        public ActionResult Publish(ZhaoPin model, int deadTime, bool hasPic)
        {
            ResultInfo resultinfo = UpLoadImg("JobPic", "/Content/Job/ZP", beforeSaveFile: (save, ri) =>
            {
                try
                {
                    BeginTran();
                    //判断VIP分是否足够
                    int publishScore = Convert.ToInt32(ConfigHelper.AppSettings("PUBLISH_ZHAOPIN"));
                    int type         = 2;
                    if (UserExtBLL.Instance.HasEnoughCoin(type, publishScore, UserID))
                    {
                        //扣除相应积分
                        if (UserExtBLL.Instance.SubScore(UserID, publishScore, type, Tran))
                        {
                            //记录流水
                            if (ScoreCoinLogBLL.Instance.Log(-publishScore, type, CoinSourceEnum.PublishProduct, UserID, UserInfo.UserName, Tran))
                            {
                                if (hasPic)
                                {
                                    ri = save();
                                }

                                if (model.WorkeType == 1)
                                {
                                    model.WorkTime = null;
                                }

                                model.ValidTime  = DateTime.Now.AddDays(deadTime);
                                model.UpdateTime = DateTime.Now;
                                model.UpdateUser = UserID.ToString();
                                model.CreateTime = DateTime.Now;
                                model.Publisher  = UserID.ToString();
                                model.IsDelete   = 0;
                                model.CLogo      = UserInfo.HeadUrl;
                                model.JobPic     = ri?.Url;
                                model.IsTop      = 0;
                                model.IsJinghua  = 0;
                                model.IsRemen    = 0;
                                model.PVCount    = 0;

                                //创建招聘信息
                                int result = ZhaoPinBLL.Instance.Add(model, Tran);

                                if (result > 0)
                                {
                                    string uri = ConfigHelper.AppSettings("ZhaoPinDetail").FormatWith(result);
                                    ri.Url     = uri;
                                    ri.Ok      = true;
                                    Commit();

                                    //通知作者
                                    NoticeBLL.Instance.OnPayPublish_Notice_Author(UserID, DateTime.Now, GetDomainName + uri, model.Gangwei, 20, publishScore.ToString(), NoticeTypeEnum.ZhaoPin_Pay_Publish);
                                    //通知关注作者的用户
                                    NoticeBLL.Instance.OnAdd_Notice_Liker(UserInfo.UserName, UserID, uri, model.Gangwei, NoticeTypeEnum.ZhaoPin_Add, GetDomainName);
                                }
                                else
                                {
                                    ri.Msg = "发布失败";
                                    RollBack();
                                    UploadHelper.DeleteUpFile(ri.Url);
                                }
                            }
                            else
                            {
                                RollBack();
                                ri.Msg = "发布失败";
                            }
                        }
                        else
                        {
                            RollBack();
                            ri.Msg = "发布失败";
                        }
                    }
                    else
                    {
                        ri.Msg = "VIP分不足,请去个人中心充值";
                    }
                }
                catch
                {
                    ri.Msg = "发布异常 ";
                    RollBack();
                    UploadHelper.DeleteUpFile(ri.Url);
                }
            }, isNeedFile: hasPic);

            return(Result(resultinfo));
        }
コード例 #20
0
ファイル: ZhaoPinBLL.cs プロジェクト: wanziR/rencai
 public int Add(ZhaoPin obj)
 {
     return(new ZhaoPinDAL().Add(obj));
 }
コード例 #21
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <param name="type">1招聘 2求职</param>
        /// <param name="comment"></param>
        /// <returns></returns>
        public ActionResult JobComment(int id = 0, int type = 1, string comment = null)
        {
            ResultInfo ri = new ResultInfo();

            if (id > 0)
            {
                if (type == 1)
                {
                    //招聘
                    ZhaoPin model = ZhaoPinBLL.Instance.GetModel(id);
                    if (model.IsDelete == 1)
                    {
                        ri.Msg = "该帖子已被删除";
                    }
                    else
                    {
                        ri.Ok = true;
                    }
                }
                else
                {
                    //求职
                    ZhaoPin model = ZhaoPinBLL.Instance.GetModel(id);
                    if (model.IsDelete == 1)
                    {
                        ri.Msg = "该帖子已被删除";
                    }
                    else
                    {
                        ri.Ok = true;
                    }
                }
                if (ri.Ok)
                {
                    string     defaultHeadUrl = "/Content/img/head_default.gif";
                    JobComment jobcomment     = new Model.JobComment()
                    {
                        CommentType    = type,
                        Comment        = HttpUtility.UrlDecode(comment),
                        CreateHeadUrl  = UserInfo.HeadUrl.IsNotNullOrEmpty() ? UserInfo.HeadUrl : defaultHeadUrl,
                        CreateNickName = UserInfo.UserName,
                        CreateTime     = DateTime.Now,
                        CreateUser     = UserID.ToString(),
                        IsDelete       = 0,
                        MainID         = id,
                    };
                    int result = JobCommentBLL.Instance.Add(jobcomment);
                    if (result > 0)
                    {
                        ri.Ok  = true;
                        ri.Msg = "评论成功";
                    }
                    else
                    {
                        ri.Ok  = false;
                        ri.Msg = "评论失败";
                    }
                }
            }
            else
            {
                ri.Msg = "该条数据不存在";
            }
            return(Result(ri));
        }