public JsonResult Hytk(long id, string backMoney, long payTypeId, string remark) { var apiResult = new APIResult(); var user = UserContext.CurrentUser; try { try { decimal.Parse(backMoney); } catch (Exception ex) { throw new OperationExceptionFacade("退款金额数据格式错误"); } if (decimal.Parse(backMoney) <= 0) { throw new OperationExceptionFacade("退款金额数据格式错误"); } MemberBll.Hytk(id, payTypeId, decimal.Parse(backMoney), remark, user.Id, user.Name, user.HotelId); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; if (!(ex is OperationExceptionFacade)) { LogFactory.GetLogger().Log(LogLevel.Error, ex); } } return(Json(apiResult)); }
public ActionResult MemberList() { MemberBll memberBll = new MemberBll(); var memberList = memberBll.GetAllMember(); return(View(memberList)); }
protected void borrowButton_Click(object sender, EventArgs e) { string number = memberNoTextBox.Text; MemberBll aMemberBll = new MemberBll(); BookEnroll aBookEnroll = new BookEnroll(); BookBLL aBookBll = new BookBLL(); if (aMemberBll.CheckMemberExistance(number) == true) { messageLable.Text = ""; BorrowBookBll aBorrowBookBll = new BorrowBookBll(); aBookEnroll.BookID = (int)ViewState["bookId"]; aBookEnroll.MemberNumber = number; if (aBookBll.CheckBookDuplication(aBookEnroll) == true) { messageLabel.Text = "This book already you take"; } else { messageLabel.Text = ""; aBorrowBookBll.Save(aBookEnroll); } } else { messageLable.Text = "This Member Number doesn't exist"; } }
public JsonResult Hysj(long id, long toMemberTypeId, string kcExp) { var apiResult = new APIResult(); var user = UserContext.CurrentUser; try { try { int.Parse(kcExp); } catch (Exception ex) { throw new OperationExceptionFacade("扣除积分数据格式错误"); } if (int.Parse(kcExp) <= 0) { throw new OperationExceptionFacade("扣除积分数据格式错误"); } MemberBll.Hysj(id, toMemberTypeId, int.Parse(kcExp), user.Id, user.Name, user.HotelId); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; if (!(ex is OperationExceptionFacade)) { LogFactory.GetLogger().Log(LogLevel.Error, ex); } } return(Json(apiResult)); }
private void PreLoadFTData() { var hotelId = UserContext.CurrentUser.HotelId; if (!_ft_isLoaded) { _ft_isLoaded = true; _ft_rooms = RoomBll.GetListBy(hotelId); _ft_roomregs = RoomRegBll.GetListByHotelId(hotelId); _ft_members = MemberBll.GetList(hotelId); _ft_membersType = MemberTypeBll.GetList(hotelId); _ft_RoomRegGuestInfoCN = RoomRegGuestInfoCNBll.GetListByHotelId(hotelId); _ft_RoomRegGuestInfoEN = RoomRegGuestInfoENBll.GetListByHotelId(hotelId); _ft_MaterialLease = MaterialLeaseBll.GetListByHotel(hotelId); _ft_RoomType = RoomTypeBll.GetListByHotelId(hotelId); _ft_RoomYdRecord = RoomYdRecordBll.GetListByHotel(hotelId); _ft_GlobalFeeSet = GlobalFeeSetBll.GetByHotelId(hotelId); _ft_MaintainRoom = MaintainRoomBll.GetListByHotelId(hotelId); _ft_RoomSelfuse = RoomSelfBll.GetListByHotelId(hotelId); _ft_RoomYD = RoomYdBll.GetListByHotel(hotelId); _ft_RoomSet = RoomSetBll.GetBy(hotelId); if (_ft_RoomSet == null) { _ft_RoomSet = RoomSetBll.GetBy(0); } } }
public ActionResult Create(FormCollection fc) { var model = new tblusers(); model.userid = Guid.NewGuid().ToString(); model.Mobile = fc["Mobile"].ToString(); model.Passwd = MD5Encrypt(fc["Passwd"].ToString()); model.sexy = fc["optSexy"].ToString(); model.cardtype = fc["optCardType"].ToString(); model.cardno = fc["cardno"].ToString(); model.mono = "-"; if (fc["birthday"] != "") { model.birthday = DateTime.Parse(fc["birthday"].ToString()); } model.Status = Int32.Parse(fc["optStatus"].ToString()); var bll = new MemberBll(); try { bll.AddMember(model); } catch (ValidException ex) { this.ModelState.AddModelError(ex.Name, ex.Message); return(View(model)); } return(this.RefreshParent()); }
public ActionResult MemberEdit(Member m) { MemberBll memberBll = new MemberBll(); m.muser = Session["callid"].ToString(); m.mdate = DateTime.Now; memberBll.UpdateMember(m); return(Redirect("MemberList")); }
public ActionResult MemberEdit(int id) { MemberBll memberBll = new MemberBll(); Member m = memberBll.GetMemberNyid(id); m.member_id = id; return(View(m)); }
public ActionResult Create() { List <SelectListItem> Status = new MemberBll().GetDict(3); foreach (SelectListItem r in Status) { ViewBag.Status += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } return(View()); }
// GET: RoomRegJfyh public ActionResult Index(long roomRegId, long itemId = 0) { //获取前台优惠限额 var hotelId = UserContext.CurrentUser.HotelId; var roomReg = RoomRegBll.GetById(roomRegId); if (roomReg == null) { return(Content("房间登记数据不存在")); } if (roomReg.CustomerType != 3) { return(Content("登记客人非会员,不可操作")); } if (string.IsNullOrWhiteSpace(roomReg.MemCompId)) { return(Content("房间登记未选择会员")); } var member = MemberBll.GetById(long.Parse(roomReg.MemCompId)); if (member == null) { return(Content("会员不存在")); } var memType = MemberTypeBll.GetById(member.MemberTypeId); if (memType == null) { memType = new MemberType(); } ViewBag.MemberType = memType; if (itemId == 0) { //新增 return(View(new RoomRegJfyh() { HotelId = hotelId, Name = member.Name, Sex = member.Sex, Birth = member.Birth.ToString("yyyy-MM-dd"), RoomRegId = roomRegId, KyExp = (int)member.Exp })); } else { //修改 var model = RoomRegJfyhBll.GetById(itemId); if (model == null) { model = new RoomRegJfyh(); } return(View(model)); } }
public JsonResult CheckTel(string Mobile) { bool isValidate = true; var tbluesr = new MemberBll().GetMemberByTel(Mobile); if (tbluesr != null) { isValidate = false; } return(Json(isValidate, JsonRequestBehavior.AllowGet)); }
// // GET: /Main/Member/ public ActionResult Index(string id, string tel, int?pageIndex) { var members = new List <tblusers>(); try { members = new MemberBll().GetMembers(id, tel, pageIndex.GetValueOrDefault(1)); }catch { } return(View(members)); }
public ActionResult LoginAction() { Member user = new Member(); if (!string.IsNullOrEmpty(Request.Params["username"])) { user.member_name = Request.Params["username"].RepStr(); } if (!string.IsNullOrEmpty(Request.Params["password"])) { user.member_password = Request.Params["password"].RepStr(); } MemberBll adminBll = new MemberBll(); try { if (adminBll.Login(user)) { HttpCookie cookie = new HttpCookie("session"); ///開發的時候不記錄domain二級域名 cookie.Expires = DateTime.Now.AddDays(1); cookie["session_id"] = Session.SessionID; cookie["callid"] = user.member_name; Response.Cookies.Add(cookie); Session["logingmessage"] = ""; Session["callid"] = user.member_name; var all = new MemberLoginLog(); all.ip = CommonFunction.GetIP4Address(Request.UserHostAddress.ToString()); all.browser = Request.Browser.Browser; return(RedirectToAction("Index", "Home")); } else { Session["logingmessage"] = "账号或者密码错误,请重新登陆!!!"; return(RedirectToAction("login", "Account")); //Response.End(); } } catch (Exception ex) { Session["logingmessage"] = "账号或者密码错误!!!"; return(RedirectToAction("Login", "Account")); } }
public ActionResult Edit(long id = 0) { if (id == 0) { return(View(new Member() { HotelId = UserContext.CurrentUser.HotelId })); } var info = MemberBll.GetById(id); return(View(info)); }
/// <summary> /// 密码重置 /// </summary> /// <param name="memberId"></param> /// <returns></returns> public ActionResult _Pwd(long memberId) { var model = MemberBll.GetById(memberId); if (model == null) { model = new Member() { HotelId = UserContext.CurrentUser.HotelId } } ; return(View(model)); }
public ActionResult Delete(List <string> ids) { var bll = new MemberBll(); try { bll.DeleteMember(ids); } catch (ValidException ex) { return(Alert(ex.Message)); } return(RedirectToAction("Index")); }
public ActionResult Edit(string id) { var bll = new MemberBll(); var model = bll.GetMember(id); List <SelectListItem> Sexy = bll.GetDict(1); List <SelectListItem> CardType = bll.GetDict(2); List <SelectListItem> Status = bll.GetDict(3); foreach (SelectListItem r in Sexy) { if (model.sexy == r.Value) { ViewBag.Sexy += "<option value='" + r.Value.ToString() + "'selected>" + r.Text.ToString() + "</option>"; } else { ViewBag.Sexy += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } } foreach (SelectListItem r in CardType) { if (model.cardtype == r.Value) { ViewBag.CardType += "<option value='" + r.Value.ToString() + "'selected>" + r.Text.ToString() + "</option>"; } else { ViewBag.CardType += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } } foreach (SelectListItem r in Status) { if (model.Status.ToString() == r.Value) { ViewBag.Status += "<option value='" + r.Value.ToString() + "'selected>" + r.Text.ToString() + "</option>"; } else { ViewBag.Status += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } } return(View(model)); }
public ActionResult Delete(long id) { var apiResult = new APIResult(); try { MemberBll.DeleteById(id); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; if (!(ex is OperationExceptionFacade)) { LogFactory.GetLogger().Log(LogLevel.Error, ex); } } return(Json(apiResult)); }
public ActionResult LineEdit(string id) { var bll = new MatchBll(); var model = bll.GetLineById(id); List <SelectListItem> Status = new MemberBll().GetDict(3); foreach (SelectListItem r in Status) { if (model.Status.ToString() == r.Value) { ViewBag.Status += "<option value='" + r.Value.ToString() + "'selected>" + r.Text.ToString() + "</option>"; } else { ViewBag.Status += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } } return(View(model)); }
public JsonResult Pwd(long id, string pwd1, string pwd2) { var apiResult = new APIResult(); var user = UserContext.CurrentUser; try { MemberBll.Pwd(id, pwd1, pwd2); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; if (!(ex is OperationExceptionFacade)) { LogFactory.GetLogger().Log(LogLevel.Error, ex); } } return(Json(apiResult)); }
public ActionResult Edit(string id, FormCollection fc) { var bll = new TeamBll(); var model = bll.GetTeamById(id); model.Userid = fc["Userid"]; model.Company = fc["optCompany"].ToString(); model.Lineid = fc["optLine"].ToString(); model.Status = Int32.Parse(fc["optStatus"].ToString()); try { bll.EditTeam(model); } catch (ValidException ex) { this.ModelState.AddModelError(ex.Name, ex.Message); List <SelectListItem> company = bll.GetCompany(); List <SelectListItem> line = bll.GetLine(); List <SelectListItem> Status = new MemberBll().GetDict(3); foreach (SelectListItem r in company) { ViewBag.company += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } foreach (SelectListItem r in line) { ViewBag.line += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } foreach (SelectListItem r in Status) { ViewBag.Status += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } return(View(model)); } return(this.RefreshParent()); }
public JsonResult Edit(Member model) { var user = UserContext.CurrentUser; var apiResult = new APIResult(); try { MemberBll.AddOrUpdate(model, user.HotelId, user.Id, user.Name); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; if (!(ex is OperationExceptionFacade)) { LogFactory.GetLogger().Log(LogLevel.Error, ex); } } return(Json(apiResult)); }
public JsonResult ImportMember() { var apiResult = new APIResult(); DataTable dt = new DataTable(); try { dt = ExcelHelper.gjImport(Cookies.GetCookie("ExcelPath")); //dt.Rows.RemoveAt(0); } catch (Exception) { apiResult.Ret = -1; apiResult.Msg = "导入失败,请重试"; try { Directory.Delete(Cookies.GetCookie("Way"), true); } catch { } return(Json(apiResult)); } if (dt.Rows.Count < 3) { apiResult.Ret = -1; apiResult.Msg = "您选择的Excel文件不符合格式或者没有内容!"; Directory.Delete(Cookies.GetCookie("Way"), true); return(Json(apiResult)); } string msg = string.Empty; int ret = MemberBll.DrExcel(dt, UserContext.CurrentUser.HotelId, ref msg); Directory.Delete(Cookies.GetCookie("Way"), true); apiResult.Ret = ret; apiResult.Msg = msg; return(Json(apiResult)); }
public JsonResult Hyhk(long id, string newCardNO, long payTypeId, string hkMoney) { var apiResult = new APIResult(); var user = UserContext.CurrentUser; try { if (string.IsNullOrWhiteSpace(newCardNO)) { throw new OperationExceptionFacade("新卡号不可为空"); } try { decimal.Parse(hkMoney); } catch (Exception ex) { throw new OperationExceptionFacade("收款金额数据格式错误"); } if (decimal.Parse(hkMoney) <= 0) { throw new OperationExceptionFacade("收款金额数据格式错误"); } MemberBll.Hyhk(id, newCardNO, payTypeId, decimal.Parse(hkMoney), user.Id, user.Name, user.HotelId); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; if (!(ex is OperationExceptionFacade)) { LogFactory.GetLogger().Log(LogLevel.Error, ex); } } return(Json(apiResult)); }
public ActionResult Create() { var bll = new MemberBll(); List <SelectListItem> Sexy = bll.GetDict(1); List <SelectListItem> CardType = bll.GetDict(2); List <SelectListItem> Status = bll.GetDict(3); foreach (SelectListItem r in Sexy) { ViewBag.Sexy += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } foreach (SelectListItem r in CardType) { ViewBag.CardType += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } foreach (SelectListItem r in Status) { ViewBag.Status += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } return(View()); }
public ActionResult Create() { var bll = new TeamBll(); List <SelectListItem> company = bll.GetCompany(); List <SelectListItem> line = bll.GetLine(); List <SelectListItem> Status = new MemberBll().GetDict(3); foreach (SelectListItem r in company) { ViewBag.company += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } foreach (SelectListItem r in line) { ViewBag.line += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } foreach (SelectListItem r in Status) { ViewBag.Status += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } return(View()); }
public ActionResult Edit(string id, FormCollection fc) { var bll = new MatchBll(); var model = bll.GetMatchById(id); model.Match_name = fc["Match_name"].ToString(); model.Content = fc["Content"].ToString(); model.Area1 = fc["Area1"].ToString(); model.Area2 = fc["Area2"].ToString(); if (fc["Date1"] != null) { model.Date1 = DateTime.Parse(fc["Date1"].ToString()); } if (fc["Date2"] != null) { model.Date2 = DateTime.Parse(fc["Date2"].ToString()); } if (fc["Date3"] != null) { model.Date3 = DateTime.Parse(fc["Date3"].ToString()); } if (fc["Date4"] != null) { model.Date4 = DateTime.Parse(fc["Date4"].ToString()); } ViewBag.ErrorMsg = ""; string filename = ""; // 上传文件 HttpFileCollectionBase files = Request.Files; HttpPostedFileBase file = files["Pic1"]; if (file != null && !string.IsNullOrEmpty(file.FileName)) { filename = file.FileName.Substring(file.FileName.LastIndexOf(".") + 1); if ((filename.ToUpper() == "PNG" || filename.ToUpper() == "JPG") && file.ContentLength / 1024 < 2000) { string path = Server.MapPath("~/UploadFiles/"); filename = "productfile_" + DateTime.Now.ToString("yyyyMMddHHmmss") + "." + filename; file.SaveAs(path + filename); } else { ViewBag.ErrorMsg = "<font color='red'>只能上传PNG或JPG格式的图片且大小不超过2M</font>"; return(View()); } model.Pic1 = filename; } HttpPostedFileBase file2 = files["Pic2"]; if (file2 != null && !string.IsNullOrEmpty(file2.FileName)) { string filename2 = file2.FileName.Substring(file2.FileName.LastIndexOf(".") + 1); if ((filename2.ToUpper() == "PNG" || filename2.ToUpper() == "JPG") && file2.ContentLength / 1024 < 2000) { string path = Server.MapPath("~/UploadFiles/"); filename = "thumbnailfile_" + DateTime.Now.ToString("yyyyMMddHHmmss") + "." + filename2; file2.SaveAs(path + filename); } else { ViewBag.ErrorMsg = "<font color='red'>只能上传PNG或JPG格式的图片且大小不超过2M</font>"; return(View()); } model.Pic2 = filename; } model.Status = fc["optStatus"].ToString(); try { bll.EditMatch(model); } catch (ValidException ex) { this.ModelState.AddModelError(ex.Name, ex.Message); List <SelectListItem> Status = new MemberBll().GetDict(3); foreach (SelectListItem r in Status) { if (model.Status.ToString() == r.Value) { ViewBag.Status += "<option value='" + r.Value.ToString() + "'selected>" + r.Text.ToString() + "</option>"; } else { ViewBag.Status += "<option value='" + r.Value.ToString() + "'>" + r.Text.ToString() + "</option>"; } } return(View(model)); } return(this.RefreshParent()); }
public string GetMemberList(string searchName = "") { var list = MemberBll.GetList(searchName, UserContext.CurrentUser.HotelId); return(JsonConvert.SerializeObject(list)); }
/// <summary> /// 导出 /// </summary> /// <returns></returns> public JsonResult ToExcel() { var user = UserContext.CurrentUser; var list = MemberBll.GetList(user.HotelId); var tb = new DataTable(); tb.Columns.Add("会员卡号"); tb.Columns.Add("卡内码"); tb.Columns.Add("状态"); tb.Columns.Add("会员类型"); tb.Columns.Add("余额"); tb.Columns.Add("积分"); tb.Columns.Add("入住次数"); tb.Columns.Add("姓名"); tb.Columns.Add("性别"); tb.Columns.Add("生日"); tb.Columns.Add("手机号"); tb.Columns.Add("证件类型"); tb.Columns.Add("证件号码"); tb.Columns.Add("地址"); tb.Columns.Add("营销人员"); tb.Columns.Add("营销短信"); tb.Columns.Add("长期有效"); tb.Columns.Add("到期日期"); tb.Columns.Add("操作员"); tb.Columns.Add("发卡时间"); if (list != null && list.Count > 0) { foreach (var item in list) { tb.Rows.Add(new string[] { item.CardNO, item.CNM, item.StateName, item.MemberTypeName, item.Money.ToString(), item.Exp.ToString(), item.Times.ToString(), item.Name, item.Sex, item.Birth.ToShortDateString(), item.Tel, item.CertificateTypeName, item.CertificateTypeNO, item.Address, item.YxryName, (item.IsNotYxSms?"不接收":"接受"), (item.IsCqyx?"是":"否"), (item.IsCqyx?"":item.ExpireDate.ToShortDateString()), item.HandlerName, NIU.Forum.Common.TypeConvert.IntToDateTime(item.CDate).ToString("yyyy-MM-dd hh:mm:ss") }); } } var apiResult = new APIResult(); //try //{ ExcelHelper.ExportByWeb(tb, "会员信息表", "会员信息表.xls"); //} //catch (Exception ex) //{ // apiResult.Ret = -1; // apiResult.Msg = ex.Message; // if (!(ex is OperationExceptionFacade)) // LogFactory.GetLogger().Log(LogLevel.Error, ex); //} return(Json(apiResult)); }
public string GetPager(int page, int rows, string searchName = null) { var pager = MemberBll.GetPager(page, rows, UserContext.CurrentUser.HotelId, searchName); return(JsonConvert.SerializeObject(pager)); }