/// <summary> /// 用户注册 /// </summary> private void Registration() { Model.UserInfoModel model = new Model.UserInfoModel(); model.UserId = ReStr("uid"); model.Email = ReStr("Email", ""); model.Pwd = ReStr("Pwd"); model.Birthday = DateTime.Parse("1900-01-01"); model.Phone = ReStr("phone", ""); model.PicBig = "boy1"; model.PicMid = "boy2"; model.PicSmall = "boy3"; model.WxOpenID = ReStr("WxOpenID", ""); model.UserCode = DAL.DalComm.ExInt(" select MAX(UserCode) + 1 FROM dbo.UserInfo "); model.CreateTime = DateTime.Now; BLL.UserBLL bll = new BLL.UserBLL(); try { bll.Registration(model); bll.LoginIn(model.UserId, model.Pwd); ReDict2.Add("UserId", model.UserId); ReTrue(); } catch (Exception ex) { ReThrow(ex); } }
private void GetTopMsgList() { StringBuilder s = new StringBuilder(); int top = ReInt("top", 10); string TargetDeviceId = ReStr("TargetDeviceId", ""); s.Append(" SELECT top " + top + " * from DBMSG.DBO.msgView "); s.Append(" where TargetDeviceId='" + TargetDeviceId + "' "); s.Append(" ORDER BY MsgStatusId, MsgId DESC "); s.Append(" SELECT MsgNum FROM DBMSG.dbo.Device WHERE DeviceId='" + TargetDeviceId + "' "); DataSet ds = DAL.DalComm.BackData(s.ToString()); DataTable dt = ds.Tables[0]; DataTable dt2 = ds.Tables[1]; if (dt2.Rows.Count == 0) { throw new Exception("没有编号为" + TargetDeviceId + "的用户!"); } DataRow dr = dt2.Rows[0]; ReDict.Add("list", JsonHelper.ToJson(dt)); ReDict2.Add("MsgNum", dr["MsgNum"].ToString()); ReTrue(); }
private void SaveJob() { BLL.UserBLL userbll = new BLL.UserBLL(); BLL.JobBLL bll = new BLL.JobBLL(); JobModel model = new JobModel(); model.JobId = ReStr("JobId", ""); if (userbll.HasPower(model.JobId)) { //如果没有权限发布 } else { ReTrue(); } if (model.JobId.Trim() != "") { //修改 model = bll.GetJobModel(model.JobId); if (model.CreateUser == Common.CookieSings.GetCurrentUserId()) { } else { if (!userbll.IsAdministrator()) { throw new Exception("您没有权限执行此操作!"); } } } else { model.RecommendLv = ReInt("RecommendLv", 0); } model.HumNum = ReInt("HumNum"); model.ContactEmail = ReStr("ContactEmail"); model.ContactName = ReStr("ContactName"); model.ContactPhone = ReStr("ContactPhone", ""); model.ContactQQ = ReStr("ContactQQ", ""); model.ContactTell = ReStr("ContactTell", ""); model.HumNum = ReInt("HumNum", 0); model.IsTop = ReBool("IsTop", false); model.JobMemo = ReStr("JobMemo"); model.JobPayId = ReInt("JobPayId"); model.JobtTitle = ReStr("JobtTitle"); model.JobTypeId = ReInt("JobTypeId"); model.MerchantId = ReDecimal("MerchantId", 0); model.SchoolExpId = ReInt("SchoolExpId"); model.Sex = ReStr("Sex"); model.WorkYearId = ReInt("WorkYearId"); model.JobLat = ReDecimal("JobLat", 0); model.JobLng = ReDecimal("JobLng", 0); model.TownId = ReDecimal("TownId"); bll.SaveJob(model); ReDict2.Add("JobId", model.JobId); ReTrue(); }
private void SaveHouseDemand() { BLL.UserBLL ubll = new BLL.UserBLL(); Model.HouseDemandModel model = new Model.HouseDemandModel(); model.HouseDemandId = ReStr("HouseDemandId", ""); model.HouseDemandTitle = ReStr("HouseDemandTitle", ""); model.HouseDemandTypeId = ReInt("HouseDemandTypeId", 0); model.BeginPrice = ReDecimal("BeginPrice", 0); model.EndPrice = ReDecimal("EndPrice", 0); model.Hshi = ReInt("Hshi", 0); model.Hting = ReInt("Hting", 0); model.Hchu = ReInt("Hchu", 0); model.Hwei = ReInt("Hwei", 0); model.Hyangtai = ReInt("Hyangtai", 0); model.HouseDemandMemo = ReStr("HouseDemandMemo"); model.ContactName = ReStr("ContactName"); model.ContactTell = ReStr("ContactTell"); model.ContactPhone = ReStr("ContactPhone"); model.ContactEmail = ReStr("ContactEmail"); model.ContactQQ = ReStr("ContactQQ"); model.CommunityTitle = ReStr("CommunityTitle"); model.CommunityId = ReInt("CommunityId", 0); model.TownId = ReInt("TownId", 0); model.CreateUser = ubll.CurrentUserId(); BLL.HouseBLL bll = new BLL.HouseBLL(); bll.SaveHouseDemand(model); ReDict2.Add("HouseDemandId", model.HouseDemandId); ReTrue(); }
private void Ding() { BLL.BBSBLL bll = new BLL.BBSBLL(); decimal TieZiId = ReDecimal("TieZiId"); int i = bll.Ding(TieZiId); ReDict2.Add("DingNum", i.ToString()); ReTrue(); }
/// <summary> /// 后台用户登录 /// </summary> private void UserLogin() { try { Model.UserInfoModel model = new Model.UserInfoModel(); string inputStr = ReStr("inputStr", ""); if (inputStr == "") { throw new Exception("必须填写登录名!"); } string Pwd = ReStr("Pwd"); int RememberMouth = ReInt("RememberMouth", 120); string WxOpenID = ReStr("WxOpenID", ""); BLL.UserBLL bll = new BLL.UserBLL(); string UserId = bll.UserLoginBackUserId(inputStr, Pwd, RememberMouth); if (UserId == null || UserId == "") { throw new Exception("用户名不存在或密码不正确!"); } else { if (WxOpenID.Trim() != "") { DAL.DalComm.ExStr("update CORE.dbo.UserInfo set WxOpenID='" + WxOpenID + "' where UserId='" + UserId + "' "); } ReDict2.Add("WxOpenID", WxOpenID); ReDict2.Add("UserId", UserId); string sourse = ReStr("s", ""); if (sourse == "app") { } else { } DataSet ds = DAL.DalComm.BackData(" select * from CORE.dbo.UserMerRoleView where UserId='" + UserId + "' "); DataTable dt = ds.Tables[0]; ReDict.Add("MerRoleList", Common.JsonHelper.ToJson(dt)); ReTrue(); } string s = ReStr("s", ""); } catch (Exception ex) { ReThrow(ex); } }
/// <summary> /// 忘记密码 /// </summary> private void ForgetPwdForEmail() { string UserId = DAL.DalComm.ExStr(" select top 1 UserId from dbo.UserInfo WITH(NOLOCK) where Email ='" + ReStr("EmailOrUserId") + "' or UserId ='" + ReStr("EmailOrUserId") + "' "); if (UserId == "") { throw new Exception("用户名或邮箱填写不正确!"); } else { BLL.UserBLL bll = new BLL.UserBLL(); string Email = bll.BackPwdMail(UserId); ReDict2.Add("Email", Email); ReTrue(); } }
private void SaveQyWxPtAppInfo() { BLL.WxBLL wbll = new BLL.WxBLL(); Model.QyWxPtAppModel model = new QyWxPtAppModel(); model.QyWxPtAppId = ReDecimal("", 0); model.AgentID = ReStr("AgentID", ""); model.DefaultGroupId = ReDecimal("DefaultGroupId", 0); model.QyWxPtAppMemo = ReStr("QyWxPtAppMemo", ""); model.QyWxPtAppName = ReStr("QyWxPtAppName", ""); model.QyWxPtId = ReDecimal("QyWxPtId", 0); if (model.QyWxPtId == 0) { throw new Exception("必须确定企业微信平台!"); } wbll.SaveQyWxPtAppInfo(model); ReDict2.Add("QyWxPtAppId", model.QyWxPtAppId.ToString()); ReTrue(); }
private void SaveQyWxPtGroupInfo() { Model.QyWxPtGroupModel model = new QyWxPtGroupModel(); BLL.WxBLL wbll = new BLL.WxBLL(); model.QyWxPtGroupId = ReDecimal("QyWxPtGroupId", 0); if (model.QyWxPtGroupId != 0) { model = wbll.GetQyWxPtGroupModel(model.QyWxPtGroupId); } model.QyWxPtId = ReDecimal("QyWxPtId", 0); model.Secret = ReStr("Secret"); model.QyWxPtGroupMemo = ReStr("QyWxPtGroupMemo"); wbll.SaveQyWxPtGroupInfo(model); ReDict2.Add("QyWxPtGroupId", model.QyWxPtGroupId.ToString()); ReTrue(); }
private void SaveSuCaiInfo() { Model.WxSuCaiInfoModel model = new WxSuCaiInfoModel(); BLL.WxBLL wbll = new BLL.WxBLL(); Model.CurrentMerModel cm = BLL.MerchantBLL.CurrentModel(); #region 事务开启 TransactionOptions transactionOption = new TransactionOptions(); transactionOption.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOption)) { #endregion model.WxSuCaiInfoId = ReDecimal("WxSuCaiInfoId", 0); if (model.WxSuCaiInfoId == 0) { //新增 } else { model = wbll.GetSuCaiInfoModel(model.WxSuCaiInfoId); } model.WxSuCaiTitle = ReStr("WxSuCaiTitle"); model.InputCode = ReStr("InputCode", Common.PinYin.GetCodstring(model.WxSuCaiTitle)); model.WxSuCaiContent = ReStrDeCode("WxSuCaiContent"); model.Memo = ReStr("Memo", ""); model.WxSuCaiTypeId = ReInt("WxSuCaiTypeId"); model.WxSuCaiClassId = ReInt("WxSuCaiClassId"); model.CreateUser = cm.CurrentUserId; model.Invalid = ReBool("Invalid", false); model.FmImgId = ReStr("FmImgId", ""); model.MerId = ReDecimal("MerId", cm.CurrentMerId); wbll.SaveSuCaiInfo(model); switch (model.WxSuCaiClassId) { case 2: //如果是图文 wbll.RemoveSuCaiDetail(" WxSuCaiInfoId='" + model.WxSuCaiInfoId + "' "); DataTable dtDetail = ReTable("detail"); if (dtDetail.Rows.Count == 0) { throw new Exception("图文回复需要至少一条明细!"); } foreach (DataRow drDetail in dtDetail.Rows) { Model.WxSuCaiDetailModel DetailModel = new WxSuCaiDetailModel(); DetailModel.ImgId = drDetail["ImgId"].ToString(); DetailModel.OrderNo = int.Parse(drDetail["OrderNo"].ToString()); DetailModel.OtherPara = drDetail["OtherPara"].ToString(); DetailModel.ReKey = drDetail["ReKey"].ToString(); DetailModel.Url = HttpUtility.UrlDecode(drDetail["Url"].ToString()); DetailModel.WxSuCaiInfoId = model.WxSuCaiInfoId; DetailModel.WxSuCaiDetailMemo = drDetail["WxSuCaiDetailMemo"].ToString(); try { DetailModel.WxSuCaiDetailClassId = int.Parse(drDetail["WxSuCaiDetailClassId"].ToString()); } catch { continue; } try { DetailModel.WxSuCaiDetailContent = drDetail["WxSuCaiDetailContent"].ToString(); } catch { DetailModel.WxSuCaiDetailContent = ""; } DetailModel.WxSuCaiDetailId = 0; //必须的,就靠它新增 DetailModel.WxSuCaiDetailTitle = drDetail["WxSuCaiDetailTitle"].ToString(); wbll.SaveSuCaiDetail(DetailModel); } break; default: //其他 break; } #region 事务关闭 transactionScope.Complete(); } #endregion ReDict2.Add("WxSuCaiInfoId", model.WxSuCaiInfoId.ToString()); ReTrue(); }
private void SaveTieZiInfo() { BLL.BBSBLL bbll = new BLL.BBSBLL(); Model.TieZiModel model = new TieZiModel(); model.TieZiId = ReDecimal("TieZiId", 0); if (bbll.HasTieZiPower(model.TieZiId)) { //是否有操作权限 } else { throw new Exception("您没有操作权限!"); } if (model.TieZiId > 0) {//修改 model = bbll.GetTieZiModel(model.TieZiId); model.CreateTime = ReTime("CreateTime", DateTime.Now); } else { //新增 model.Ip = ReStr("Ip", HttpContext.Current.Request.UserHostAddress); model.CreateUser = Common.CookieSings.GetCurrentUserId(); model.Source = ReStr("Source", ""); model.HideUser = ReBool("HideUser"); model.WxOpenId = ReStr("WxOpenId", ""); model.YueMingZhong = ""; model.RecommendLv = ReInt("RecommendLv", 0); } model.TieZiTitle = ReStr("TieZiTitle", ""); bool AddHot = ReBool("AddHot", false); model.TieZiContent = ReStrDeCode("TieZiContent"); model.TieZiSummary = Common.StringPlus.GetLeftStr(Common.StringPlus.OutHtmlText(model.TieZiContent), 120, ""); model.TieZiImgId = ReStr("TieZiImgId", ""); model.MiniImgUrl = ReStr("MiniImgUrl", ""); model.ForumId = ReDecimal("ForumId"); model.TieZiType = ReStr("TieZiType", ""); model.TieZiClass = ReStr("TieZiClass", ""); model.ParentTieZiId = ReDecimal("ParentTieZiId", 0); model.RepLastUser = model.CreateUser; model.Invalid = ReBool("Invalid", false); DataTable dtImg = ReTable("imgArray"); #region 事务开启 TransactionOptions transactionOption = new TransactionOptions(); transactionOption.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOption)) { #endregion dtImg = BLL.BJ.ImgSetting.ImgArraySetting(dtImg, model.TieZiContent); if (dtImg != null) { model.TieZiImgId = dtImg.Rows[0]["ImgId"].ToString(); } bbll.SaveTieZi(model); bbll.DeleteTieZiVsImgByTieZiId(model.TieZiId); //删除帖子下所有的图片,重新插入. if (dtImg != null) { foreach (DataRow dr in dtImg.Rows) { Model.TieZiVsImgModel VsImgModel = new TieZiVsImgModel(); VsImgModel.TieZiId = model.TieZiId; VsImgModel.ImgId = dr["ImgId"].ToString(); VsImgModel.vsType = "UserImg"; bbll.AddTieZiVsImg(VsImgModel); } } ReDict2.Add("ForumId", model.ForumId.ToString()); ReDict2.Add("TieZiId", model.TieZiId.ToString()); if (model.ParentTieZiId > 0) { int ParentRepCount = DAL.DalComm.ExInt(" select RepCount from BBS.DBO.TIEZI WHERE TieZiId='" + model.ParentTieZiId + "' "); ReDict2.Add("ParentRepCount", ParentRepCount.ToString()); #region 开始提醒 RemindModel remindmodel = new RemindModel(); remindmodel.CreateTime = DateTime.Now; remindmodel.MerLook = false; remindmodel.ReKey = model.ParentTieZiId.ToString(); remindmodel.ReMerchantId = 0; remindmodel.RemindTitle = "您发布的帖子有了新的回应!"; remindmodel.RemindTypeId = model.TieZiType; remindmodel.ReUserId = ReStr("ReUserId", ""); remindmodel.Url = "/t/?TieZiId=" + ReDecimal("ReTieZiId") + ""; remindmodel.UserLook = false; BLL.CommBLL commBll = new BLL.CommBLL(); if (remindmodel.ReUserId.Trim() != "") { commBll.SaveReMind(remindmodel); } #endregion #region 如果是回帖,更新主贴时间 if (model.TieZiType == "回帖") { //说明本帖是个回帖,更新回帖数目, 和最后发表人 int i = DAL.DalComm.ExReInt(" update bbs.dbo.TieZi set UpdateTime ='" + DateTime.Now.ToString() + "' , RepLastUser='******' where TieZiId='" + model.ParentTieZiId + "' "); if (i <= 0) { throw new Exception("没有找到ID为" + model.ParentTieZiId + "的主贴!"); } } #endregion } #region 事务结束 transactionScope.Complete(); } #endregion ReTrue(); }
private void GetMyExtCount() { decimal MemberId = ReDecimal("MemberId", 0); var SetpNum = 3; StringBuilder s = new StringBuilder(); for (int i = SetpNum - 1; i >= 0; i--) { DateTime d = DateTime.Now.AddMonths(-i); DateTime d2 = DateTime.Parse("" + d.Year + "-" + d.Month + "-01 00:00:00"); DateTime d3 = d2.AddMonths(1); s.Append(" SELECT Isnull( SUM(JiFenChangeNum),0) AS SumJiFenChangeNum," + d2.Month + " AS MM "); s.Append(" FROM dbo.JiFenChange "); s.Append(" where MemberId=" + MemberId + " "); s.Append(" and CreateTime >='" + d2 + "' and CreateTime<='" + d3 + "' "); s.Append(" and JifenChangeTypeId=50 "); if (i != 0) { s.Append(" UNION ALL "); } } // s.Append(" ORDER BY MONTH(CreateTime) "); DataSet ds = DAL.DalComm.BackData(s.ToString()); DataTable dt = ds.Tables[0]; decimal Max = 0; decimal Step = 0; foreach (DataRow dr in dt.Rows) { decimal SumJiFenChangeNum = decimal.Parse(dr["SumJiFenChangeNum"].ToString()); if (Max == 0) { Max = SumJiFenChangeNum; } else { if (Max < SumJiFenChangeNum) { Max = SumJiFenChangeNum; } } } if (Max < 3) { Step = 1; } else { Step = Math.Ceiling(Max / 3); } Max = Max + Step; ReDict.Add("list", JsonHelper.ToJson(dt)); ReDict2.Add("Max", Max.ToString()); ReDict2.Add("Step", Step.ToString()); ReTrue(); }
private void SaveResume() { BLL.UserBLL uBll = new BLL.UserBLL(); ResumeModel model = new ResumeModel(); BLL.JobBLL bll = new BLL.JobBLL(); model.CreateUser = uBll.CurrentUserId(); DataTable dtResumeByUser = bll.GetResumeList(" CreateUser='******' "); if (dtResumeByUser.Rows.Count > 0) { //这个用户已经有简历了 DataRow dr = dtResumeByUser.Rows[0]; model.ResumeId = dr["ResumeId"].ToString(); } else { //还没有创建简历 model.ResumeId = ReStr("ResumeId").Trim(); //传过来一般也是空的 } model.IsTop = false; model.JobPayId = ReInt("JobPayId"); model.ResumeAge = ReInt("ResumeAge"); model.ResumeEmail = ReStr("ResumeEmail"); model.JobTarget = ReStr("JobTarget"); model.ResumeMemo = ReStr("ResumeMemo"); model.ResumeName = ReStr("ResumeName"); model.ResumeQQ = ReStr("ResumeQQ"); model.ResumeSex = ReStr("ResumeSex"); model.ResumeTell = ReStr("ResumeTell"); model.SchoolExp = ReInt("SchoolExp"); model.TopLv = ReInt("TopLv", 0); model.TownId = ReInt("TownId"); model.WorkYear = ReInt("WorkYear"); model.PicImgId = ReStr("PicImgId"); #region 事务开启 TransactionOptions transactionOption = new TransactionOptions(); transactionOption.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOption)) { #endregion bll.SaveResume(model); //string EduArrayStr = ReStr("EduArrayStr").Trim(); //string[] EduArray = EduArrayStr.Split('|'); //int i = EduArray.Length; bll.DeleteEdu(" ResumeId='" + model.ResumeId + "' "); DataTable dtEduArray = ReTable("EduArrayStr"); if (dtEduArray != null) { foreach (DataRow dr in dtEduArray.Rows) { EducationModel eduModel = new EducationModel(); eduModel.EducationSchool = dr["EducationSchool"].ToString(); eduModel.SubName = dr["SubName"].ToString(); eduModel.BeginDate = DateTime.Parse(dr["BeginDate"].ToString()); eduModel.EndDate = DateTime.Parse(dr["EndDate"].ToString()); eduModel.EducationMemo = ""; eduModel.ResumeId = model.ResumeId; eduModel.OrderNo = 1; bll.SaveEduCation(eduModel); } } //开始添加求职意向的职位 DataTable dtJobType = ReTable("JobTypeArrayStr"); if (dtJobType != null) { bll.DeleteResumeVsJobType(" ResumeId='" + model.ResumeId + "' "); foreach (DataRow dr in dtJobType.Rows) { ResumeVsJobTypeModel vsmodel = new ResumeVsJobTypeModel(); vsmodel.JobTypeId = decimal.Parse(dr["JobTypeId"].ToString()); vsmodel.ResumeId = model.ResumeId; bll.SaveResumeVsJobType(vsmodel); } } else { } ReDict2.Add("ResumeId", model.ResumeId); #region 事务关闭 transactionScope.Complete(); } #endregion ReTrue(); }
private void SaveHouse() { Model.HouseModel model = new Model.HouseModel(); BLL.HouseBLL bll = new BLL.HouseBLL(); BLL.UserBLL ubll = new BLL.UserBLL(); model.HouseId = ReStr("HouseId"); if (model.HouseId != "") { model = bll.GetHouseModel(model.HouseId); model.CreateTime = DateTime.Now; } else { model.CreateUser = ubll.CurrentUserId(); //如果是新增, 则给CreateUser赋值 } model.HouseTitle = ReStr("HouseTitle", ""); model.HouseAddress = ReStr("HouseAddress", ""); model.Hshi = ReInt("Hshi", 0); model.Hting = ReInt("Hting", 0); model.Hchu = ReInt("Hchu", 0); model.Hwei = ReInt("Hwei", 0); model.Hyangtai = ReInt("Hyangtai", 0); model.HouseModelId = ReInt("HouseModelId", 0); model.DecorationId = ReInt("DecorationId", 0); model.PropertyTypeId = ReInt("PropertyTypeId", 0); model.HouseClassId = ReInt("HouseClassId", 0); model.Floor = ReInt("Floor", 0); model.FloorALL = ReInt("FloorALL", 0); model.HouseTypeId = ReInt("HouseTypeId", 0); model.Rent = ReDecimal("Rent"); model.Price = ReDecimal("Price"); model.IsAgency = ReBool("IsAgency"); model.Device = ReStr("Device"); model.Memo = ReStr("Memo", ""); model.CreateTime = DateTime.Now; model.PingFang = ReDecimal("PingFang"); model.ChaoXiangId = ReInt("ChaoXiangId", 0); model.HouseImgId = ReStr("HouseImgId", ""); model.ContactName = ReStr("ContactName"); model.ContactTell = ReStr("ContactTell"); model.ContactPhone = ReStr("ContactPhone"); model.ContactEmail = ReStr("ContactEmail"); model.ContactQQ = ReStr("ContactQQ"); model.CommunityTitle = ReStr("CommunityTitle", ""); model.CommunityId = ReInt("CommunityId", 0); model.TownId = ReDecimal("TownId", 0); model.HouseLat = ReDecimal("HouseLat"); model.HouseLng = ReDecimal("HouseLng"); model.RecommendLv = ReInt("RecommendLv", 0); DataTable dt = DataSetting.CXmlToDatatTable(ReStr("HouseAllImgHtmlStr")); #region 事务开启 TransactionOptions transactionOption = new TransactionOptions(); transactionOption.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOption)) { #endregion bll.SaveHouse(model); bll.DeleteHouseByHouseId(model.HouseId); if (dt != null) { //有图片上传 Model.HouseVsImgModel HvI = new Model.HouseVsImgModel(); foreach (DataRow dr in dt.Rows) { HvI.HouseId = model.HouseId; HvI.ImgId = dr["ImgId"].ToString(); HvI.Memo = "UE"; HvI.VsType = "房源图片"; bll.AddHouseVsImg(HvI); } } //推广开始 if (model.RecommendLv > 0) { } #region 事务关闭 transactionScope.Complete(); } #endregion ReDict2.Add("HouseId", model.HouseId); ReTrue(); }