protected void Page_Load(object sender, EventArgs e) { member = (Member)Session["Member"]; AjaxPro.Utility.RegisterTypeForAjax(typeof(MVideo)); ViewingMember = ExtractPageParams.GetMember(this.Page, this.Context); string CurentTab = Request.QueryString["to"]; string strPage = Request.QueryString["p"]; try { CurrentTab = (MemberOrderVideo)int.Parse(CurentTab); } catch { } SetOrderTab(); PageTo = 1; Int32.TryParse(strPage, out PageTo); // set the page to 1 if no preference is found in the URL PageTo = (PageTo == 0) ? 1 : PageTo; if (ViewingMember != null) { GetVideoLister(ViewingMember.WebMemberID,true); } else { // error forward to notavailable.aspx } }
public override ProblemCollection Check(Member member) { if (!member.HasCustomAttribute("Moonlit.Mvc.MappingAttribute")) { return Problems; } var mappingAttr = NodeExtensions.GetCustomAttribute(member, "Moonlit.Mvc.MappingAttribute"); var fromEntityType = member.DeclaringType.Interfaces.FirstOrDefault(x => x.IsGeneric && x.Template.FullName == "Moonlit.Mvc.IToEntity`1"); if (fromEntityType == null) { return Problems; } var entityType = fromEntityType.TemplateArguments[0]; string toProperty = member.Name.Name; var to = mappingAttr.Expressions.OfType<NamedArgument>().FirstOrDefault(x => x.Name.Name == "To"); if (to != null) { toProperty = to.Value.ToString(); } PropertyNode property = Helper.GetPropertyFromParent(Identifier.For(toProperty), entityType); if (property == null) { var resolution = this.GetResolution(new object[] { member.DeclaringType.FullName, member.Name.Name, entityType.FullName, toProperty }); Problems.Add(new Problem(resolution, member.SourceContext)); } return Problems; }
public string AddComment(int postID, string commentTxt) { Comments comment = new Comments(); comment.MemberId = Context.Session["memberID"].ToString(); comment.CommentText = commentTxt; comment.PostId = postID; messageDAL.InsertComment(comment); //Insert notification NotificationDAL notificationDAL = new NotificationDAL(); Post aPost = new Post(postID); List<Member> MemberList = new List<Member>(); MemberList = notificationDAL.GetPostOwner(aPost); string friendId = MemberList[0].MemberId; Member aFriend = new Member(friendId); Member aMember = new Member(Context.Session["memberID"].ToString()); if (aMember.MemberId != aFriend.MemberId) { notificationDAL.InsertCommentedOnPostNotification(aMember, aFriend, aPost); } //Refreshing the Comment count Post post = new Post(); post.PostId = comment.PostId; return messageDAL.CountComments(post).ToString(); }
public void Map(ClassMappingBase classMap, Member member) { if (!(classMap is ClassMapping)) return; var version = new VersionMapping { ContainingEntityType = classMap.Type, }; version.Set(x => x.Name, Layer.Defaults, member.Name); version.Set(x => x.Type, Layer.Defaults, GetDefaultType(member)); var columnMapping = new ColumnMapping(); columnMapping.Set(x => x.Name, Layer.Defaults, member.Name); version.AddColumn(Layer.Defaults, columnMapping); SetDefaultAccess(member, version); if (IsSqlTimestamp(member)) { version.Columns.Each(column => { column.Set(x => x.SqlType, Layer.Defaults, "timestamp"); column.Set(x => x.NotNull, Layer.Defaults, true); }); version.Set(x => x.UnsavedValue, Layer.Defaults, null); } ((ClassMapping)classMap).Set(x => x.Version, Layer.Defaults, version); }
protected void Page_Load(object sender, EventArgs e) { MemberService service = new MemberService(); _userlogin = (Member)Session[SessionKey.USERLOGIN]; string nowip; nowip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (nowip == null) { nowip = Request.ServerVariables["REMOTE_ADDR"]; } if (!Page.IsPostBack) { ViewWebSite v = new ViewWebSite(); v.IP = nowip; v.Page = "aboutus.aspx"; if (_userlogin == null) { v.User = "******"; } else { v.User = _userlogin.UserName; } if (service.CreateViewWebSite(v)) { Console.WriteLine("save view complate"); } } }
public virtual bool IsVersion(Member member) { var validNames = new List<string> { "version", "timestamp" }; var validTypes = new List<Type> { typeof(int), typeof(long), typeof(TimeSpan), typeof(byte[]) }; return validNames.Contains(member.Name.ToLowerInvariant()) && validTypes.Contains(member.PropertyType); }
protected void btnActivat_Click(object sender, EventArgs e) { string msg = string.Empty; if (bll.ActivatMember(Int32.Parse(HidMemberID.Value), txtActivat.Text, ref msg)) { lbMsg1.Text = "激活成功,请登录"; lbMsg2.Text = ""; lbMsg3.Text = ""; lbMsg1.DataBind(); //激活成功后直接登录 Member modelMember = new Member(); if (bll.LoginMember(Int32.Parse(HidMemberID.Value), ref msg, ref modelMember)) { //设置session Session["MemberInfo"] = modelMember; //跳转登录 Response.Redirect("MemberInfo.aspx"); } else { lbMsg1.Text = msg; lbMsg2.Text = ""; lbMsg3.Text = ""; } } else { lbMsg1.Text = msg; lbMsg2.Text = ""; lbMsg3.Text = ""; } }
public JsonResult GetRoles(string id) { var usr = Membership.GetUser(id); if (usr == null) return Json(null); using (var db = new ConnectionContext()) { var roles = Roles.GetRolesForUser(usr.UserName); var roleChecks = from x in db.Facults orderby x.FacultId select new RoleCheck { Name = x.Name, RoleCheckId = SqlFunctions.StringConvert((double)x.FacultId).Trim(), IsChecked = roles.Contains(SqlFunctions.StringConvert((double)x.FacultId).Trim()) }; var model = new Member { UserName = usr.UserName, RoleChecks = (roleChecks).ToList() }; model.RoleChecks.Add(new RoleCheck { Name = "Администратор", RoleCheckId = StaticData.AdminRoleName, IsChecked = Roles.IsUserInRole(usr.UserName, StaticData.AdminRoleName), }); return Json(model); } }
public virtual void UpdateMember(Member member) { _memberDataContext.Members.Attach(member); DbEntityEntry<Member> dbEntry = _memberDataContext.Entry(member); dbEntry.State = EntityState.Modified; _memberDataContext.SaveChanges(); }
public bool ShouldMap(Member member) { return member.PropertyType.Namespace.In("System.Collections.Generic", "Iesi.Collections.Generic") && !member.PropertyType.HasInterface(typeof(IDictionary)) && !member.PropertyType.ClosesInterface(typeof(IDictionary<,>)) && !member.PropertyType.Closes(typeof(IDictionary<,>)); }
public bool ShouldMap(Member member) { var shouldMap = _defaultManyToManyStep.ShouldMap(member) || member.MemberInfo.IsDefined(typeof(HasManyToManyAttribute), true); return shouldMap; //modify this statement to check for other attributes or conventions }
protected override string GetKeyName(Member property, Type type) { if (property == null) return type.Name + "Id"; return property.Name + "Id"; }
protected override string GetKeyName(Member property, Type type) { if (property == null) return string.Format("{0}Id", type.Name); return string.Format("{0}Id", property.Name); }
protected void Page_Load(object sender, EventArgs e) { AjaxPro.Utility.RegisterTypeForAjax(typeof(AboutMeEdit)); member = (Member)Session["Member"]; if (!Page.IsPostBack) { LoadMember(); PopulateOtherHalfCombo(); if (member.AccountType == (int)AccountType.Personal) { LoadMemberProfile(); } else if (member.AccountType == (int)AccountType.Business) { LoadBusiness(); } drpDayJob.Items.Insert(0, new ListItem("Select Profession", "-1")); drpNightJob.Items.Insert(0, new ListItem("Select Profession", "-1")); drpFavInterest.Items.Insert(0, new ListItem("Select Interest", "-1")); } }
protected override string GetKeyName(Member property, Type type) { if (property == null) return type.Name + "Id"; // many-to-many, one-to-many, join return property.Name + "Id"; // many-to-one }
public void Map(ClassMappingBase classMap, Member property) { if (!(classMap is ClassMapping)) return; var version = new VersionMapping { Name = property.Name, ContainingEntityType = classMap.Type, }; version.SetDefaultValue("Type", GetDefaultType(property)); version.AddDefaultColumn(new ColumnMapping { Name = property.Name }); if (IsSqlTimestamp(property)) { version.Columns.Each(x => { x.SqlType = "timestamp"; x.NotNull = true; }); version.UnsavedValue = null; } ((ClassMapping)classMap).Version = version; }
private TypeReference GetDefaultType(Member property) { if (IsSqlTimestamp(property)) return new TypeReference("BinaryBlob"); return new TypeReference(property.PropertyType); }
public static void GetXmlName( Member member, ref Identifier name, ref Identifier ns ) { AttributeList attrs = MetadataHelper.GetCustomAttributes( member, SystemTypes.XmlElementAttributeClass ); if( attrs != null ) { for( int i = 0, n = attrs.Count; i < n; i++ ) { AttributeNode attr = attrs[i]; if( attr == null ) continue; Literal litName = MetadataHelper.GetNamedAttributeValue(attr, idElementName); if (litName == null) litName = MetadataHelper.GetAttributeValue(attr,0); Literal litNs = MetadataHelper.GetNamedAttributeValue(attr, idNamespace); name = (litName != null) ? Identifier.For(litName.Value as String) : Identifier.Empty; ns = (litNs != null) ? Identifier.For(litNs.Value as String) : Identifier.Empty; return; } } attrs = MetadataHelper.GetCustomAttributes( member, SystemTypes.XmlAttributeAttributeClass ); if( attrs != null ) { for( int i2 = 0, n2 = attrs.Count; i2 < n2; i2++ ) { AttributeNode attr = attrs[i2]; if( attr == null ) continue; Literal litName = MetadataHelper.GetNamedAttributeValue(attr, idElementName); if (litName == null) litName = MetadataHelper.GetAttributeValue(attr,0); Literal litNs = MetadataHelper.GetNamedAttributeValue(attr, idNamespace); name = (litName != null) ? Identifier.For(litName.Value as String) : Identifier.Empty; ns = (litNs != null) ? Identifier.For(litNs.Value as String) : null; return; } } }
public static XPathNodeType GetNodeType( Member member ) { if( MetadataHelper.HasCustomAttribute( member, SystemTypes.XmlAttributeAttributeClass ) || MetadataHelper.HasCustomAttribute( member, SystemTypes.XmlIgnoreAttributeClass )) { return XPathNodeType.Attribute; } return XPathNodeType.Element; }
public override void VisitMember(Member member) { _builder.AppendLine(); _builder.AppendFormat("### `{0}`", _name(member.Id)); base.VisitMember(member); }
public void Render(Member member) { Console.ForegroundColor = ConsoleColor.White; Console.WriteLine("\n Medlemsnummer {0}",member.Id ); Console.WriteLine(" Namn: {0}", member.FirstName + " " + member.LastName + " "); Console.WriteLine(" Telefon nummer: {0}", member.PhoneNumber); }
/// <summary> /// Checks the specified member. /// </summary> /// <param name="member">The member.</param> /// <returns></returns> public override ProblemCollection Check(Member member) { AttributeNode attribute = SemanticRulesUtilities.GetAttribute(member, ServiceContractAttribute) ?? SemanticRulesUtilities.GetAttribute(member, OperationContractAttribute); return CheckForProblems(attribute); }
public virtual Access GetAccessStrategyForReadOnlyProperty(Member member) { if (member.IsAutoProperty) return Access.BackField; return Access.ReadOnlyPropertyThroughCamelCaseField(); }
private void ModBttn_Click(object sender, EventArgs e) { try { InitValues(); } catch (Exception exc) { MessageBox.Show("Registration of member has failed. Please check your inputs and try again.\n\nError Code: " + exc.Message); return; } SqlCommand command = new Member(this).UpdateIntoSQL(); command.Connection = con; Console.WriteLine(con.ConnectionString); con.Open(); try { Console.WriteLine(command.ExecuteNonQuery()); } catch(Exception exc) { MessageBox.Show("It broke.\n\nMessage:" + exc.Message); return; } con.Close(); MessageBox.Show("Update Successful."); parent.PullData(); Close(); }
public int InsertNew(string mFBID, string mName) { NokatEntities entities = new NokatEntities(); Member _Mem = new Member() { FBID = mFBID, Name = mName }; Member MemVar = null; try { MemVar = entities.Members.First(p => p.FBID == mFBID); } catch { entities.Members.AddObject(_Mem); entities.SaveChanges(); return _Mem.ID; } if (MemVar != null) { return MemVar.ID; } else { entities.Members.AddObject(_Mem); entities.SaveChanges(); return _Mem.ID; } }
public bool IsSet(Member property) { var mappedProperty = propertyMappings.Get(property); return mapping.Columns.Any(x => x.IsSpecified(mappedProperty)) || mapping.IsSpecified(mappedProperty); }
protected override string GetKeyName(Member member, Type type) { if (member == null) return "Id" + type.Name; // many-to-many, one-to-many, join return "Id" + type.Name; // many-to-one }
public static AttributeList GetCustomAttributes( Member member, TypeNode attrType ) { AttributeList result = null; if (member == null) return null; AttributeList attrs = member.Attributes; if( attrs != null ) { for( int i = 0; i < attrs.Count; i++ ) { AttributeNode an = attrs[i]; if (an == null) continue; MemberBinding mb = an.Constructor as MemberBinding; if( mb != null && mb.BoundMember != null && mb.BoundMember.DeclaringType == attrType ) { if( result == null ) { result = new AttributeList(); } result.Add(an); } } } if (result == null) { TypeNode tn = member as TypeNode; if (tn != null) return MetadataHelper.GetCustomAttributes(tn.BaseType, attrType); Property p = MetadataHelper.GetPropertyForMethod(member); if (p != null) return MetadataHelper.GetCustomAttributes(p, attrType); } return result; }
public Member AddMember() { Console.WriteLine("Write the member name: "); Member v_member = new Member(Console.ReadLine()); if (v_member.name == "") { ErrorMessege(); return null; } Console.WriteLine("The format of personal number is xxxxxxxxxx\nExample: 9101049121"); Console.WriteLine("Write the member personal number: "); v_member.personalNumber = Console.ReadLine(); if (v_member.personalNumber == "") { return null; } foreach (char c in v_member.personalNumber) { if (c < '0' || c > '9') { ErrorMessege(); return null; } } if (v_member.personalNumber.Length != 10) { ErrorMessege(); return null; } v_member.boatlist = new List<Boat>(); return v_member; }
public static void AddMember(Member newMember) { using (StreamWriter writer = new StreamWriter(MemberSavePath, true)) { writer.WriteLine("{0} {1} {2} {3}", newMember.UniqueId, newMember.FirstName, newMember.LastName, newMember.SocialSecurityNumber); } }
/// <summary> /// Constructor 1 /// </summary> /// <param name="memberIn"></param> public Membership(Member memberIn) : this(memberIn, string.Empty) { }
public new bool IsSet(Member property) { return(mapping.IsSpecified(mappedProperties.Get(property))); }
//Method to execute when AddUser button is clicked private void AddUser_Click(object sender, RoutedEventArgs e) { //Save TextBox content to variables for easy access var name = NameBox.Text; var userName = UserNameBox.Text; var rowLevel = RowLevelBox.SelectedIndex + 1; //Add 1 because combobox index start at 0 and values in database vary from 1 to 4 var accessLevel = AccesslevelBox.SelectedIndex + 1; //Add 1 because combobox index start at 0 and values in database vary from 1 to 5 //Check for empty fields, if a field is left empty show an error dialog if (!string.IsNullOrWhiteSpace(name) && !string.IsNullOrWhiteSpace(userName)) { try { DateTime?memberUntil; try { memberUntil = DatePicker.SelectedDate.Value; } catch (InvalidOperationException) { throw new InvalidDateException("Selecteer een datum"); } //CHeck for invalid characters in the strings if (Member.NameHasSpecialChars(name)) { throw new FormatException(); } if (Member.HasSpecialChars(userName)) { throw new FormatException(); } //Create new member to add to the DB var member = new Member { memberUsername = userName, memberName = name, memberRowLevelId = rowLevel, memberAccessLevelId = accessLevel, memberSubscribedUntill = memberUntil }; //Check if the member aleady exists Member.CheckIfMemberExists(member); //Add new member to database Member.AddMemberToDb(member); MessageBox.Show("Gebruiker is succesvol toegevoegd.", "Gebruiker toegevoegd", MessageBoxButton.OK, MessageBoxImage.Information); Switcher.Switch(new EditUserScreen(FullName, AccessLevel, MemberId)); } catch (FormatException) { //Warning message for FormatException MessageBox.Show("Een van de ingevulde waardes is niet geldig", "Ongeldige waarde", MessageBoxButton.OK, MessageBoxImage.Warning); } catch (InvalidDateException ide) { //Warning message for an invalid date MessageBox.Show(ide.Message, "Datum is niet geldig", MessageBoxButton.OK, MessageBoxImage.Warning); } catch (Exception ex) { //Error message for any other exception that could occur MessageBox.Show(ex.Message, "Een fout is opgetreden", MessageBoxButton.OK, MessageBoxImage.Error); } } else { MessageBox.Show("Vul alle velden in.", "Niet alle velden zijn ingevuld", MessageBoxButton.OK, MessageBoxImage.Warning); } }
static void MemberAfterSave(Member sender, SaveEventArgs e) { // Clear the member cache for this member, so if new properties are added // or profile updated its available straight away CacheHelper.Clear(CacheHelper.CacheNameMember(sender.Id)); }
private void btnSua_Click(object sender, EventArgs e) { errorProvider1.Clear(); string MSNV = this.txtMSNV.Text.ToString().Trim(); string TenNV = this.txtTenNhanVien.Text.ToString().Trim(); string SDT = this.txtSoDienThoai.Text.ToString().Trim(); string Email = this.txtEmail.Text.ToString().Trim(); DateTime NgaySinh = this.dtNgaySinh.Value; string Luong = this.txtLuong.Text.ToString().Trim(); string DiaChi = this.txtDiaChi.Text.ToString().Trim(); DateTime ThoiGianBatDauLamViec = this.dtThoiGianBatDauLamViec.Value; DateTime GioLam = DateTime.MinValue; DateTime GioNghi = DateTime.MinValue; GioLam = new DateTime(1, 1, 1, int.Parse(this.nudGioLam.Value.ToString()), int.Parse(this.nudPhutLam.Value.ToString()), 0); GioNghi = new DateTime(1, 1, 1, int.Parse(this.nudGioNghi.Value.ToString()), int.Parse(this.nudPhutNghi.Value.ToString()), 0); if (MSNV == "") { errorProvider1.SetError(txtMSNV, "Hãy điền Mã nhân viên"); return; } else if (TenNV == "") { errorProvider1.SetError(txtTenNhanVien, "Hãy điền tên nhân viên"); return; } else if (SDT == "") { errorProvider1.SetError(txtSoDienThoai, "Hãy điền số điện thoại"); return; } else if (Email == "") { errorProvider1.SetError(txtEmail, "Hãy điền email"); return; } else if (NgaySinh == null) { errorProvider1.SetError(dtNgaySinh, "Hãy điền ngày sinh"); return; } else if (Luong == "") { errorProvider1.SetError(txtLuong, "Hãy điền lương cho nhân viên"); return; } else if (DiaChi == "") { errorProvider1.SetError(txtDiaChi, "Hãy điền địa chỉ cho nhân viên"); return; } else if (GioLam == DateTime.MinValue) { errorProvider1.SetError(nudPhutLam, "Hãy điền giờ bắt đầu làm cho nhân viên"); return; } else if (GioNghi == DateTime.MinValue) { errorProvider1.SetError(nudPhutNghi, "Hãy điền giờ nghỉ cho nhân viên"); return; } else if (ThoiGianBatDauLamViec == null) { errorProvider1.SetError(dtThoiGianBatDauLamViec, "Hãy điền thời gian bắt đầu làm việc cho nhân viên"); return; } else if (!kiemTraSoDienThoaiHopLe(SDT)) { errorProvider1.SetError(txtSoDienThoai, "Số điện thoại không hợp lệ"); return; } else if (!kiemTraEmail(Email)) { errorProvider1.SetError(txtEmail, "Email không hợp lệ"); return; } else if (!int.TryParse(Luong, out int a) || a <= 0) { errorProvider1.SetError(txtLuong, "Lương không hợp lệ"); return; } else if (int.Parse(this.nudGioLam.Value.ToString()) > int.Parse(this.nudGioNghi.Value.ToString())) { errorProvider1.SetError(nudPhutNghi, "Giờ nghỉ phải giờ bắt đầu làm"); return; } else if (int.Parse(this.nudGioLam.Value.ToString()) == int.Parse(this.nudGioNghi.Value.ToString())) { if (int.Parse(this.nudPhutLam.Value.ToString()) >= int.Parse(this.nudPhutNghi.Value.ToString())) { errorProvider1.SetError(nudPhutNghi, "Giờ nghỉ phải giờ bắt đầu làm"); return; } } Member nhanvien = new Member(); nhanvien.ID = MSNV; nhanvien.FullName = TenNV; nhanvien.Phone = SDT; nhanvien.Email = Email; nhanvien.BirthDay = NgaySinh; nhanvien.Salary = int.Parse(Luong); nhanvien.Address = DiaChi; nhanvien.TimeStartWork = ThoiGianBatDauLamViec; nhanvien.TimeBegin = GioLam.TimeOfDay; nhanvien.TimeEnd = GioNghi.TimeOfDay; MemberController.SuaThongTinThanhVien(nhanvien); MessageBox.Show("Sửa thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); }
public IActionResult Delete(Member contact) { context.Members.Remove(contact); context.SaveChanges(); return(RedirectToAction("Index", "Home")); }
/// <summary> /// Constructor 2 /// </summary> /// <param name="memberIn"></param> /// <param name="id"></param> public Membership(Member memberIn, string id) { m_member = memberIn; m_id = id; }
public static Member GetCurrentMember() { return(Member.GetCurrentMember()); }
public static void ProcessRequest(HttpContext context) { try { string RequestIP = IP.Current; //Log string LogMessage = context.Request.Params.ToRawString(); ErrorLogger.Log(LogMessage, LogType.CPAGPTNetworks); AppSettings.Points.Reload(); //Get proper Network string Hash = CPAFileManager.GetHashFromClientHandlerHit(context); AffiliateNetwork Network = TableHelper.SelectRows <AffiliateNetwork>(TableHelper.MakeDictionary("Hash", Hash))[0]; //All OK string Username = GetFromRequest(context, Network.VariableNameOfUsername); //string _Balance = GetFromRequest(context, Network.VariableNameOfBalance); string OfferID = GetFromRequest(context, Network.VariableNameOfOfferId); string _WebsiteId = GetFromRequest(context, Network.VariableNameOfWebsiteId); //Can be null string OfferTitle = GetFromRequest(context, Network.VariableNameOfOfferName); //Can be null string _CreditVal = GetFromRequest(context, Network.VariableNameOfType); //Can be null string Signature = GetFromRequest(context, Network.VariableNameOfSignature); //Can be null string UserIP = GetFromRequest(context, Network.VariableNameOfMemberIP); //Can be null string ShortOfferTitle = OfferTitle != null ? ": " + ShortenString(OfferTitle, 8) + "..." : ""; string TrackingInfo = OfferID; bool isLocked = false; //Points Locking feature Money Balance = new Money(0); //try //{ // Balance = Money.Parse(_Balance); //} //catch (Exception ex) { } //Check Status and IP restrictions bool ActiveRestriction = Network.Status == NetworkStatus.Active; bool IPRestriction = !Network.HasRestrictedIPs || (Network.HasRestrictedIPs && Network.RestrictedIPs.Contains(RequestIP)); if (ActiveRestriction && IPRestriction) { //Check condition if (Signature == null || Signature.Trim() == CPAParser.ParseSignatureCondition(Network.SIgnatureCondition, context).Trim()) { //All OK, Verified CPAPostBackLogStatus Status = CPAPostBackLogStatus.Null; Money Calculated = new Money(0); //Let's get our offer CPAOffer OurOffer = null; try { var where = TableHelper.MakeDictionary("NetworkOfferIdInt", OfferID); where.Add("AdvertiserUsername", Network.Name); where.Add("Status", (int)AdvertStatus.Active); OurOffer = TableHelper.SelectRows <CPAOffer>(where)[0]; Balance = OurOffer.BaseValue; } catch (Exception ex) { ErrorLogger.Log(ex); } if (OurOffer != null) { //Lets find submission try { Member User = new Member(Username); CreditAs As = GetCreditAs(OurOffer, Network); PostbackActionType ActionType = CPAHandler.GetActionType(Network, Balance, _CreditVal); var conditions = TableHelper.MakeDictionary("Username", Username); conditions.Add("OfferId", OurOffer.Id); conditions.Add("OfferStatus", (int)OfferStatus.Pending); int IsSubmissionPresent = TableHelper.CountOf <OfferRegisterEntry>(conditions); //Add submission automatically if credit and not found if (IsSubmissionPresent == 0 && ActionType == PostbackActionType.Credit) { OfferRegisterEntry.CheckDuplicateAndStatus(User.Name, OurOffer, true); OfferRegisterEntry.AddNew(OurOffer, User.Name, OfferStatus.Pending, String.Empty, String.Empty); IsSubmissionPresent = TableHelper.CountOf <OfferRegisterEntry>(conditions); } if (IsSubmissionPresent > 0) { OfferRegisterEntry ThisEntry = TableHelper.SelectRows <OfferRegisterEntry>(conditions)[0]; if (ActionType == PostbackActionType.Reverse) { CPAPostbackLog oldLog = PointsLockingHelper.FindSimilarCpaLog(User.Name, Network.Name, TrackingInfo); if (oldLog == null) { Calculated = CPAManager.DenyEntryFromPostback(ThisEntry, Balance, As, OurOffer.Id, Network.Name, OfferTitle, Network.RequiresConversion); Status = CPAPostBackLogStatus.ReversedByNetwork; } else { Status = CPAPostBackLogStatus.ReversedByNetwork; oldLog.Status = Status; CPAManager.DenyEntry(ThisEntry, User, OfferTitle); } } if (ActionType == PostbackActionType.Credit) { if (PointsLockingManager.CPAGPTShouldBeLocked(Balance, As, User, Network.RequiresConversion)) { ThisEntry.HasBeenLocked = true; ThisEntry.Save(); Calculated = CPAGPTCrediter.CalculatePostback(Balance, Network.RequiresConversion, User, As); Status = CPAPostBackLogStatus.CreditedAndPointsLocked; History.AddOfferLocked(User.Name, Network.Name, OfferTitle, Calculated, As); } else { var where = TableHelper.MakeDictionary("Id", ThisEntry._OfferId); var CpaOffer_entryId = TableHelper.SelectRows <CPAOffer>(where); Calculated = CPAManager.AcceptEntryFromPostback(ThisEntry, Balance, As, OurOffer.Id, Network.Name, CpaOffer_entryId[0].Title, Network.RequiresConversion, out isLocked); Status = CPAPostBackLogStatus.CreditedByNetwork; } } //Add CPAPostbackLog CPAPostbackLog.Create(Network, Username, Balance, Calculated, TrackingInfo, Status); //If All was handled OK, than succResponse context.Response.Write(Network.ValueOfSuccessfulResponse); } else { CPAPostbackLog.Create(Network, Username, Balance, Calculated, TrackingInfo, CPAPostBackLogStatus.SubmissionNotFound); } } catch (MsgException ex) { //Offer has been already submited and it's not daily //Offer is daily, but was submited today //Offer is daly and can be submited X times a day, but was submited >= X today CPAPostbackLog.Create(Network, Username, Balance, Calculated, TrackingInfo, CPAPostBackLogStatus.ExceededSubmissionLimitForThisOffer); context.Response.Write(Network.ValueOfSuccessfulResponse); } catch (Exception ex) { ErrorLogger.Log(ex); CPAPostbackLog.Create(Network, Username, Balance, Calculated, TrackingInfo, CPAPostBackLogStatus.Null); } } else { CPAPostbackLog.Create(Network, Username, Balance, null, TrackingInfo, CPAPostBackLogStatus.OfferNotFoundByOfferId); } } else { CPAPostbackLog.Create(Network, Username, Balance, null, TrackingInfo, CPAPostBackLogStatus.WrongSignature); } } else if (IPRestriction) { CPAPostbackLog.Create(Network, Username, Balance, null, TrackingInfo, CPAPostBackLogStatus.NetworkInactive); } else if (ActiveRestriction) { CPAPostbackLog.Create(Network, Username, Balance, null, TrackingInfo, CPAPostBackLogStatus.SentFromUnallowedIP); } } catch (Exception ex) { Prem.PTC.ErrorLogger.Log(ex); } }
/// <summary> /// Constructor 0: Default /// </summary> public Membership() : this(null) { m_member = new Member(); }
protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId)) { base.GotoResourceNotFound(""); } this.rptProductImages = (VshopTemplatedRepeater)this.FindControl("rptProductImages"); this.litProdcutName = (System.Web.UI.WebControls.Literal) this.FindControl("litProdcutName"); this.litSalePrice = (System.Web.UI.WebControls.Literal) this.FindControl("litSalePrice"); this.litMarketPrice = (System.Web.UI.WebControls.Literal) this.FindControl("litMarketPrice"); this.litShortDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription"); this.litDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litDescription"); this.litTaxRate = (System.Web.UI.WebControls.Literal) this.FindControl("litTaxRate"); this.litShipping = (System.Web.UI.WebControls.Literal) this.FindControl("litShipping"); this.litStock = (System.Web.UI.WebControls.Literal) this.FindControl("litStock"); this.litBuyCardinality = (System.Web.UI.WebControls.Literal) this.FindControl("litBuyCardinality"); this.litSupplier = (System.Web.UI.WebControls.Literal) this.FindControl("litSupplier"); this.lblsmalltitle = (System.Web.UI.WebControls.Literal) this.FindControl("lblsmalltitle"); this.litDiscrunt = (System.Web.UI.WebControls.Literal) this.FindControl("litDiscrunt"); this.litpropricemsg = (System.Web.UI.WebControls.Literal) this.FindControl("litpropricemsg"); this.litProPromration = (System.Web.UI.WebControls.Literal) this.FindControl("litProPromration"); this.litOrderPromration = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderPromration"); this.litFreeShip = (System.Web.UI.WebControls.Literal) this.FindControl("litFreeShip"); this.skuSelector = (Common_SKUSelector)this.FindControl("skuSelector"); this.linkDescription = (System.Web.UI.WebControls.HyperLink) this.FindControl("linkDescription"); this.expandAttr = (Common_ExpandAttributes)this.FindControl("ExpandAttributes"); this.litSoldCount = (System.Web.UI.WebControls.Literal) this.FindControl("litSoldCount"); this.litConsultationsCount = (System.Web.UI.WebControls.Literal) this.FindControl("litConsultationsCount"); this.litReviewsCount = (System.Web.UI.WebControls.Literal) this.FindControl("litReviewsCount"); this.litHasCollected = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("litHasCollected"); this.hidden_skus = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_skus"); this.hidden_BuyCardinality = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_BuyCardinality"); this.lbUserProductRefer = (UserProductReferLabel)this.FindControl("lbUserProductRefer"); this.promote = (ProductPromote)this.FindControl("ProductPromote"); this.litCnArea = (System.Web.UI.WebControls.Literal) this.FindControl("litCnArea"); this.imgIcon = (HiImage)this.FindControl("imgIcon"); //this.imgSupplierIcon = (HiImage)this.FindControl("imgSupplierIcon"); ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(this.productId, null, null); if (productBrowseInfo == null) { base.GotoResourceNotFound("此商品已不存在"); } if (productBrowseInfo.Product == null) { base.GotoResourceNotFound("此商品已不存在"); } if (productBrowseInfo.Product.SaleStatus != ProductSaleStatus.OnSale) { base.GotoResourceNotFound("此商品已下架"); } if (!productBrowseInfo.Product.IsApproved) { base.GotoResourceNotFound("此商品未审核"); } System.Collections.IEnumerable value = from item in productBrowseInfo.Product.Skus select item.Value; if (this.hidden_skus != null) { this.hidden_skus.Value = JsonConvert.SerializeObject(value); } if (HiContext.Current.User.UserRole == UserRole.Member && ((Member)HiContext.Current.User).ReferralStatus == 2 && string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralUserId"])) { string text = System.Web.HttpContext.Current.Request.Url.ToString(); if (text.IndexOf("?") > -1) { text = text + "&ReferralUserId=" + HiContext.Current.User.UserId; } else { text = text + "?ReferralUserId=" + HiContext.Current.User.UserId; } base.RegisterShareScript(productBrowseInfo.Product.ImageUrl4, text, productBrowseInfo.Product.ShortDescription, productBrowseInfo.Product.ProductName); } if (this.lbUserProductRefer != null) { this.lbUserProductRefer.product = productBrowseInfo.Product; } ImportSourceTypeInfo imSourceType = ProductBrowser.GetProductImportSourceType(this.productId); if (this.litCnArea != null && imSourceType != null) { this.litCnArea.Text = imSourceType.CnArea; } if (this.imgIcon != null && imSourceType != null) { this.imgIcon.ImageUrl = imSourceType.Icon; } if (this.rptProductImages != null) { string locationUrl = "javascript:;"; SlideImage[] source = new SlideImage[] { new SlideImage(productBrowseInfo.Product.ImageUrl1, locationUrl), new SlideImage(productBrowseInfo.Product.ImageUrl2, locationUrl), new SlideImage(productBrowseInfo.Product.ImageUrl3, locationUrl), new SlideImage(productBrowseInfo.Product.ImageUrl4, locationUrl), new SlideImage(productBrowseInfo.Product.ImageUrl5, locationUrl), }; this.rptProductImages.DataSource = from item in source where !string.IsNullOrWhiteSpace(item.ImageUrl) select item; this.rptProductImages.DataBind(); } this.litProdcutName.Text = productBrowseInfo.Product.ProductName; this.litSalePrice.Text = productBrowseInfo.Product.MinSalePrice.ToString("F2"); if (productBrowseInfo.Product.MarketPrice.HasValue) { this.litMarketPrice.SetWhenIsNotNull(productBrowseInfo.Product.MarketPrice.GetValueOrDefault(0m).ToString("F2")); } this.litShortDescription.Text = productBrowseInfo.Product.ShortDescription; if (this.litDescription != null) { System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("<script[^>]*?>.*?</script>", System.Text.RegularExpressions.RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(productBrowseInfo.Product.MobblieDescription)) { this.litDescription.Text = regex.Replace(productBrowseInfo.Product.MobblieDescription, ""); } else { if (!string.IsNullOrWhiteSpace(productBrowseInfo.Product.Description)) { this.litDescription.Text = regex.Replace(productBrowseInfo.Product.Description, ""); } } } this.litSoldCount.SetWhenIsNotNull(productBrowseInfo.Product.ShowSaleCounts.ToString()); this.litStock.Text = productBrowseInfo.Product.Stock.ToString(); //this.litTaxRate.Text = (productBrowseInfo.Product.TaxRate * 100).ToString("0"); if (this.litTaxRate != null) { this.litTaxRate.Text = productBrowseInfo.Product.GetExtendTaxRate(); } if (productBrowseInfo.Product.BuyCardinality > 1) { this.litBuyCardinality.Text = "起购数:" + productBrowseInfo.Product.BuyCardinality; } else { this.litBuyCardinality.Visible = false; } this.hidden_BuyCardinality.Value = productBrowseInfo.Product.BuyCardinality.ToString(); //运费模版 ShippingModeInfo shippingMode = ShoppingProcessor.GetShippingMode(Int32.Parse(productBrowseInfo.Product.TemplateId != null ? productBrowseInfo.Product.TemplateId.ToString() : "0")); this.litShipping.Text = shippingMode != null ? shippingMode.TemplateName : "未设置"; this.skuSelector.ProductId = this.productId; if (this.expandAttr != null) { this.expandAttr.ProductId = this.productId; } if (this.linkDescription != null) { this.linkDescription.NavigateUrl = "/Vshop/ProductDescription.aspx?productId=" + this.productId; } this.litConsultationsCount.SetWhenIsNotNull(productBrowseInfo.ConsultationCount.ToString()); this.litReviewsCount.SetWhenIsNotNull(productBrowseInfo.ReviewCount.ToString()); Member member = HiContext.Current.User as Member; int favoriteId = 0; if (member != null) { favoriteId = ProductBrowser.GetFavoriteId(member.UserId, this.productId); } this.litHasCollected.SetWhenIsNotNull(favoriteId.ToString()); if (this.promote != null) { this.promote.ProductId = this.productId; } PageTitle.AddSiteNameTitle(productBrowseInfo.Product.ProductName); //this.litSupplierName.Text = productBrowseInfo.SupplierName; //if (this.imgSupplierIcon != null && productBrowseInfo.SupplierImageUrl != null) //{ // this.imgSupplierIcon.ImageUrl = productBrowseInfo.SupplierImageUrl; //} if (productBrowseInfo.Product.SupplierId == null || productBrowseInfo.Product.SupplierId == 0) { this.litSupplier.Text = ""; } else { this.litSupplier.Text = "<a class=\"shop-link fix\" href=\"/vshop/SupProductList.aspx?SupplierId=" + productBrowseInfo.Product.SupplierId + "\"><span>进入店铺</span><img src=\"" + productBrowseInfo.SupplierLogo + "\"/>" + productBrowseInfo.SupplierName + "</a>"; } this.lblsmalltitle.Text = productBrowseInfo.Product.ProductTitle; //this.litDiscrunt = (System.Web.UI.WebControls.Literal)this.FindControl("litDiscrunt"); //this.litpropricemsg = (System.Web.UI.WebControls.Literal)this.FindControl("litpropricemsg"); //显示促销信息 if (productBrowseInfo.Product.IsPromotion) { this.litpropricemsg.Text = "<span class=\"pro-pricemsg\">促销价</span>"; } decimal tempMinSalePrice = productBrowseInfo.Product.MinSalePrice; //折扣价 decimal tempMarketPrice = productBrowseInfo.Product.MarketPrice.GetValueOrDefault(0m); //会员价 decimal tempDiscrunt = 1M; if (tempMarketPrice > 0) { tempDiscrunt = (tempMinSalePrice / tempMarketPrice) * 10; } //显示折扣信息 if (productBrowseInfo.Product.IsDisplayDiscount) { this.litDiscrunt.Text = "<span class=\"pro-discrunt\">" + tempDiscrunt.ToString("F2") + "折</span>"; } //PromotionInfo promotionInfo; List <OrderPromotionItem> orderpromotionlist = new List <OrderPromotionItem>(); List <ProductPromotionItem> productpromotionlist = new List <ProductPromotionItem>(); if (member != null) { //promotionInfo = ProductBrowser.GetProductPromotionInfo(member, productId); DataTable dtorderpromotion = ProductBrowser.GetOrderPromotionInfo(member); if (dtorderpromotion != null) { OrderPromotionItem item = null; foreach (DataRow row in dtorderpromotion.Rows) { item = new OrderPromotionItem(); if (row["Name"] != DBNull.Value) { item.Name = (string)row["Name"]; } if (row["PromoteType"] != DBNull.Value) { item.PromoteType = (int)row["PromoteType"]; } orderpromotionlist.Add(item); } } DataTable dtproductpromotion = ProductBrowser.GetProductPromotionList(member, productId); if (dtproductpromotion != null) { ProductPromotionItem item = null; foreach (DataRow row in dtproductpromotion.Rows) { item = new ProductPromotionItem(); if (row["Name"] != DBNull.Value) { item.Name = (string)row["Name"]; } if (row["PromoteType"] != DBNull.Value) { item.PromoteType = (int)row["PromoteType"]; } productpromotionlist.Add(item); } } } else { //promotionInfo = ProductBrowser.GetAllProductPromotionInfo(productId); DataTable dtorderpromotion = ProductBrowser.GetAllOrderPromotionInfo(); if (dtorderpromotion != null) { OrderPromotionItem item = null; foreach (DataRow row in dtorderpromotion.Rows) { item = new OrderPromotionItem(); if (row["Name"] != DBNull.Value) { item.Name = (string)row["Name"]; } if (row["PromoteType"] != DBNull.Value) { item.PromoteType = (int)row["PromoteType"]; } orderpromotionlist.Add(item); } } DataTable dtproductpromotion = ProductBrowser.GetAllProductPromotionList(productId); if (dtproductpromotion != null) { ProductPromotionItem item = null; foreach (DataRow row in dtproductpromotion.Rows) { item = new ProductPromotionItem(); if (row["Name"] != DBNull.Value) { item.Name = (string)row["Name"]; } if (row["PromoteType"] != DBNull.Value) { item.PromoteType = (int)row["PromoteType"]; } productpromotionlist.Add(item); } } } //this.litProPromration = (System.Web.UI.WebControls.Literal)this.FindControl("litProPromration"); //this.litOrderPromration = (System.Web.UI.WebControls.Literal)this.FindControl("litOrderPromration"); //包邮 if (orderpromotionlist != null) { for (int i = 0; i < orderpromotionlist.Count; i++) { if (orderpromotionlist[i].PromoteType == 17) { this.litFreeShip.Text = "<div><span style=\"color:#999\">" + orderpromotionlist[i].Name + "</span></div>"; } else { this.litOrderPromration.Text = "<span>" + orderpromotionlist[i].Name + "</span>"; } } } if (productpromotionlist != null) { for (int i = 0; i < productpromotionlist.Count; i++) { this.litProPromration.Text = "<span>" + productpromotionlist[i].Name + "</span>"; break; } } }
public static int GetCurrentMemberId() { return(Member.CurrentMemberId()); }
public bool DeleteMember(Member M) { _db.Members.Remove(_db.Members.Where(x => x.displayName == M.displayName).FirstOrDefault()); _db.SaveChanges(); return(true); }
protected void Page_Load(object sender, EventArgs e) { var targetFeature = PurchaseOption.Features.Upgrade; var purchaseOption = PurchaseOption.Get(targetFeature); if (purchaseOption.PurchaseBalanceEnabled) { UpgradeFromAdBalance.Visible = true; } else { UpgradeFromAdBalance.Visible = false; adBalanceInfo.Visible = false; } if (AppSettings.Payments.CashBalanceEnabled && purchaseOption.CashBalanceEnabled) { UpgradeFromCashBalance.Visible = true; } else { UpgradeFromCashBalance.Visible = false; cashBalanceInfo.Visible = false; } AccessManager.RedirectIfDisabled(AppSettings.TitanFeatures.UpgradeEnabled); User = Member.CurrentInCache; if (!Page.IsPostBack) { //Lang LangAdder.Add(UpgradeFromAdBalance, U6012.PAYVIAPURCHASEBALANCE); LangAdder.Add(UpgradeFromCashBalance, U6005.PAYVIACASHBALANCE); LangAdder.Add(UpgradeViaPaymentProcessor, U6005.PAYVIAPAYMENTPROCESSOR); //Bind the data dor DDL BindDataToDDL(); //Visibility UpgradeViaPaymentProcessorPlaceHolder.Visible = PaymentAccountDetails.AreIncomingPaymentProcessorsAvailable(); } if (TitanFeatures.IsRofriqueWorkMines) { UpgradeFromAdBalancePlaceHolder.Visible = false; UpgradeViaPaymentProcessorPlaceHolder.Visible = false; } HideCashBalanceDepositCommissionColumn = AreAllCashBalanceDepositCommissionsZero(); ddlOptions.Attributes.Add("onchange", "updatePrice();"); autopayHelpArray = new Dictionary <string, bool>(); Label10.Text = AppSettings.Memberships.TenPointsValue.ToClearString(); LabelIle.Text = AppSettings.Memberships.UpgradePointsDiscount.ToString(); //Display warning string WarningMessage = UpgradePageHelper.GetWarningMessage(User); WarningPanel.Visible = !String.IsNullOrEmpty(WarningMessage); WarningLiteral.Text = WarningMessage; AdBalanceLiteral.Text = User.PurchaseBalance.ToString(); CashBalanceLiteral.Text = User.CashBalance.ToString(); if (AppSettings.Points.LevelMembershipPolicyEnabled) { BuyUpgradePlaceHolder.Visible = false; } hiddenProperties = MembershipProperty.GetPropsToHideForClient(); TypesMembershipProperties.Text = AdPackTypeMembershipMapper.Mapper.GetHtmlFromCache(); AdPackPropsPlaceHolder.Visible = AppSettings.TitanFeatures.AdvertAdPacksEnabled; PaymentProcessorsButtonPlaceholder.Visible = false; }
public override bool ShouldMap(Member member) { return(base.ShouldMap(member) && member.CanWrite); }
public void Add(Member member) { _seenSignatures.Add(member.GetSignature()); }
public static MemberDTO ToDto(this Member model) { return(Mapper.Map <MemberDTO>(model)); }
public Member SearchMember(Member M) { return(_db.Members.Where(x => x.displayName == M.displayName).FirstOrDefault()); }
public string GetFilter(SearchFilterModel searchFilterModel, Member member) { return($"{member.Name} {GetComparison(searchFilterModel)} '{searchFilterModel.Value}'"); }
public override bool IsId(Member member) { return(member.Name == "Id"); }
protected override ManyToManyPart <TChild> HasManyToMany <TChild>(Member property) { membersMapped.Add(property); return(base.HasManyToMany <TChild>(property)); }
public bool CanHandle(Comparisons comparison, Member member) { return(member.Type == typeof(string)); }
protected override PropertyBuilder Map(Member property, string columnName) { membersMapped.Add(property); return(base.Map(property, columnName)); }
protected override OneToOnePart <TOther> HasOne <TOther>(Member property) { membersMapped.Add(property); return(base.HasOne <TOther>(property)); }
private void btnAddMember_Click(object sender, EventArgs e) { string name = tbxName.Text; string ic = tbxIcNumber.Text; DateTime dOB = dateTimePickerDateOfBirth.Value; string phoneNum = tbxPhoneNumber.Text; string newDate = dateTimePickerMembershipRenewalDate.Text; string registrationNumber = tbxCarRegistrationNumber.Text; string model = tbxCarModel.Text; int year = Convert.ToInt32(dateTimePickerCarYear.Text); if (!rbnOneYearMembershipRenewal.Checked && !rbnFiveYearMembershipRenewal.Checked) { MessageBox.Show("Encountered an error over here!\n" + "Please choose MEMBERSHIP TYPE", "", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (string.IsNullOrWhiteSpace(tbxName.Text)) { MessageBox.Show("Encountered an error over here!" + "\n\nMEMBER'S NAME NOT INSERTED", "", MessageBoxButtons.OK, MessageBoxIcon.Error); tbxName.Focus(); } else if (string.IsNullOrWhiteSpace(tbxIcNumber.Text)) { MessageBox.Show("Encountered an error over here!" + "\n\nMEMBER'S IC NUMBER NOT INSERTED!", "", MessageBoxButtons.OK, MessageBoxIcon.Error); tbxIcNumber.Focus(); } else if (string.IsNullOrWhiteSpace(tbxPhoneNumber.Text)) { MessageBox.Show("Encountered an error over here!" + "\n\nMEMBER'S PHONE NUMBER NOT INSERTED", "", MessageBoxButtons.OK, MessageBoxIcon.Error); tbxPhoneNumber.Focus(); } else if (string.IsNullOrWhiteSpace(tbxCarRegistrationNumber.Text)) { MessageBox.Show("Encountered an error over here!" + "\n\nMEMBER'S CAR REGISTRATION NUMBER NOT INSERTED", "", MessageBoxButtons.OK, MessageBoxIcon.Error); tbxCarRegistrationNumber.Focus(); } else if (string.IsNullOrWhiteSpace(tbxCarModel.Text)) { MessageBox.Show("Encountered an error over here!" + "\n\nMEMBER'S CAR MODEL NOT INSERTED!", "", MessageBoxButtons.OK, MessageBoxIcon.Error); tbxCarModel.Focus(); } else { string pos = tbxIcNumber.Text; Member m1 = SearchMemberUsingIc(_memberslist, pos); if (m1 == null) { if (rbnOneYearMembershipRenewal.Checked) { m1 = new OneYearMembershipRenewal(name, ic, dOB, phoneNum, newDate, registrationNumber, model, year); } else if (rbnFiveYearMembershipRenewal.Checked) { m1 = new FiveYearsMembershipRenewal(name, ic, dOB, phoneNum, newDate, registrationNumber, model, year); } _memberslist.Add(m1); MessageBox.Show("Sucessfully ADDED MEMBER", "", MessageBoxButtons.OK, MessageBoxIcon.Information); tbxName.Text = string.Empty; tbxIcNumber.Text = string.Empty; dateTimePickerDateOfBirth.ResetText(); tbxPhoneNumber.Text = string.Empty; tbxCarRegistrationNumber.Text = string.Empty; tbxCarModel.Text = string.Empty; dateTimePickerCarYear.ResetText(); dateTimePickerMembershipRenewalDate.ResetText(); rbnOneYearMembershipRenewal.Checked = false; rbnFiveYearMembershipRenewal.Checked = false; } else { MessageBox.Show("Encountered an error over here!" + "\n\nIC NUMBER ALREADY EXISTED!", "", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
protected override ManyToOneBuilder <TOther> References <TOther>(Member property, string columnName) { membersMapped.Add(property); return(base.References <TOther>(property, columnName)); }
/// <summary> /// Authenticates a member. /// </summary> /// <param name="loginData">The data sent by the client.</param> /// <param name="member">The member created by this method.</param> /// <returns>Returns the result of this action.</returns> public static AuthenticationResult Authenticate(MemberLoginPackageContent loginData, out Member member) { var account = Pool.Server.Accounts.Find(a => a.Email == loginData.User || a.Identity.Id == loginData.User); member = null; if (account == null) { return(AuthenticationResult.UnknownUser); } if (!account.Password.SequenceEqual(Convert.FromBase64String(loginData.Password))) { return(AuthenticationResult.IncorrectPassword); } if (account.Member != null) { return(AuthenticationResult.ExistingSession); } member = new Member { Account = account, Attributes = { ["session.neo.origin"] = "neo.client" } }; return(AuthenticationResult.Success); }
public bool CreateUserAndAccount(Member user) { WebSecurity.CreateUserAndAccount(user.UserName, user.Userpassword); return(true); }
public ActionResult Create(Member member) { _context.Members.Add(member); _context.SaveChanges(); return(RedirectToAction("Index", "Members")); }
public InvestmentPlanCrediter(Member User) : base(User) { }