Пример #1
0
        protected void context_WorldChanged(object sender, EventArgs e)
        {
            if (context != null)
            {
                context.TakePersonMinMax.Year = context.TakeWorldDetail.Year;
                WorldDetailList list = new WorldDetailList(context.TakeWorldDetail.GetDetailList(), context);
                if (list != null)
                {
                    repWorld.Items.Clear();
                    foreach (WorldDetailElement var in list)
                    {
                        int          imageindex = 2;
                        StoreToWorld item       = context.TakeStoreWorld.GetWorld(var.StoreWorldId);
                        switch (item.WorldTypeID)
                        {
                        case WorldType.Administration: imageindex = 0; break;

                        case WorldType.CashDesk: imageindex = 1; break;

                        default: imageindex = 2; break;
                        }
                        repWorld.Items.Add(new DevExpress.XtraEditors.Controls.
                                           ImageComboBoxItem(var.WorldName, var.WorldName, imageindex));
                    }
                    int buffer = FocusedRowHandle;
                    context.TakeWorldDetail.CurrentDetailList = list;
                    gridControl.DataSource = list;
                    vGrid.DataSource       = list;
                    FocusedRowHandle       = buffer;
                }
            }
        }
Пример #2
0
 protected void context_WorldChanged(object sender, EventArgs e)
 {
     if (context != null)
     {
         context.TakePersonMinMax.Year = context.TakeWorldDetail.Year;
         WorldDetailList list = new WorldDetailList(context.TakeWorldDetail.GetDetailList(), context);
         if (list != null)
         {
             repWorld.Items.Clear();
             foreach (WorldDetailElement var in list)
         	{
                 int imageindex = 2;
                 StoreToWorld item = context.TakeStoreWorld.GetWorld(var.StoreWorldId);
                 switch (item.WorldTypeID)
                 {
                     case WorldType.Administration : imageindex = 0; break;
                     case WorldType.CashDesk : imageindex = 1; break;
                     default: imageindex = 2; break;
                 }
                 repWorld.Items.Add(new DevExpress.XtraEditors.Controls.
                      ImageComboBoxItem(var.WorldName, var.WorldName, imageindex));
             }
             int buffer = FocusedRowHandle;
             context.TakeWorldDetail.CurrentDetailList = list;
             gridControl.DataSource = list;
             vGrid.DataSource = list;
             FocusedRowHandle = buffer;
         }
     }
 }