protected void LoadMemberDetails() { BusinessLayer.Member ObjMember = new BusinessLayer.Member(); Entity.Member Member = new Entity.Member(); Member = ObjMember.GetAllById(MemberId); if (Member != null) { txtMemberName.Text = Member.MemberName; ddlDistrict.SelectedValue = Member.DistrictId.ToString(); txtBlockName.Text = Member.BlockName; txtMobileNo.Text = Member.MobileNo; txtStartDate.Text = Member.StartDate.ToString("dd/MM/yyyy"); txtEndDate.Text = Member.EndDate.ToString("dd/MM/yyyy"); txtFormNo.Text = Member.FormNo; txtFirmName.Text = Member.FirmName; txtAddress.Text = Member.Address; txtPin.Text = Member.Pin; txtLandLine.Text = Member.LandLine; ChkLifeMemberShip.Checked = Member.IsLifeMembership; ChkSMSSubscriber.Checked = Member.IsYearlySMSSubscriber; txtLifeMembershipAmt.Text = String.Format("{0:0.##}", Member.LifeMembershipAmt); txtSMSSubscriberAmt.Text = String.Format("{0:0.##}", Member.SMSSubscriberAmt); ltrMsg.Text = ""; } }
public string UpdateUserInfo(Entity.Member paramsModel) { string reMsg = string.Empty; try { string cmdText = "UPDATE K_Member SET RealName=@RealName,Gender=@Gender,Birthday=@Birthday,Marriage=@Marriage,Mobile=@Mobile,Headimg=@Headimg,Intro=@Intro Where UserName=@UserName"; SqlParameter[] paras = new SqlParameter[] { new SqlParameter("@UserName", paramsModel.UserName), new SqlParameter("@RealName", paramsModel.RealName), new SqlParameter("@Gender", paramsModel.Gender), new SqlParameter("@Birthday", Convert.ToString(paramsModel.Birthday)), new SqlParameter("@Marriage", paramsModel.Marriage), new SqlParameter("@Mobile", paramsModel.Mobile), new SqlParameter("@Headimg", paramsModel.HeadImg), new SqlParameter("@Intro", paramsModel.Intro), }; reMsg = SQLHelper.ExecuteNonQuery(SQLHelper.ConnectionStringLocalTransaction, CommandType.Text, cmdText, paras).ToString(); } catch (Exception ex) { reMsg = ex.Message; } return(reMsg); }
protected void btnSave_Click(object sender, EventArgs e) { BusinessLayer.Member ObjMember = new BusinessLayer.Member(); Entity.Member Member = new Entity.Member(); Member.MemberId = MemberId; Member.MemberName = txtMemberName.Text.Trim(); Member.FormNo = txtFormNo.Text.Trim(); Member.FirmName = txtFirmName.Text.Trim(); Member.Address = txtAddress.Text.Trim(); Member.BlockName = txtBlockName.Text; Member.DistrictId = int.Parse(ddlDistrict.SelectedValue.Trim()); Member.Pin = txtPin.Text.Trim(); Member.MobileNo = txtMobileNo.Text.Trim(); Member.LandLine = txtLandLine.Text.Trim(); string[] SDate = txtStartDate.Text.Trim().Split('/'); Member.StartDate = Convert.ToDateTime(SDate[1].Trim() + "/" + SDate[0].Trim() + "/" + SDate[2].Trim() + " 00:00:00"); string[] EDate = txtEndDate.Text.Trim().Split('/'); Member.EndDate = Convert.ToDateTime(EDate[1].Trim() + "/" + EDate[0].Trim() + "/" + EDate[2].Trim() + " 00:00:00"); Member.IsLifeMembership = ChkLifeMemberShip.Checked; Member.IsYearlySMSSubscriber = ChkSMSSubscriber.Checked; Member.LifeMembershipAmt = (txtLifeMembershipAmt.Text.Trim().Length == 0) ? 0 : decimal.Parse(txtLifeMembershipAmt.Text.Trim()); Member.SMSSubscriberAmt = (txtSMSSubscriberAmt.Text.Trim().Length == 0) ? 0 : decimal.Parse(txtSMSSubscriberAmt.Text.Trim()); ObjMember.Save(Member); ClearControls(); ltrMsg.Text = "Member Information Saved/Updated Successfully"; }
public static int Save(Entity.Member Member) { using (DataManager oDm = new DataManager()) { oDm.Add("@pMemberId", SqlDbType.Int, ParameterDirection.Input, Member.MemberId); oDm.Add("@pMemberName", SqlDbType.VarChar, 50, ParameterDirection.Input, Member.MemberName); oDm.Add("@pFormNo", SqlDbType.VarChar, 20, ParameterDirection.Input, Member.FormNo); oDm.Add("@pFirmName", SqlDbType.VarChar, 50, ParameterDirection.Input, Member.FirmName); oDm.Add("@pAddress", SqlDbType.VarChar, 250, ParameterDirection.Input, Member.Address); oDm.Add("@pBlockName", SqlDbType.VarChar, 250, ParameterDirection.Input, Member.BlockName); oDm.Add("@pDistrictId", SqlDbType.Int, ParameterDirection.Input, Member.DistrictId); oDm.Add("@pPin", SqlDbType.VarChar, 6, ParameterDirection.Input, Member.Pin); oDm.Add("@pMobileNo", SqlDbType.VarChar, 10, ParameterDirection.Input, Member.MobileNo); oDm.Add("@pLandLine", SqlDbType.VarChar, 20, ParameterDirection.Input, Member.LandLine); oDm.Add("@pStartDate", SqlDbType.DateTime, ParameterDirection.Input, Member.StartDate); oDm.Add("@pEndDate", SqlDbType.DateTime, ParameterDirection.Input, Member.EndDate); oDm.Add("@pIsLifeMembership", SqlDbType.Bit, ParameterDirection.Input, Member.IsLifeMembership); oDm.Add("@pLifeMembershipAmt", SqlDbType.Decimal, ParameterDirection.Input, Member.LifeMembershipAmt); oDm.Add("@pIsYearlySMSSubscriber", SqlDbType.Bit, ParameterDirection.Input, Member.IsYearlySMSSubscriber); oDm.Add("@pSMSSubscriberAmt", SqlDbType.Decimal, ParameterDirection.Input, Member.SMSSubscriberAmt); oDm.Add("@pSubscriptionId", SqlDbType.Int, ParameterDirection.Input, Member.SubscriptionId); oDm.Add("@pIsPortalMember", SqlDbType.Bit, ParameterDirection.Input, Member.IsPortalMember); oDm.Add("@pPortalMemberAmt", SqlDbType.Decimal, ParameterDirection.Input, Member.PortalMemberAmt); oDm.Add("@pIsMobileAppActivated", SqlDbType.Bit, ParameterDirection.Input, Member.IsMobileAppActivated); oDm.Add("@pDeviceId", SqlDbType.VarChar, 200, ParameterDirection.Input, Member.DeviceId); oDm.Add("@pPassword", SqlDbType.VarChar, 20, ParameterDirection.Input, Member.Password); oDm.CommandType = CommandType.StoredProcedure; return(oDm.ExecuteNonQuery("usp_Merchant_Save")); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["Member"] != null) { BLL.Member b_Member = new BLL.Member(); g_Member = Session["Member"] as Entity.Member; Member_Reg.Visible = false; Member_Record.Visible = true; Member_Name_CN.InnerText = g_Member.Member_Name_CN; if (g_Member.Member_Sex) Member_Name_CN.InnerText += "先生"; else Member_Name_CN.InnerText += "女士"; Member_Account.InnerText = g_Member.Member_Account; Member_Points.InnerText = g_Member.Member_Points.ToString(); Member_Level.InnerText = b_Member.Show_Member_Level(g_Member.Member_Level); } else { Member_Reg.Visible = true; Member_Record.Visible = false; } }
protected void btnSave_Click(object sender, EventArgs e) { BusinessLayer.Member ObjMember = new BusinessLayer.Member(); Entity.Member Member = new Entity.Member(); Member.MemberId = MemberId; Member.MemberName = txtMemberName.Text.Trim(); Member.FormNo = txtFormNo.Text.Trim(); Member.FirmName = txtFirmName.Text.Trim(); Member.Address = txtAddress.Text.Trim(); Member.BlockName = txtBlockName.Text; Member.DistrictId = int.Parse(ddlDistrict.SelectedValue.Trim()); Member.Pin = txtPin.Text.Trim(); Member.MobileNo = txtMobileNo.Text.Trim(); Member.LandLine = txtLandLine.Text.Trim(); string[] SDate = txtStartDate.Text.Trim().Split('/'); Member.StartDate = Convert.ToDateTime(SDate[1].Trim() + "/" + SDate[0].Trim() + "/" + SDate[2].Trim() + " 00:00:00"); string[] EDate = txtEndDate.Text.Trim().Split('/'); Member.EndDate = Convert.ToDateTime(EDate[1].Trim() + "/" + EDate[0].Trim() + "/" + EDate[2].Trim() + " 00:00:00"); Member.IsLifeMembership = ChkLifeMemberShip.Checked; Member.IsYearlySMSSubscriber = ChkSMSSubscriber.Checked; Member.LifeMembershipAmt = (txtLifeMembershipAmt.Text.Trim().Length == 0) ? 0 : decimal.Parse(txtLifeMembershipAmt.Text.Trim()); Member.SMSSubscriberAmt = (txtSMSSubscriberAmt.Text.Trim().Length == 0) ? 0 : decimal.Parse(txtSMSSubscriberAmt.Text.Trim()); Member.IsPortalMember = chkPortalMember.Checked; Member.PortalMemberAmt = (txtPortalAmount.Text.Trim().Length == 0) ? 0 : decimal.Parse(txtPortalAmount.Text.Trim()); if (chkApprovePayment.Checked == true) { Member.SubscriptionId = SubscriptionId; } else { Member.SubscriptionId = 0; } int rowsaffected = ObjMember.Save(Member); if (rowsaffected > 0) { if (MemberId == 0) { NewMemberJoiningAlert(); } if (chkApprovePayment.Checked == true) { SendNewSubscriptionAlert(txtMemberName.Text.ToString(), txtSMSSubscriberAmt.Text.Trim()); } ClearControls(); lblMessage.Text = "Member Information Saved/Updated Successfully"; lblMessage.BackColor = System.Drawing.Color.Green; } else { lblMessage.Text = "Mobile Number Already Exist"; lblMessage.BackColor = System.Drawing.Color.Red; } }
public async static Task <string> Sign_Up(Entity.Member member) { HttpClient httpClient = new HttpClient(); var content = new StringContent(JsonConvert.SerializeObject(member), System.Text.Encoding.UTF8, "application/json"); var response = httpClient.PostAsync(API_URL, content); var contents = await response.Result.Content.ReadAsStringAsync(); Debug.WriteLine(contents); return(contents); }
private Member MapEntityToMember(Entity.Member tempMember) { var Member = new Member(); if (null != tempMember) { Member.ID = tempMember.ID; Member.Name = tempMember.Name; Member.StreetAddress = tempMember.StreetAddress; Member.City = tempMember.City; Member.State = tempMember.State; Member.ZipCode = tempMember.ZipCode; Member.Status = (int)(null != tempMember.Status ? tempMember.Status.Value : 0); } return(Member); }
private Entity.Member MapMemberToEntity(Member member) { var tempMember = new Entity.Member(); if (null != member) { tempMember.ID = member.ID; tempMember.Name = member.Name; tempMember.StreetAddress = member.StreetAddress; tempMember.City = member.City; tempMember.State = member.State; tempMember.ZipCode = member.ZipCode; tempMember.Status = (short)member.Status; } return(tempMember); }
public bool AddMember(Entity.Member member) { try { using (var db = new CBHSDBContext()) { db.Members.Add(_mapper.Map <Entity.Member, Datasource.Member>(member)); db.SaveChanges(); } return(true); } catch (Exception ex) { //Log the exception return(false); } }
public static Entity.Member GetAllById(int MemberId) { using (DataManager oDm = new DataManager()) { oDm.CommandType = CommandType.StoredProcedure; oDm.Add("@pMemberId", SqlDbType.Int, ParameterDirection.Input, MemberId); SqlDataReader dr = oDm.ExecuteReader("usp_Merchant_GetAllById"); Entity.Member EntityMember = new Entity.Member(); if (dr.HasRows) { while (dr.Read()) { EntityMember.MemberId = MemberId; EntityMember.MemberName = (dr[1] == DBNull.Value) ? "" : dr[1].ToString(); EntityMember.FormNo = (dr[2] == DBNull.Value) ? "" : dr[2].ToString(); EntityMember.FirmName = (dr[3] == DBNull.Value) ? "" : dr[3].ToString(); EntityMember.Address = (dr[4] == DBNull.Value) ? "" : dr[4].ToString(); EntityMember.BlockName = (dr[5] == DBNull.Value) ? "" : dr[5].ToString(); EntityMember.DistrictId = (dr[6] == DBNull.Value) ? 0 : int.Parse(dr[6].ToString()); EntityMember.Pin = (dr[7] == DBNull.Value) ? "" : dr[7].ToString(); EntityMember.MobileNo = (dr[8] == DBNull.Value) ? "" : dr[8].ToString(); EntityMember.LandLine = (dr[9] == DBNull.Value) ? "" : dr[9].ToString(); EntityMember.StartDate = (dr[10] == DBNull.Value) ? DateTime.MinValue : DateTime.Parse(dr[10].ToString()); EntityMember.EndDate = (dr[11] == DBNull.Value) ? DateTime.MinValue : DateTime.Parse(dr[11].ToString()); EntityMember.IsLifeMembership = (dr[12] == DBNull.Value) ? false : bool.Parse(dr[12].ToString()); EntityMember.LifeMembershipAmt = (dr[13] == DBNull.Value) ? 0 : decimal.Parse(dr[13].ToString()); EntityMember.IsYearlySMSSubscriber = (dr[14] == DBNull.Value) ? false : bool.Parse(dr[14].ToString()); EntityMember.SMSSubscriberAmt = (dr[15] == DBNull.Value) ? 0 : decimal.Parse(dr[15].ToString()); EntityMember.IsPortalMember = (dr[16] == DBNull.Value) ? false : bool.Parse(dr[16].ToString()); EntityMember.PortalMemberAmt = (dr[17] == DBNull.Value) ? 0 : decimal.Parse(dr[17].ToString()); } } return(EntityMember); } }
public async Task <JsonResult> Import(IFormFile flie) { string msg = string.Empty; LocalizationSourceName = UnionMallConsts.LocalizationSourceName; DataTable dt = _comServices.ExcelToDataTable(flie, out msg); if (dt == null || dt.Rows.Count == 0) { return(new JsonResult(new { succ = false, msg = msg })); } bool CoulmnCheck = true; string coulmnMsg = string.Empty; if (!dt.Columns.Contains("会员卡号")) { CoulmnCheck = false; coulmnMsg += L("NotExist{0}", "【会员卡号】"); } if (!dt.Columns.Contains("微信名")) { CoulmnCheck = false; coulmnMsg += L("NotExist{0}", "【微信名】"); } if (!dt.Columns.Contains("姓名")) { CoulmnCheck = false; coulmnMsg += L("NotExist{0}", "【姓名】"); } if (!dt.Columns.Contains("会员等级")) { CoulmnCheck = false; coulmnMsg += L("NotExist{0}", "【会员等级】"); } if (!dt.Columns.Contains("归属门店")) { CoulmnCheck = false; coulmnMsg += L("NotExist{0}", "【归属门店】"); } if (!dt.Columns.Contains("性别")) { CoulmnCheck = false; coulmnMsg += L("NotExist{0}", "【性别】"); } if (!dt.Columns.Contains("可用积分")) { CoulmnCheck = false; coulmnMsg += L("NotExist{0}", "【可用积分】"); } if (!dt.Columns.Contains("可用余额")) { CoulmnCheck = false; coulmnMsg += L("NotExist{0}", "【可用余额】"); } if (!dt.Columns.Contains("推荐人卡号")) { CoulmnCheck = false; coulmnMsg += L("NotExist{0}", "【推荐人卡号】"); } if (!dt.Columns.Contains("详细地址")) { CoulmnCheck = false; coulmnMsg += L("NotExist{0}", "【详细地址】"); } if (!dt.Columns.Contains("电子邮件")) { CoulmnCheck = false; coulmnMsg += L("NotExist{0}", "【电子邮件】"); } if (CoulmnCheck == false) { return(new JsonResult(new { succ = false, msg = coulmnMsg })); } try { foreach (DataRow row in dt.Rows) { Entity.Member member = new Entity.Member(); member.TenantId = _AbpSession.TenantId; member.CardID = row["会员卡号"].ToString(); member.FullName = row["姓名"].ToString(); member.WeChatName = row["微信名"].ToString(); if (member.WeChatName == "") { member.WeChatName = member.FullName; } DataTable levelTable = _sqlExecuter.ExecuteDataSet($"select id from TMemberLevel l where l.TenantId={_AbpSession.TenantId}" + $" and l.Title='{row["会员等级"]}'").Tables[0]; if (levelTable.Rows.Count == 0) { msg += L("NotExist{0}", row["会员等级"].ToString()); continue; } member.LevelId = (long)levelTable.Rows[0][0]; DataTable storeTable = _sqlExecuter.ExecuteDataSet($"select id,BusinessId from TChainStore c where c.TenantId={_AbpSession.TenantId}" + $" and c.Name='{row["归属门店"]}'").Tables[0]; if (levelTable.Rows.Count == 0) { msg += L("NotExist{0}", row["归属门店"].ToString()); continue; } member.ChainStoreId = (long)storeTable.Rows[0]["id"]; member.BusinessId = (long)storeTable.Rows[0]["BusinessId"]; if (row["性别"].ToString() == "男") { member.Sex = 0; } else { member.Sex = 1; } member.Integral = Convert.ToDecimal(row["可用积分"]); member.Balance = Convert.ToDecimal(row["可用余额"]); member.Mobile = row["手机号"].ToString(); member.PassWord = "******"; if (row["推荐人卡号"] != null && row["推荐人卡号"].ToString().Trim() != "") { var m = _Repository.FirstOrDefault(c => c.CardID == row["推荐人卡号"].ToString() && c.TenantId == _AbpSession.TenantId); member.ReferrerID = m.Id; } member.RegTime = DateTime.Now; member.Address = row["详细地址"].ToString(); member.Email = row["电子邮件"].ToString(); await _Repository.InsertAsync(member); } return(new JsonResult(new { succ = true, msg = msg })); } catch (Exception ex) { Logger.Warn("---------------------------" + ex.StackTrace); return(new JsonResult(new { succ = false, msg = ex.Message })); } }
public int Save(Entity.Member Member) { return(DataAccess.Member.Save(Member)); }
protected void Member_Submit_Click(object sender, EventArgs e) { BLL.Member b_Member = new BLL.Member(); if (!VerifyUtility.IsString_NotNull(Member_Account.Text)) ResponseError("请输入帐号"); if (b_Member.Check_Account(Member_Account.Text)) ResponseError(Member_Account.Text + "已经注册过"); if (!VerifyUtility.IsString_NotNull(Member_PassWord1.Text)) ResponseError("请输入密码"); if (!VerifyUtility.IsString_NotNull(Member_PassWord2.Text)) ResponseError("请输入确认密码"); if (Member_PassWord1.Text != Member_PassWord2.Text) ResponseError("请输入确认密码输入不正确"); if (!VerifyUtility.IsString_NotNull(Member_Name_CN.Text)) ResponseError("请输入中文名"); if (!VerifyUtility.IsString_NotNull(Member_Name_EN.Text)) ResponseError("请输入英文名"); if (!Member_Male.Checked && !Member_Female.Checked) ResponseError("请选择性别"); if (!VerifyUtility.IsString_NotNull(Member_Work.SelectedValue)) ResponseError("请选择工作状态"); if (!VerifyUtility.IsString_NotNull(Member_Tel.Text)) ResponseError("请输入电话"); if (!VerifyUtility.IsString_NotNull(Member_Mobile.Text)) ResponseError("请输入手机号码"); if (!VerifyUtility.IsString_NotNull(Member_Email.Text)) ResponseError("请输入电子邮件"); if (b_Member.Check_Email(Member_Email.Text)) ResponseError(Member_Email.Text + "已经注册过"); if (!VerifyUtility.IsString_NotNull(Member_Address.Text)) ResponseError("请输入居住地址"); Entity.Member o_Member = new Entity.Member(); int Member_Recommended = 0; if (VerifyUtility.IsString_NotNull(Member_Serial.Text)) { Entity.Member e_Member = b_Member.Select_Member(2, Member_Serial.Text); if (e_Member == null) ResponseError("没有该会员号"); else { Member_Recommended = e_Member.Member_ID; o_Member.Member_ReSerial = Member_Serial.Text; } } else o_Member.Member_ReSerial = ""; o_Member.Member_Account = Member_Account.Text; o_Member.Member_PassWord = Member_PassWord1.Text; o_Member.Member_Name_CN = Member_Name_CN.Text; o_Member.Member_Name_EN = Member_Name_EN.Text; if (Member_Male.Checked) o_Member.Member_Sex = true; else o_Member.Member_Sex = false; o_Member.Member_Work = Member_Work.Text; o_Member.Member_Tel = Member_Tel.Text; o_Member.Member_Mobile = Member_Mobile.Text; o_Member.Member_Email = Member_Email.Text; o_Member.Member_Address = Member_Address.Text; o_Member.Member_Company_Name = Member_Company_Name.Text; o_Member.Member_Company_Tel = Member_Company_Tel.Text; o_Member.Member_Company_Address = Member_Company_Address.Text; for (int i = 1; i <= 12; i++) { Control o_Control = form1.FindControl("Member_Months_" + i.ToString()); if (o_Control != null) { CheckBox o_CheckBox = (CheckBox)o_Control; if (o_CheckBox.Checked) { if (o_Member.Member_Months == null) o_Member.Member_Months = new List<int>(); o_Member.Member_Months.Add(i); } } } for (int i = 1; i <= 34; i++) { if (Request["checkbox" + i.ToString()] != null) o_Member.Member_Airlines += Request["checkbox" + i.ToString()] + ";"; } if (o_Member.Member_Airlines.EndsWith(";")) o_Member.Member_Airlines = o_Member.Member_Airlines.Remove(o_Member.Member_Airlines.Length - 1, 1); o_Member.Member_Serial = b_Member.Random_Member(); o_Member.Member_Points = 0; o_Member.Member_Commission = 0; o_Member.Member_Consumption = 0; o_Member.Member_Times = 0; o_Member.Member_Recommended = Member_Recommended; o_Member.Member_Level = 1; o_Member.Member_AddTime = DateTime.Now; b_Member.Insert_Member(o_Member); ResponseSuccess("注册成功", "Member_Reg.aspx"); }