Exemple #1
0
 private void lstAttributes_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         Cursor.Current = Cursors.WaitCursor;
         Form1 form1 = this.FindForm() as Form1;
         if (this.lstAttributes.SelectedItem == null)
         {
             return;
         }
         CustomMetaDataAttribute cmda = (CustomMetaDataAttribute)this.lstAttributes.SelectedItem;
         form1.txtAttributeName.Text = cmda.attribute.Identifier.Name;
         form1.txtAttributeType.Text = ((object)cmda.attribute.Identifier.MemberType).ToString();
         CustomMember cm = this.lstMembers.SelectedItem as CustomMember;
         form1.txtValidationStatus.Text = this.DisplayMemberValidationStatus(cm);
         if (cm != null)
         {
             form1.txtAttributeType.Text = cm.MemberId.MemberType.ToString();
             if (cmda.attribute != null && (cmda.attribute.IsCode || cmda.attribute.IsName))
             {
                 form1.txtAttributeName.Text  = cm.Name;
                 form1.txtAttributeValue.Text = cm.Code;
             }
             else
             {
                 Common.MDSService.Attribute attribute = Enumerable.FirstOrDefault <Common.MDSService.Attribute>((IEnumerable <Common.MDSService.Attribute>)cm.mbr.Attributes, (Func <Common.MDSService.Attribute, bool>)(p => p.Identifier.Name == cmda.attribute.Identifier.Name));
                 if (attribute != null && attribute.Value != null)
                 {
                     if (attribute.Type == AttributeValueType.Domain)
                     {
                         form1.txtAttributeValue.Text = ((Identifier)attribute.Value).Name;
                     }
                     else
                     {
                         form1.txtAttributeValue.Text = attribute.Value.ToString();
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         Cursor.Current = Cursors.Default;
     }
 }
Exemple #2
0
        private void lstMembers_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.lstMembers.SelectedItem == null)
            {
                return;
            }
            Form1        form1 = this.FindForm() as Form1;
            CustomMember cm    = this.lstMembers.SelectedItem as CustomMember;

            form1.txtAttributeValue.Text   = cm.Code;
            form1.txtAttributeName.Text    = cm.Name;
            form1.txtAttributeType.Text    = cm.mbr.MemberId.MemberType.ToString();
            form1.txtValidationStatus.Text = this.DisplayMemberValidationStatus(cm);
            this.DisplayAttributes();
        }
Exemple #3
0
        private void lstMembers_MouseMove(object sender, MouseEventArgs e)
        {
            int index = this.lstMembers.IndexFromPoint(e.Location);

            if (index <= -1 || index >= this.lstMembers.Items.Count)
            {
                return;
            }
            CustomMember cm      = this.lstMembers.Items[index] as CustomMember;
            string       toolTip = this.toolTip1.GetToolTip((Control)this.lstMembers);
            string       caption = cm.CodeName + " -->" + this.DisplayMemberValidationStatus(cm) + "\r\nUpdatedDateTime=" + cm.mbr.AuditInfo.UpdatedDateTime.ToString();

            if (toolTip != caption)
            {
                this.toolTip1.SetToolTip((Control)this.lstMembers, caption);
            }
        }
Exemple #4
0
 private string DisplayMemberValidationStatus(CustomMember cm)
 {
     return(cm == null || cm.mbr == null ? string.Empty : cm.mbr.ValidationStatus.ToString());
 }
Exemple #5
0
 private void BindMembners(bool hasDate)
 {
     try
     {
         List <CustomMember> oMembers = new List <CustomMember>();
         if (hasDate)
         {
             using (DataClasses1DataContext eDataBase = new DataClasses1DataContext())
             {
                 List <Member> eMembers = eDataBase.Members.Where(eMData => eMData.IsDeleted == false && eMData.RegisteredOn == Convert.ToDateTime(datepicker.Text)).ToList();
                 foreach (var eMember in eMembers)
                 {
                     CustomMember oMember = new CustomMember();
                     oMember.memberName       = eMember.Name;
                     oMember.phoneNumber      = eMember.PhoneNumber;
                     oMember.registrationFees = eMember.RegisterationFees.ToString();
                     oMember.admissionFees    = eMember.AdmissionFees.ToString();
                     oMember.email            = eMember.Email != null ? eMember.Email : "";
                     oMember.Id            = eMember.Id.ToString();
                     oMember.EncryptedId   = CommonMethods.EncryptString(eMember.Id.ToString());
                     oMember.address       = eMember.Address != null ? eMember.Address : "";
                     oMember.registeredOn  = eMember.RegisteredOn.ToLongDateString();
                     oMember.totalPackages = eMember.MemberPackages.Count.ToString();
                     oMember.profilePic    = eMember.ProfilePic != null ? eMember.ProfilePic : "https://cdn4.iconfinder.com/data/icons/small-n-flat/24/user-alt-512.png";
                     oMembers.Add(oMember);
                 }
                 Repeater1.DataSource = oMembers;
                 Repeater1.DataBind();
             }
         }
         else
         {
             using (DataClasses1DataContext eDataBase = new DataClasses1DataContext())
             {
                 List <Member> eMembers = eDataBase.Members.Where(eMData => eMData.IsDeleted == false).ToList();
                 foreach (var eMember in eMembers)
                 {
                     CustomMember oMember = new CustomMember();
                     oMember.memberName       = eMember.Name;
                     oMember.phoneNumber      = eMember.PhoneNumber;
                     oMember.registrationFees = eMember.RegisterationFees.ToString();
                     oMember.admissionFees    = eMember.AdmissionFees.ToString();
                     oMember.email            = eMember.Email != null ? eMember.Email : "";
                     oMember.Id            = eMember.Id.ToString();
                     oMember.EncryptedId   = CommonMethods.EncryptString(eMember.Id.ToString());
                     oMember.address       = eMember.Address != null ? eMember.Address : "";
                     oMember.registeredOn  = eMember.RegisteredOn.ToLongDateString();
                     oMember.totalPackages = eMember.MemberPackages.Count.ToString();
                     oMember.profilePic    = eMember.ProfilePic != null ? eMember.ProfilePic : "https://cdn4.iconfinder.com/data/icons/small-n-flat/24/user-alt-512.png";
                     oMembers.Add(oMember);
                 }
                 Repeater1.DataSource = oMembers;
                 Repeater1.DataBind();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox1.ShowError(ex.Message);
     }
 }