public ServiceTypeGroupConditionAddChangeForm()
 {
     this.m_serviceTypeGroup = ServiceTypeGroup.Null;
     this.m_serviceTypeGroupCondition = ServiceTypeGroupCondition.Null;
     this.m_serviceTypeGroups = new ObjectList<ServiceTypeGroup>();
     this.InitializeComponent();
     if (!Manager.DesignMode)
     {
         this.set_Font(Manager.WindowFont);
     }
 }
 public ServiceTypeNode(ServiceTypeGroup st)
     : base(st.GroupName)
 {
     base.set_Tag(st);
     base.Nodes.Add("");
 }
Esempio n. 3
0
 public ObjectList<Treatie> FindByProviderAndService(ServiceTypeGroup groupTypeId)
 {
     return Mappers.TreatieMapper.FindByProviderAndService(this, groupTypeId);
 }
 private void PushRight()
 {
     if (this.radioParentGroup.get_Checked())
     {
         foreach (System.Windows.Forms.DataGridViewRow row in this.dgvUndependedServiceTypes.SelectedRows)
         {
             ServiceType type = (ServiceType) row.get_DataBoundItem();
             ServiceType type2 = this.bsParentServiceTypes.get_Current() as ServiceType;
             FasetItem selectedFasetItem = this.cbTypeGroup.SelectedFasetItem;
             if ((type != null) && (type2 != null))
             {
                 new ServiceTypeGroup { ParentId = type2.Id, ChildId = type.Id, GroupTypeId = selectedFasetItem.Id }.SaveChanges();
             }
             else
             {
                 Messages.ShowMessage("Ошибка");
             }
         }
     }
     else if (this.radioExistingGroups.get_Checked())
     {
         foreach (System.Windows.Forms.DataGridViewRow row2 in this.dgvUndependedServiceTypes.SelectedRows)
         {
             ServiceType type3 = (ServiceType) row2.get_DataBoundItem();
             FasetItem item2 = this.cbTypeGroup.SelectedFasetItem;
             if (type3 != null)
             {
                 ServiceTypeGroup group2 = new ServiceTypeGroup {
                     ParentId = 0L,
                     ChildId = type3.Id,
                     GroupTypeId = item2.Id
                 };
                 string str = this.combGroupName.get_Text().Substring((int) (this.combGroupName.get_Text().IndexOf('.') + 1));
                 group2.Name = str;
                 int num = System.Convert.ToInt32(this.combGroupName.get_Text().Substring(0, this.combGroupName.get_Text().IndexOf('.')));
                 group2.Code = num;
                 group2.SaveChanges();
             }
             else
             {
                 Messages.ShowMessage("Ошибка");
             }
         }
     }
     else if ((this.maskGroupCode.get_Text() != "") & (this.textGroupName.get_Text() != ""))
     {
         if (!ServiceTypeGroup.FindAllCodesByGroupTypeID((long) this.m_GroupTypeId).Contains(System.Convert.ToInt64(this.maskGroupCode.get_Text())) && !ServiceType.FindAllCodes().Contains(System.Convert.ToInt64(this.maskGroupCode.get_Text())))
         {
             string str2 = this.maskGroupCode.get_Text() + "." + this.textGroupName.get_Text();
             foreach (System.Windows.Forms.DataGridViewRow row3 in this.dgvUndependedServiceTypes.SelectedRows)
             {
                 ServiceType type4 = (ServiceType) row3.get_DataBoundItem();
                 FasetItem item3 = this.cbTypeGroup.SelectedFasetItem;
                 if (type4 != null)
                 {
                     ServiceTypeGroup group3 = new ServiceTypeGroup {
                         ChildId = type4.Id,
                         GroupTypeId = item3.Id
                     };
                     string str3 = this.textGroupName.get_Text();
                     group3.Name = str3;
                     int num2 = System.Convert.ToInt32(this.maskGroupCode.get_Text());
                     group3.Code = num2;
                     group3.SaveChanges();
                 }
                 else
                 {
                     Messages.ShowMessage("Ошибка");
                 }
             }
             if (!this.combGroupName.Items.Contains(str2))
             {
                 this.combGroupName.Items.Add(str2);
             }
             this.combGroupName.set_SelectedItem(str2);
             this.btnChangeNameGroup.set_Enabled(true);
             this.radioExistingGroups.set_Checked(true);
         }
         else
         {
             Messages.ShowMessage("Данный код уже присутствует в базе, пожалуйста введите другой.");
         }
     }
     this.RefreshDependences();
 }