Exemplo n.º 1
0
 void LoadTypeList()
 {
     foreach (var item in context.GetPartnerType())
     {
         PartnerTypeList.Add(new PartnerType(item));
     }
 }
Exemplo n.º 2
0
 public bool RemovePartnerType()
 {
     if (SelectedType != null && SelectedType.ID != 0 && context.GetPartner().Where(x => x.TypeId == SelectedType.ID).Count() == 0)
     {
         context.RemovePartnerType(SelectedType.ID);
         PartnerTypeList.Remove(SelectedType);
         return(true);
     }
     return(false);
 }
Exemplo n.º 3
0
        public bool SavePartnerType()
        {
            if (SelectedType.ValidateType() && SelectedType.ID == 0)
            {
                context.AddPartnerType(SelectedType.Name);
                IsEnabled = false;
                PartnerTypeList.Clear();
                LoadTypeList();
                return(true);
            }
            else if (SelectedType.ValidateType() && SelectedType.ID != 0)
            {
                context.UpdatePartnerType(SelectedType.ID, SelectedType.Name);
                IsEnabled = false;
                return(true);
            }

            return(false);
        }