Beispiel #1
0
        public override string ToString()
        {
            string address;

            if (_is_logical)
            {
                if (_group_type == GROUP_LEVEL_FORMAT.GROUP_2_LEVEL_FORMAT)
                {
                    address  = MainGroup.ToString();
                    address += "/";
                    address += SubGroup11.ToString();
                }
                else
                {
                    address  = MainGroup.ToString();
                    address += "/";
                    address += MiddleGroup.ToString();
                    address += "/";
                    address += SubGroup8.ToString();
                }
                return(address);
            }
            address  = Zone.ToString();
            address += ".";
            address += Line.ToString();
            address += ".";
            address += Device.ToString();
            return(address);
        }
Beispiel #2
0
            /// <summary>
            /// Devuelve la tabla de fuentes del documento RTF.
            /// </summary>
            /// <returns>Tabla de fuentes del documento RTF</returns>
            public RtfFontTable GetFontTable()
            {
                RtfFontTable tablaFuentes = new RtfFontTable();

                //Buscamos la tabla de fuentes en el árbol
                RtfTreeNode ntf = MainGroup.SelectSingleGroup("fonttbl"); //Nodo con la tabla de fuentes

                //Rellenamos el array de fuentes
                for (int j = 1; j < ntf.ChildNodes.Count; j++)
                {
                    RtfTreeNode fuente = ntf.ChildNodes[j];

                    int    indiceFuente = -1;
                    string nombreFuente = null;

                    foreach (RtfTreeNode nodo in fuente.ChildNodes)
                    {
                        if (nodo.NodeKey == "f")
                        {
                            indiceFuente = nodo.Parameter;
                        }

                        if (nodo.NodeType == RtfNodeType.Text)
                        {
                            nombreFuente = nodo.NodeKey.Substring(0, nodo.NodeKey.Length - 1);
                        }
                    }

                    tablaFuentes.AddFont(indiceFuente, nombreFuente);
                }

                return(tablaFuentes);
            }
        /// <summary>
        /// Method listing products and getting the maingroup afterwards
        /// </summary>
        private void GetProductGroups()
        {
            List <Product> listProducts = ProductMethods.ListProducts();

            MainGroup = listProducts.Select(x => x.ProductGroup.Substring(0, 2)).OrderBy(x => x).ToList();
            MainGroup = MainGroup.Distinct().ToList();
        }
        public async Task <IActionResult> EditMainGroup(ViewModels.PM.MainGroup.EditMainGroupViewModel editViewMainGroupModel)
        {
            ImageErrorModel imageErrorModel = new ImageErrorModel();
            string          ImagePath       = null;

            if (editViewMainGroupModel.DefaultImage == null)
            {
                ImagePath = editViewMainGroupModel.OldImage;
            }
            else
            {
                ImagePath = UploadImage(editViewMainGroupModel.DefaultImage, ref imageErrorModel);
            }
            if (ModelState.IsValid)
            {
                MainGroup objmaingroup = await this.MainGroupBLL.Find(editViewMainGroupModel.ID);

                objmaingroup.Description  = editViewMainGroupModel.Description;
                objmaingroup.Name         = editViewMainGroupModel.Name;
                objmaingroup.DefaultImage = ImagePath;
                objmaingroup.TypeSex      = editViewMainGroupModel.TypeSex;
                await MainGroupBLL.Update(objmaingroup);

                return(RedirectToAction("Index"));
            }
            return(RedirectToAction("Index"));
        }
Beispiel #5
0
        public void OpenDocument(string header, FrameworkElement control, bool isBinding)
        {
            if (control == null)
            {
                MessageBox.Show("No valid control to show as document window!"); return;
            }
            if (string.IsNullOrEmpty(header))
            {
                MessageBox.Show("No valid header to show as document window!"); return;
            }
            if (isBinding)
            {
                if (ActiveExist(control))
                {
                    return;
                }
                else
                {
                    for (int i = 0; i < MainGroup.Items.Count; i++)
                    {
                        var p = MainGroup.Items[i] as RadPane;
                        if (p.Header != null && p.Header.ToString() == header)
                        {
                            p.IsActive = true;
                            return;
                        }
                    }
                }
            }


            var pane = new RadPane()
            {
            };

            if (isBinding)
            {
                Binding binding = new Binding();
                binding.Path   = new PropertyPath(header);
                binding.Source = control.DataContext;
                BindingOperations.SetBinding(pane, RadPane.HeaderProperty, binding);
            }
            else
            {
                pane.Header = header;
            }
            pane.Content = control;
            MainGroup.AddItem(pane, Telerik.Windows.Controls.Docking.DockPosition.Center);
            pane.Unloaded += Pane_Unloaded;

            if (projectViewModel != null)
            {
                var vm = control.DataContext;
                if (vm is INotifiedViewModel)
                {
                    projectViewModel.OpenedViewModel.Add(vm as INotifiedViewModel);
                }
            }
        }
        public void OpenDocument(string header, FrameworkElement control)
        {
            if (control == null)
            {
                MessageBox.Show("No valid control to show as document window!");
            }
            var pane = new RadPane()
            {
                Header = header
            };

            pane.Content = control;
            MainGroup.AddItem(pane, Telerik.Windows.Controls.Docking.DockPosition.Center);
        }
Beispiel #7
0
            /// <summary>
            /// Extrae el texto de un árbol RTF.
            /// </summary>
            /// <returns>Texto plano del documento.</returns>
            private string ConvertToText()
            {
                StringBuilder res = new StringBuilder("");

                RtfTreeNode pardNode =
                    MainGroup.SelectSingleChildNode("pard");

                for (int i = pardNode.Index; i < MainGroup.ChildNodes.Count; i++)
                {
                    res.Append(MainGroup.ChildNodes[i].Text);
                }

                return(res.ToString());
            }
Beispiel #8
0
        private void MyShowDialog()
        {
            List <Model.T_WorkbayIPConfig> list = bll.FindT_WorkbayIPConfig().Where(m => m.IPAddress == bll.IPAddress).ToList();

            if (list.Count > 0)
            {
                switch (list[0].WorkbaySchemeID)
                {
                case "1":
                    Main m = new Main();
                    m.Owner = this;
                    this.Hide();
                    m.ShowDialog();
                    break;

                case "2":
                    MainGroup mg = new MainGroup();
                    mg.Owner = this;
                    this.Hide();
                    mg.ShowDialog();
                    break;

                case "3":
                    MainFCSKTV mfcsktv = new MainFCSKTV();
                    mfcsktv.Owner = this;
                    this.Hide();
                    mfcsktv.ShowDialog();
                    break;

                case "4":
                    MainGroupFC mfc = new MainGroupFC();
                    mfc.Owner = this;
                    this.Hide();
                    mfc.ShowDialog();
                    break;

                case "5":
                    MainRCRB mrcrb = new MainRCRB();
                    mrcrb.Owner = this;
                    this.Hide();
                    mrcrb.ShowDialog();
                    break;
                }
            }
            else
            {
                MessageBox.Show(bll.IPAddress + " 该IP地址未配置");
            }
        }
    protected void GetMainGroup()
    {
        List <string> dept = new List <string>
        {
            "UI",
            "美工组",
            "PHP",
            "JAVA",
            ".NET",
            "Android"
        };

        MainGroup.DataSource = dept;
        MainGroup.DataBind();
    }
        public async Task <IActionResult> EditMainGroup(string id)
        {
            //chưa xử lý code
            MainGroup objmaingroup = await this.MainGroupBLL.Find(id);

            ViewModels.PM.MainGroup.EditMainGroupViewModel editViewMainGroupModel = new ViewModels.PM.MainGroup.EditMainGroupViewModel
            {
                ID          = objmaingroup.ID,
                Name        = objmaingroup.Name,
                Description = objmaingroup.Description,
                TypeSex     = objmaingroup.TypeSex,
                OldImage    = objmaingroup.DefaultImage
            };
            return(View(editViewMainGroupModel));
        }
Beispiel #11
0
            /// <summary>
            /// Devuelve la tabla de colores del documento RTF.
            /// </summary>
            /// <returns>Tabla de colores del documento RTF</returns>
            public RtfColorTable GetColorTable()
            {
                RtfColorTable tablaColores = new RtfColorTable();

                //Buscamos la tabla de colores en el árbol
                RtfTreeNode ntc = MainGroup.SelectSingleGroup("colortbl"); //Nodo con la tabla de fuentes

                //Rellenamos el array de colores
                int rojo  = 0;
                int verde = 0;
                int azul  = 0;

                //Añadimos el color por defecto, en este caso el negro.
                //tabla.Add(Color.FromArgb(rojo,verde,azul));

                for (int j = 1; j < ntc.ChildNodes.Count; j++)
                {
                    RtfTreeNode nodo = ntc.ChildNodes[j];

                    if (nodo.NodeType == RtfNodeType.Text && nodo.NodeKey.Trim() == ";")
                    {
                        tablaColores.AddColor(Color.FromArgb(rojo, verde, azul));

                        rojo  = 0;
                        verde = 0;
                        azul  = 0;
                    }
                    else if (nodo.NodeType == RtfNodeType.Keyword)
                    {
                        switch (nodo.NodeKey)
                        {
                        case "red":
                            rojo = nodo.Parameter;
                            break;

                        case "green":
                            verde = nodo.Parameter;
                            break;

                        case "blue":
                            azul = nodo.Parameter;
                            break;
                        }
                    }
                }

                return(tablaColores);
            }
Beispiel #12
0
        public async Task <bool> Add(MainGroup MainGroup, string CreatedUser = "******")
        {
            try
            {
                MainGroup.CreatedUser = CreatedUser;
                this.unitOfWork.MainGroupRepository.Insert(MainGroup);
                await this.unitOfWork.SaveChangeAsync();

                return(true);
            }
            catch (Exception objEx)
            {
                await AddError(objEx);

                return(false);
            }
        }
Beispiel #13
0
        public async Task <bool> Update(MainGroup MainGroup, string UpdatedUser = "******")
        {
            try
            {
                MainGroup.EditedUser  = UpdatedUser;
                MainGroup.UrlFriendly = MainGroup.Name.UrlFriendLy();
                this.unitOfWork.MainGroupRepository.Update(MainGroup);
                await this.unitOfWork.SaveChangeAsync();

                return(true);
            }
            catch (Exception objEx)
            {
                await AddError(objEx);

                return(false);
            }
        }
Beispiel #14
0
            /// <summary>
            /// Devuelve la tabla de hojas de estilo del documento RTF.
            /// </summary>
            /// <returns>Tabla de hojas de estilo del documento RTF.</returns>
            public RtfStyleSheetTable GetStyleSheetTable()
            {
                RtfStyleSheetTable sstable = new RtfStyleSheetTable();

                RtfTreeNode sst = MainGroup.SelectSingleGroup("stylesheet");

                RtfNodeCollection styles = sst.ChildNodes;

                for (int i = 1; i < styles.Count; i++)
                {
                    RtfTreeNode style = styles[i];

                    RtfStyleSheet rtfss = ParseStyleSheet(style);

                    sstable.AddStyleSheet(rtfss.Index, rtfss);
                }

                return(sstable);
            }
Beispiel #15
0
            /// <summary>
            /// Obtiene el código del color pasado como parámetro, insertándolo en la tabla de colores si es necesario.
            /// </summary>
            /// <param name="colorDestTbl">Tabla de colores resultante.</param>
            /// <param name="iColorName">Color buscado.</param>
            /// <returns>
            /// Table index of requested color.
            /// Note: If color wasn't present in the table, this method will add it!!!
            /// </returns>
            public int GetColorID(RtfColorTable colorDestTbl, Color iColorName)
            {
                int iExistingColorID;

                if ((iExistingColorID = colorDestTbl.IndexOf(iColorName)) == -1)
                {
                    iExistingColorID = colorDestTbl.Count;
                    colorDestTbl.AddColor(iColorName);

                    RtfTreeNode colorTableGroupNode = MainGroup.SelectSingleGroup("colortbl");

                    colorTableGroupNode.AppendChild(new RtfTreeNode(RtfNodeType.Keyword, "red", true, iColorName.R));
                    colorTableGroupNode.AppendChild(new RtfTreeNode(RtfNodeType.Keyword, "green", true, iColorName.G));
                    colorTableGroupNode.AppendChild(new RtfTreeNode(RtfNodeType.Keyword, "blue", true, iColorName.B));
                    colorTableGroupNode.AppendChild(new RtfTreeNode(RtfNodeType.Text, ";", false, 0));
                }

                return(iExistingColorID);
            }
Beispiel #16
0
        public async Task <IActionResult> Index(int id)
        {
            Product product = await _IPS.GetProductByIdAsync(id);

            MainGroup mainGroup = await _IMGS.GetMainGroupByIdAsync(product.MainGroupID);

            ProductViewModel model = new ProductViewModel
            {
                ID          = product.ID,
                Count       = product.Count,
                Description = product.Description,
                Off         = product.Off,
                PictureUrl  = product.PictureUrl,
                ProductName = product.ProductName,
                Price       = product.Price,
                GroupId     = mainGroup.Id,
                GroupName   = mainGroup.GroupName
            };

            return(View(model));
        }
        public async Task <IActionResult> AddMainGroup(AddMainGroupViewModel addMainGroupViewModel)
        {
            if (ModelState.IsValid)
            {
                ImageErrorModel imageErrorModel = new ImageErrorModel();
                string          ImagePath       = UploadImage(addMainGroupViewModel.DefaultImage, ref imageErrorModel);
                if (imageErrorModel.isSuccess)
                {
                    MainGroup mainGroup = new MainGroup()
                    {
                        Name         = addMainGroupViewModel.Name,
                        DefaultImage = ImagePath,
                        Description  = addMainGroupViewModel.Description,
                        TypeSex      = addMainGroupViewModel.TypeSex,
                    };
                    await MainGroupBLL.Add(mainGroup);

                    return(RedirectToAction("Index"));
                }
            }

            return(View());
        }
 private void SetProductGroup()
 {
     SelectedProductGroup = MainGroup.FindIndex(productGroup => productGroup == AgreementToEdit.ProductGroup);
 }
Beispiel #19
0
        private void ReadAnnotation(XElement annotationElem)
        {
            var    annotationAttr = annotationElem.FirstAttribute;
            string annotationName = annotationAttr.Name.LocalName;
            string value          = annotationAttr.Value;

            switch (annotationName)
            {
            case "aliases":
                var aliases = value.Split(';');
                for (int i = 0; i < aliases.Length; i++)
                {
                    if (int.TryParse(aliases[i], out int aliasID))
                    {
                        Aliases.Add(aliasID);
                    }
                }
                break;

            case "designname":
                Name = value;
                break;

            case "version":
                PartVersion = int.Parse(value);
                break;

            case "maingroupid":
                if (MainGroup == null)
                {
                    MainGroup = new MainGroup();
                }
                MainGroup.ID = int.Parse(value);
                break;

            case "maingroupname":
                if (MainGroup == null)
                {
                    MainGroup = new MainGroup();
                }
                MainGroup.Name = value;
                break;

            case "platformid":
                if (Platform == null)
                {
                    Platform = new Platform();
                }
                Platform.ID = int.Parse(value);
                break;

            case "platformname":
                if (Platform == null)
                {
                    Platform = new Platform();
                }
                Platform.Name = value;
                break;

            default:
                ExtraAnnotations.Add(annotationName, value);
                break;
            }
        }
Beispiel #20
0
 private void GetProductGroups()
 {
     MainGroup = ListProducts.Select(x => x.ProductGroup.Substring(0, 2)).OrderBy(x => x).ToList();
     MainGroup = MainGroup.Distinct().ToList();
 }
Beispiel #21
0
        public bool Init(String name, Stream stream)
        {
            Durable.InitSettings(Board.TimeSettings);

            String text = new StreamReader(stream).ReadToEnd();

            ChromeTrace trace = JsonConvert.DeserializeObject <ChromeTrace>(text);

            Dictionary <ulong, List <TraceEvent> > threads = new Dictionary <ulong, List <TraceEvent> >();

            foreach (TraceEvent ev in trace.traceEvents)
            {
                // Complete Event
                if (ev.ph == "X")
                {
                    List <TraceEvent> events = null;
                    if (!threads.TryGetValue(ev.tid, out events))
                    {
                        events = new List <TraceEvent>();
                        threads.Add(ev.tid, events);
                    }
                    events.Add(ev);
                }
            }

            Durable range = new Durable(long.MaxValue, long.MinValue);

            Dictionary <string, EventDescription> descriptions = new Dictionary <string, EventDescription>();

            foreach (KeyValuePair <ulong, List <TraceEvent> > pair in threads)
            {
                ulong             tid    = pair.Key;
                List <TraceEvent> events = pair.Value;

                List <Entry> entries = new List <Entry>(events.Count);
                List <Tag>   tags    = new List <Tag>(events.Count);

                foreach (TraceEvent ev in events)
                {
                    String args = ev.args != null?ev.args.ToString().Replace("\n", "").Replace("\r", "") : null;

                    String context   = GenerateShortContext(args);
                    String extraName = GenerateShortName(context);

                    String fullName = ev.name;
                    if (!String.IsNullOrWhiteSpace(extraName))
                    {
                        fullName = String.Format("{0} - {1}", ev.name, extraName);
                    }

                    EventDescription desc = null;
                    if (!descriptions.TryGetValue(fullName, out desc))
                    {
                        desc = new EventDescription(fullName)
                        {
                            Color = EventDescription.GenerateRandomColor(ev.name, RandomColorBrightnessVariance)
                        };
                        descriptions.Add(fullName, desc);
                    }

                    entries.Add(new Entry(desc, (long)ev.ts, (long)(ev.ts + ev.dur)));

                    if (!String.IsNullOrWhiteSpace(context))
                    {
                        tags.Add(new Tag()
                        {
                            Description = new EventDescription(context), Time = new Tick()
                            {
                                Start = (long)ev.ts
                            }
                        });
                    }
                }

                entries.Sort();
                tags.Sort();

                ThreadData threadData = MainGroup.AddThread(new ThreadDescription()
                {
                    Name = String.Format("Thread #{0}", tid), ThreadID = tid, ProcessID = 0, Origin = ThreadDescription.Source.Game
                });
                threadData.TagsPack = new TagsPack(tags);

                EventFrame frame = new EventFrame(new FrameHeader(new Durable(entries.Min(e => e.Start), entries.Max(e => e.Finish)), threadData.Description.ThreadIndex), entries, MainGroup);
                entries.ForEach(e => e.Frame = frame);

                range.Start  = Math.Min(range.Start, frame.Start);
                range.Finish = Math.Max(range.Finish, frame.Finish);

                threadData.Events.Add(frame);
            }

            Board.TimeSlice       = range;
            Board.MainThreadIndex = 0;
            MainFrame             = new EventFrame(new FrameHeader(Board.TimeSlice), new List <Entry> {
            }, MainGroup);

            return(true);
        }
Beispiel #22
0
        private void MyShowDialog()
        {
            zkfp2.Terminate();
            cbRegTmp = 0;
            if (captureThread != null)
            {
                captureThread.Abort();
            }
            Global.GlobalFieid.IsLogin = true;
            if (Global.GlobalFieid.LoginType == "1")
            {
                Global.GlobalFieid.LoginRecordID = Guid.NewGuid().ToString();
                T_LoginRecord_Bll.Add(Global.GlobalFieid.LoginRecordID, bll.WorkbayName, Global.GlobalFieid.StaffID);
                Global.GlobalFieid.IsLogOut = false;
                if (Global.GlobalFieid.MyControl.Name == "MainGroup")
                {
                    Mes.MainGroup Main = new MainGroup();
                    Main = (MainGroup)this.Owner;
                    Main.SetStaff();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupFC")
                {
                    Mes.MainGroupFC Main = new MainGroupFC();
                    Main = (MainGroupFC)this.Owner;
                    Main.SetStaff();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "Main")
                {
                    Mes.Main Main = new Main();
                    Main = (Main)this.Owner;
                    Main.SetStaff();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainFCSKTV")
                {
                    Mes.MainFCSKTV Main = new MainFCSKTV();
                    Main = (MainFCSKTV)this.Owner;
                    Main.SetStaff();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainRCRB")
                {
                    Mes.MainRCRB Main = new MainRCRB();
                    Main = (MainRCRB)this.Owner;
                    Main.SetStaff();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupRCRB")
                {
                    Mes.MainGroupRCRB Main = new MainGroupRCRB();
                    Main = (MainGroupRCRB)this.Owner;
                    Main.SetStaff();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupM")
                {
                    Mes.MainGroupM Main = new MainGroupM();
                    Main = (MainGroupM)this.Owner;
                    Main.SetStaff();
                    this.Dispose();
                }
            }
            if (Global.GlobalFieid.LoginType == "2")
            {
                if (Global.GlobalFieid.MyControl.Name == "MainGroup")
                {
                    Mes.MainGroup Main = new MainGroup();
                    Main = (MainGroup)this.Owner;
                    Main.Rework();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupFC")
                {
                    MainGroupFC Main;
                    Main = (MainGroupFC)this.Owner;
                    Main.Rework();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "Main")
                {
                    Main Main;
                    Main = (Main)this.Owner;
                    Main.Rework();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainFCSKTV")
                {
                    MainFCSKTV Main;
                    Main = (MainFCSKTV)this.Owner;
                    Main.Rework();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainRCRB")
                {
                    MainRCRB Main;
                    Main = (MainRCRB)this.Owner;
                    Main.Rework();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupRCRB")
                {
                    MainGroupRCRB Main;
                    Main = (MainGroupRCRB)this.Owner;
                    Main.Rework();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupM")
                {
                    MainGroupM Main;
                    Main = (MainGroupM)this.Owner;
                    Main.Rework();
                    this.Dispose();
                }
            }

            if (Global.GlobalFieid.LoginType == "3")
            {
                IsProduction = false;
                IsCraft      = false;
                IsQuailty    = false;
                if (Global.GlobalFieid.MyControl.Name == "MainGroup")
                {
                    MainGroup Main;
                    Main = (MainGroup)this.Owner;
                    Main.Bypass();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupFC")
                {
                    MainGroupFC Main;
                    Main = (MainGroupFC)this.Owner;
                    Main.Bypass();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "Main")
                {
                    Main Main;
                    Main = (Main)this.Owner;
                    Main.Bypass();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainFCSKTV")
                {
                    MainFCSKTV Main;
                    Main = (MainFCSKTV)this.Owner;
                    Main.Bypass();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainRCRB")
                {
                    MainRCRB Main;
                    Main = (MainRCRB)this.Owner;
                    Main.Bypass();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupRCRB")
                {
                    MainGroupRCRB Main;
                    Main = (MainGroupRCRB)this.Owner;
                    Main.Bypass();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupM")
                {
                    MainGroupM Main;
                    Main = (MainGroupM)this.Owner;
                    Main.Bypass();
                    this.Dispose();
                }
            }

            if (Global.GlobalFieid.LoginType == "4")
            {
                IsProduction = false;
                IsCraft      = false;
                IsQuailty    = false;
                if (Global.GlobalFieid.MyControl.Name == "MainGroup")
                {
                    MainGroup Main;
                    Main = (MainGroup)this.Owner;
                    Main.TPS_Stop();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainRCRB")
                {
                    MainRCRB Main;
                    Main = (MainRCRB)this.Owner;
                    Main.TPS_Stop();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupRCRB")
                {
                    MainGroupRCRB Main;
                    Main = (MainGroupRCRB)this.Owner;
                    Main.TPS_Stop();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "Main")
                {
                    Main Main;
                    Main = (Main)this.Owner;
                    Main.TPS_Stop();
                    this.Dispose();
                }
                //else if (Global.GlobalFieid.MyControl.Name == "MainGroupFC")
                //{
                //    MainGroupFC Main;
                //    Main = (MainGroupFC)this.Owner;
                //    Main.Bypass();
                //    this.Dispose();
                //}
                //else if (Global.GlobalFieid.MyControl.Name == "MainGroupM")
                //{
                //    MainGroupM Main;
                //    Main = (MainGroupM)this.Owner;
                //    Main.Bypass();
                //    this.Dispose();
                //}

                //else if (Global.GlobalFieid.MyControl.Name == "MainFCSKTV")
                //{
                //    MainFCSKTV Main;
                //    Main = (MainFCSKTV)this.Owner;
                //    Main.Bypass();
                //    this.Dispose();
                //}
            }
            if (Global.GlobalFieid.LoginType == "5")
            {
                IsProduction = false;
                IsCraft      = false;
                IsQuailty    = false;
                if (Global.GlobalFieid.MyControl.Name == "MainGroup")
                {
                    MainGroup Main;
                    Main = (MainGroup)this.Owner;
                    Main.TPS_Start();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainRCRB")
                {
                    MainRCRB Main;
                    Main = (MainRCRB)this.Owner;
                    Main.TPS_Start();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupRCRB")
                {
                    MainGroupRCRB Main;
                    Main = (MainGroupRCRB)this.Owner;
                    Main.TPS_Start();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "Main")
                {
                    Main Main;
                    Main = (Main)this.Owner;
                    Main.TPS_Start();
                    this.Dispose();
                }
                //else if (Global.GlobalFieid.MyControl.Name == "MainGroupFC")
                //{
                //    MainGroupFC Main;
                //    Main = (MainGroupFC)this.Owner;
                //    Main.Bypass();
                //    this.Dispose();
                //}
                //else if (Global.GlobalFieid.MyControl.Name == "Main")
                //{
                //    Main Main;
                //    Main = (Main)this.Owner;
                //    Main.Bypass();
                //    this.Dispose();
                //}
                //else if (Global.GlobalFieid.MyControl.Name == "MainFCSKTV")
                //{
                //    MainFCSKTV Main;
                //    Main = (MainFCSKTV)this.Owner;
                //    Main.Bypass();
                //    this.Dispose();
                //}
            }
        }
Beispiel #23
0
 public override string ToString()
 {
     return(MainGroup.ToString() + "/" + MiddleGroup.ToString() + "/" + SubGroup.ToString());
 }
Beispiel #24
0
        private void LoadFromXml(XDocument document)
        {
            var rootElem = document.Root;

            if (rootElem.Name != "LXFML")
            {
                throw new InvalidDataException();
            }
            rootElem.TryGetIntAttribute("versionMajor", out int vMaj);
            rootElem.TryGetIntAttribute("versionMinor", out int vMin);
            FileVersion = new VersionInfo(vMaj, vMin);

            if (rootElem.HasElement("Meta", out XElement metaElem))
            {
                foreach (var annotationElem in metaElem.Elements("Annotation"))
                {
                    var    annotationAttr = annotationElem.FirstAttribute;
                    string annotationName = annotationAttr.Name.LocalName;
                    string value          = annotationAttr.Value;
                    //bool handled = true;

                    switch (annotationName)
                    {
                    case "aliases":
                        var aliases = value.Split(';');
                        for (int i = 0; i < aliases.Length; i++)
                        {
                            if (int.TryParse(aliases[i], out int aliasID))
                            {
                                Aliases.Add(aliasID);
                            }
                        }
                        break;

                    case "designname":
                        Name = value;
                        break;

                    case "maingroupid":
                        if (MainGroup == null)
                        {
                            MainGroup = new MainGroup();
                        }
                        MainGroup.ID = int.Parse(value);
                        break;

                    case "maingroupname":
                        if (MainGroup == null)
                        {
                            MainGroup = new MainGroup();
                        }
                        MainGroup.Name = value;
                        break;

                    case "platformid":
                        if (Platform == null)
                        {
                            Platform = new Platform();
                        }
                        Platform.ID = int.Parse(value);
                        break;

                    case "platformname":
                        if (Platform == null)
                        {
                            Platform = new Platform();
                        }
                        Platform.Name = value;
                        break;
                        //default:
                        //    handled = false;
                        //    break;
                    }

                    //if (!handled)
                    //    ExtraAnnotations.Add(annotationName, value);
                }
            }

            Bricks.Clear();
            if (rootElem.HasElement("Bricks", out XElement bricksElem))
            {
                foreach (var brickElem in bricksElem.Elements("Brick"))
                {
                    var brick = new Brick();
                    brick.LoadFromXml(brickElem);
                    Bricks.Add(brick);
                }
            }

            if (document.Root.HasAttribute("name"))
            {
                ID = document.Root.ReadAttribute("name", 0);
            }

            if (ID == 0 && Aliases.Any())
            {
                ID = Aliases.First();
            }
        }
Beispiel #25
0
 public AddMainGroupVM()
 {
     addedMainGroup = new MainGroup();
     addedHardware  = new Hardware();
 }
Beispiel #26
0
        protected override void Seed(PaySysContext context)
        {
            #region Debug
//			if( Debugger.IsAttached == false )
//				Debugger.Launch();
            #endregion


            #region Static Arrays
            PaySysSetting.CurrentYear  = 1397;
            PaySysSetting.CurrentMonth = 007;

            var alphabets = new[]
            {
                "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U",
                "V", "W", "X", "Y", "Z"
            };

            var contractFields = new List <Tuple <int, bool, string, string, string> >
            {
                Tuple.Create(01, false, alphabets[0], "CA01", "حقـــوق"),
                Tuple.Create(02, true, alphabets[0], "CA02", "فوق العاده شغل"),
                Tuple.Create(03, true, alphabets[0], "CA03", "تسهیلات زندگی"),
                Tuple.Create(04, true, alphabets[0], "CA04", "فوق العاده تعدیل"),
                Tuple.Create(05, true, alphabets[0], "CA05", "عائله مندی"),
                Tuple.Create(06, true, alphabets[0], "CA06", "حق اولاد"),
                Tuple.Create(07, true, alphabets[0], "CA07", "فوق العاده ویژه"),
                Tuple.Create(08, true, alphabets[0], "CA08", "سایر:جذب2"),
                Tuple.Create(09, true, alphabets[0], "CA09", "فوق العاده جذب"),
                Tuple.Create(10, true, alphabets[0], "CA10", "جیره غیر نقدی"),
                Tuple.Create(11, true, alphabets[0], "CA11", "تفاوت گروه ت ش"),
                Tuple.Create(12, true, alphabets[0], "CA12", "سختی کار"),
                Tuple.Create(13, true, alphabets[0], "CA13", "تفاوت حداقل"),
                Tuple.Create(14, true, alphabets[0], "CA14", "حق مسکن"),
                Tuple.Create(15, true, alphabets[0], "CA15", "کارانه"),
                Tuple.Create(16, true, alphabets[0], "CA16", "فوق العاده تلاش"),
                Tuple.Create(17, true, alphabets[0], "CA17", "نوبت کاری"),
                Tuple.Create(18, true, alphabets[0], "CA18", "فوق العاده ذیحسابی"),
                Tuple.Create(19, true, alphabets[0], "CA19", "کارشناسی ارشد"),
                Tuple.Create(20, true, alphabets[0], "CA20", "برجستگی"),
                Tuple.Create(21, true, alphabets[0], "CA21", "گروه تشویقی"),
                Tuple.Create(22, true, alphabets[0], "CA22", "تفاوت ضریب تعدیل"),
                Tuple.Create(23, true, alphabets[0], "CA23", "تاریخ مازاد سی سال خدمت"),
                Tuple.Create(01, false, alphabets[1], "CB01", "حقـــوق"),
                Tuple.Create(02, true, alphabets[1], "CB02", "عائله مندی"),
                Tuple.Create(03, true, alphabets[1], "CB03", "حق اولاد"),
                Tuple.Create(01, false, alphabets[2], "CC01", "حقـــوق"),
                Tuple.Create(02, true, alphabets[2], "CC02", "سنوات خدمت"),
                Tuple.Create(03, true, alphabets[2], "CC03", "فوق العاده تعدیل"),
                Tuple.Create(04, true, alphabets[2], "CC04", "جیره غیر نقدی"),
                Tuple.Create(05, true, alphabets[2], "CC05", "حق اولاد"),
                Tuple.Create(06, true, alphabets[2], "CC06", "تفاوت ضریب تعدیل"),
                Tuple.Create(07, true, alphabets[2], "CC07", "حق مسکن"),
                Tuple.Create(08, true, alphabets[2], "CC08", "هزینه شب کاری"),
                Tuple.Create(09, true, alphabets[2], "CC09", "فوق العاده شغل"),
                Tuple.Create(10, true, alphabets[2], "CC10", "تسهیلات زندگی"),
                Tuple.Create(11, true, alphabets[2], "CC11", "حداقل حقوق"),
                Tuple.Create(12, true, alphabets[2], "CC12", "حق عائله مندی"),
                Tuple.Create(13, true, alphabets[2], "CC13", "نوبت کاری"),
                Tuple.Create(14, true, alphabets[2], "CC14", "سختی کار"),
                Tuple.Create(15, true, alphabets[2], "CC15", "فوق العاده جذب"),
                Tuple.Create(16, true, alphabets[2], "CC16", "فوق العاده 20%"),
                Tuple.Create(17, true, alphabets[2], "CC17", "کارانه"),
                Tuple.Create(18, true, alphabets[2], "CC18", "بن کارگری"),
                Tuple.Create(19, true, alphabets[2], "CC19", "حمایت قضایی"),
                Tuple.Create(20, true, alphabets[2], "CC20", "کارشناسی ارشد"),
                Tuple.Create(21, true, alphabets[2], "CC21", "فوق العاده تشویق"),
                Tuple.Create(22, true, alphabets[2], "CC22", "ایثارگری"),
                Tuple.Create(01, false, alphabets[3], "CD01", "حقـــوق"),
                Tuple.Create(01, false, alphabets[4], "CE01", "حقـــوق"),
            };

            var variables = new List <Tuple <int, string, string> >
            {
                Tuple.Create(01, "V01", "بیمه تکمیلی سهم کارفرما"),
                Tuple.Create(02, "V02", "بیمه تکمیلی سهم پرسنل"),
                Tuple.Create(03, "V03", "تعداد بیمه درمانی تبعی 1"),
                Tuple.Create(04, "V04", "تعداد بیمه درمانی تبعی 2"),
                Tuple.Create(05, "V05", "تعداد بیمه درمانی تبعی 3"),
                Tuple.Create(06, "V06", "شماره حساب بانکی"),
                Tuple.Create(07, "V07", "شماره حساب پس انداز سهم کارفرما"),
                Tuple.Create(08, "V08", "شماره حساب پس انداز سهم پرسنل"),
                Tuple.Create(09, "V09", "کارکرد ماهانه"),
                Tuple.Create(10, "V10", "ساعات اضافه کار"),
                Tuple.Create(11, "V11", "روزهای تعطیل کاری"),
                Tuple.Create(12, "V12", "مساعده اضافه کار"),
                Tuple.Create(13, "V13", "بدهی بازنشستگی"),
                Tuple.Create(14, "V14", "بدهی مقرری ماه اول"),
                Tuple.Create(15, "V15", "بیمه عمر سهم پرسنل"),
            };

            var miscTitlesPayment = new[]
            {
                "پاداش", "عیدی", "حق الزحمه", "تشویقی", "مساعده", "حق العمل", "حسن انجام کار", "هزینه تحصیل", "بورسیه"
            };
            var miscTitlesDebt = new[]
            {
                "جریمه", "توبیخی", "بدهی قبلی", "وام مسکن", "وام ضروری", "کسر کار", "اضافه مرخصی", "خسارت اموال",
                "هزینه های متفرقه"
            };
            var expenseArticleTitles = new[] { "X X X", "X X X", "X X X" };
            var parameterTitles      = new Dictionary <string, string>
            {
                { "P01", "بیمه عمر کارفرما" },
                { "P02", "پس انداز سهم کارفرما" },
                { "P03", "بیمه درمانی تبعی 3" },
                { "P04", "بیمه درمانی تبعی 2" },
                { "P05", "بیمه تبعی 1 سهم کارفرما" },
                { "P06", "بیمه تبعی 1 سهم پرسنل" },
                { "P07", "سقف حقوق مشمول بیمه" },
                { "P08", "تقسیم اضافه کار عادی" },
                { "P09", "تقسیم اضافه کار تعطیل" },
                { "P10", "نرخ مالیات متفرقه" },
                { "P11", "نرخ بازنشستگی کارفرما" },
                { "P12", "نرخ بازنشستگی پرسنل" },
                { "P13", "ساعات کار هفتگی" },
                { "P14", "ضریب اضافه کار و تعطیل" },
                { "P16", "نرخ بیمه سهم کارفرما" },
                { "P17", "نرخ بیمه سهم پرسنل" },
                { "P18", "نرخ بیمه بیکاری" },
                { "P19", "نرخ بیمه کارهای سخت" },
                { "P20", "حداقل مزد سال جاری" },
            };
            var mainGroupParameters = new List <Tuple <string, string> >
            {
                Tuple.Create(alphabets[0], "P01"),
                Tuple.Create(alphabets[0], "P02"),
                Tuple.Create(alphabets[0], "P03"),
                Tuple.Create(alphabets[0], "P04"),
                Tuple.Create(alphabets[0], "P05"),
                Tuple.Create(alphabets[0], "P06"),
                Tuple.Create(alphabets[0], "P07"),
                Tuple.Create(alphabets[0], "P08"),
                Tuple.Create(alphabets[0], "P09"),
                Tuple.Create(alphabets[0], "P10"),
                Tuple.Create(alphabets[0], "P11"),
                Tuple.Create(alphabets[0], "P12"),
                Tuple.Create(alphabets[2], "P01"),
                Tuple.Create(alphabets[2], "P02"),
                Tuple.Create(alphabets[2], "P13"),
                Tuple.Create(alphabets[2], "P14"),
                Tuple.Create(alphabets[2], "P10"),
                Tuple.Create(alphabets[2], "P16"),
                Tuple.Create(alphabets[2], "P17"),
                Tuple.Create(alphabets[2], "P18"),
                Tuple.Create(alphabets[2], "P19"),
                Tuple.Create(alphabets[2], "P20"),
                Tuple.Create(alphabets[3], "P01"),
                Tuple.Create(alphabets[3], "P02"),
                Tuple.Create(alphabets[3], "P13"),
                Tuple.Create(alphabets[3], "P14"),
                Tuple.Create(alphabets[3], "P10"),
                Tuple.Create(alphabets[3], "P16"),
                Tuple.Create(alphabets[3], "P17"),
                Tuple.Create(alphabets[3], "P18"),
                Tuple.Create(alphabets[3], "P19"),
                Tuple.Create(alphabets[3], "P20"),
                Tuple.Create(alphabets[4], "P01"),
                Tuple.Create(alphabets[4], "P02"),
                Tuple.Create(alphabets[4], "P13"),
                Tuple.Create(alphabets[4], "P14"),
                Tuple.Create(alphabets[4], "P10"),
                Tuple.Create(alphabets[4], "P16"),
                Tuple.Create(alphabets[4], "P17"),
                Tuple.Create(alphabets[4], "P18"),
                Tuple.Create(alphabets[4], "P19"),
                Tuple.Create(alphabets[4], "P20"),
            };

            var mobilePrefix = new[]
            {
                "0912", "0935", "0919", "0933", "0918"
            };
            var creditCardNoPrefix = new[]
            {
                "627353", "610433", "621986", "621986", "502229", "622106", "627412", "603770", "603770", "627648",
                "603799"
            };
            var cityNames = new[]
            {
                "آبش‌احمد", "آچاچی", "آذرشهر", "آقکند", "اسکو", "اهر", "ایلخچی", "باسمنج", "بخشایش", "بستان‌آباد",
                "بناب", "بناب مرند", "تبریز", "ترک", "تیمورلو (آذرشهر)", "ترکمانچای", "تسوج", "تیکمه‌داش", "جلفا",
                "جوان‌قلعه", "خاروانا", "خامنه", "خداجو", "خسروشاه", "خمارلو", "خواجه", "دوزدوزان", "زرنق", "زنوز",
                "سراب", "سردرود", "سهند", "سیس", "سیه‌رود", "شبستر", "شربیان", "شرفخانه", "شندآباد", "صوفیان",
                "عجب‌شیر", "قره‌آغاج (چاراویماق)", "کشکسرای", "کلوانق", "کلیبر", "کوزه‌کنان", "گوگان", "لیلان",
                "مبارک‌شهر", "مراغه", "مرند", "ملکان", "ممقان", "مهربان", "میانه", "نظرکهریزی", "وایقان", "ورزقان",
                "هادیشهر", "هریس", "هشترود", "هوراند", "یامچی کهنمو "
            };
            var jobTitleAndDescriptions = new Dictionary <string, string>
            {
                { "مهندس برق", "مهندسی برق یکی از مشاغل مهم و کلیدی صنعت برق و مخابرات به شمار می رود." },
                {
                    "مهندس معماری",
                    "اگر از طراحی لذت برده و عاشق ساخت و ساز هم هستید، شغل مهندسی معماری می تواند برای شما ایده آل باشد."
                },
                {
                    "مهندس شیمی",
                    "مهندس شیمی فردی است که یافته های شیمیدان ها را به صورت عملی و کاربردی درآورده و در صنایع مختلف آنها را بکار می گیرد. در واقع مهندسی شیمی، فرآیند بکارگیری علم شیمی است."
                },
                {
                    "مهندس سخت افزار",
                    "مهندس سخت افزار کامپیوتر به تحقیق، طراحی، توسعه، تعمیر و آزمایش تجهیزات کامپیوتر مانند چیپ ها، صفحه مدارها، مونیتورها یا روترها می پردازد."
                },
                {
                    "مهندس هوا فضا",
                    "اگر شما عاشق هواپیما و فضاپیماها بوده و می خواهید برای پیشرفت و توسعه آنها کاری بکنید، شغل مهندسی هوافضا می تواند برای شما مناسب باشد."
                },
                {
                    "مهندس دریا",
                    "به دلیل داشتن مرزهای آبی گسترده و اهمیت بسیار زیاد حمل و نقل آبی در رشد و توسعه کشور، تخصص ها و مشاغل زیادی در حوزه دریایی ایجاد شده است. مهندسی دریا یکی از اصلی ترین آنها می باشد. مهندسی دریا چندین تخصص را در بر می گیرد که هر کدام حیطه وظایف مجزایی دارند."
                },
                {
                    "مهندس کشاورزی",
                    "مهندس کشاورزی فعالیت های مختلفی را انجام می دهد. او به توسعه استفاده از ماشین آلات کشاورزی و پیاده سازی فرآیندهای صحیح و علمی کشاورزی، باغبانی و جنگلداری می پردازد. مهندس کشاورزی باید دارای دانش و مهارت کافی برای کار کردن در صنایع مختلف کشاورزی و یا بخش بازرگانی و تجارت محصولات کشاورزی باشد."
                },
                {
                    "مهندس بهداشت حرفه ای",
                    "بهداشت حرفه‌ای یا سلامت شغلی یا سلامت کار شاخه‌ای است ازعلم بهداشت وعبارتست از شناسائی، ارزیابی و کنترل عوامل زیان آور موجود در محیط کار به همراه یکسری مراقبت های بهداشتی درمانی به منظور سالم سازی محیط کار و حفظ سلامت نیروی کار. بهداشت حرفه‌ای ترکیبی از علوم پزشکی ومهندسی می‌باشد."
                },
                {
                    "مهندس عمران",
                    "به عنوان مهندس عمران، شما به طراحی و مدیریت انواع پروژه های ساختمانی از تعمیر پل گرفته تا ساخت یک استادیوم ورزشی جدید می پردازید. برای مهندسی عمران باید در ریاضیات و مهارت های فناوری اطلاعات, عالی باشید. همچنین باید بتوانید به خوبی طرح ها و ایده های خود را برای دیگران بیان کرده و در نتیجه باید مهارت های ارتباطی بسیار خوبی داشته باشید. برای دست یابی به شغل مهندسی عمران باید مدارک معتبر دانشگاهی کسب نمایید."
                },
                {
                    "مهندس صنایع",
                    "در بازار رقابتی امروز، شرکت ها و سازمان ها برای بقا و رسیدن به اهداف خود باید از منابع موجود خود اعم از مالی و غیرمالی به صورت بهینه استفاده کنند تا هزینه های خود را به حداقل برسانند. علاوه بر این موارد تلاش در جهت افزایش کیفیت محصولات و خدمات در کنار بکارگیری نوآوری های مختلف، در موفقیت آنها بسیار موثر است. مهندسی صنایع ابزاری اساسی و موثر است که به مدیران و صاحبان شرکت ها و سازمان ها در انجام موارد فوق یاری می رساند."
                },
                {
                    "مهندس نفت",
                    "مهندس نفت روش های استخراج نفت و گاز از زیر زمین را طراحی کرده و توسعه می دهد.محل کار مهندس نفت در دفاتر کاری، پالایشگاه ها، محل های حفاری و یا آزمایشگاه های تحقیقاتی می باشد."
                },
                {
                    "مهندس رباتیک",
                    "مهندس رباتیک فردی است که پاسخگوی  نیاز صنعت در تحقیق و توسعه، طراحی، تولید، نگهداری و تعمیرات ربات ها می باشد."
                },
                {
                    "مهندس معدن",
                    "مهندسی معدن مجموعه علوم، روش ها و فنونی است که از اکتشاف یک معدن آغاز و تا فرآوری آن ادامه دارد. البته معدن باید از نظر اقتصادی ارزش و صرفه کافی را داشته باشد تا بتوان کار اکتشاف و استخراج (که فرآیندهایی پرهزینه هستند) را در آن انجام داد. از آنجا که از سالیان بسیار قبل، انسان ها به دنبال کشف طلا و برخی از مواد معدنی ارزشمند بوده اند، شغل مهندسی معدن دارای قدمت زیادی است."
                },
                {
                    "مهندسی پزشکی",
                    "مهندسی پزشکی کاربرد علوم مهندسی در حوزه پزشکی برای تشخیص و درمان بیماری ها است. حوزه مهندسی پزشکی به دنبال برطرف کردن نیازهای پزشکی در زمینه طراحی، ساخت و نگهداری تجهیزات و ابزارهای پزشکی برای کاربردهای پیشگیری، تشخیص و درمان بیماریها به کمک علوم مهندسی است."
                },
                {
                    "مهندس بهداشت محیط",
                    "مهندسی بهداشت محیط -بهداشت محیط کنترل همه عواملی است که اثر سویی بر پایدار ماندن سلامت انسان می‌گذارند. این شامل بیماری‌های زیادی می‌شود که از طریق آب، هوا، مواد غذایی و بسیاری از عوامل محیطی دیگر سلامت انسان را تهدید می‌کنند. برای رسیدن به این هدف، بهره‌گیری اصول مهندسی و دانش زیست‌محیطی به منظور کنترل، اصلاح و بهبود عوامل فیزیکی، شیمیایی و بیولوژیک محیط جهت حفظ و ارتقاء سلامتی و رفاه و آسایش انسان ضرورت می‌یابد."
                },
                {
                    "مهندس راه آهن",
                    "حمل و نقل یکی از عوامل اصلی و تعیین کننده در دنیای امروز است که در اقتصاد، فرهنگ و در همه شئون مهندس راه آهن – اجتماعی جوامع، نقش چشمگیر و حیاتی دارد. در میان انواع حمل ‌و نقل، حمل‌ و نقل ریلی از مزیت ‌های بسیاری برخوردار است و کشورهای صنعتی و نیمه‌ صنعتی از گذشته های دور به این پدیده پرارزش پرداخته و شبکه حمل و نقل خود را با حمل و نقل ریلی تجهیز کرده‌اند. تاجایی که امروزه خیلی از کشورها به مرحله‌ای رسیده‌اند که چندان به دنبال توسعه کمّی نیستند بلکه به دنبال هماهنگ کردن و هم سو کردن صنعت حمل و نقل ریلی با دیگر پدیده‌ های علمی و صنعتی پیشرو مانند الکترونیک و سیستم ‌های ارتباط جمعی می‌ باشند. در واقع هدف آن ها رسیدن سریع از مبدا به مقصد و امکان جابجایی پرحجم مسافر و کالا است."
                },
                {
                    "مهندس مکانیک",
                    "مهندس مکانیک، اصول اساسی نیرو، انرژی، حرکت و گرما را می‌آموزد و با دانش تخصصی خود، سیستم‌های مکانیکی و دستگاه‌ها و فرایندهای گرمایی را طراحی کرده و می‌سازد. مهندس مکانیک گستره وسیعی از دستگاه‌ها، فرآورده‌ها و فرایندها را تولید می‌کند؛ از قالب ساخت سوزن ته‌گرد تا مدل‌سازی حرکت ماهواره‌ها در فضای خارج از جو، موتورها و سیستم‌های کنترل خودرو و هواپیما، نیروگاه‌های الکتریکی، دستگاه‌های پزشکی و اجزا و قطعه‌های گوناگون و…."
                },
                {
                    "مهندس مواد (مهندس متالورژی)",
                    "مهندس مواد دست اندر کار استخراج، عمل آوری، و امتحان موادی است که در تولیدفراورده های گوناگون، از چیپهای کامپیوتری و صفحات تلوزیون گرفته تا فلز بکار رفته در خودروها به کار می روند. مهندس مواد با فلزات، سرامیک ها، مواد پلاستیکی، نیمه هادیها، و ترکیباتی از موادی که به آنها کامپوزیت (مواد مرکب) می‌گویند، برای بوجود آوردن موادی که دارای خصوصیات خاص مکانیکی، الکتریکی و شیمیائی باشند کار می کند. از جمله کارهای مهندس مواد انتخاب مواد برای کاربردهای جدید نیز میباشد."
                },
                {
                    "مهندس پلیمر",
                    "شما به عنوان مهندس پلیمر محصولاتی را طراحی، تولید و یا اصلاح می کنید که در همه جا وجود داشته و همه ما تا حد زیادی به آنها وابسته هستیم و شاید در دنیای امروز زندگی بدون مواد و محصولات پلیمری بسیار سخت باشد. نمونه ای ساده از این محصولات عبارتند از مسواک، تیوب خمیردندان، دمپایی پلاستیکی، بسیاری از لباس ها، ظروف پلاستیکی و ملامینی آشپزخانه، جلد برخی از کتاب ها، بسیاری از قطعات تلویزیون، کامپیوتر و …"
                }
            };
            var groupTitles = new Dictionary <string, List <string> >
            {
                {
                    "استخدام کشــوری", new List <string>
                    {
                        "کارمندان ثابت",
                        "شهـــــــردار"
                    }
                },
                {
                    "بازنشستگـــان", new List <string>
                    {
                        "بازنشستگان",
                        "موظفیــــن"
                    }
                },
                {
                    "مشمولین قانون کار", new List <string>
                    {
                        "کارگران رسمـــــــــی",
                        "کارگران قراردادی فصلی",
                        "کارگران پیمانـــــــی"
                    }
                },
                {
                    "پیمانـــــی", new List <string>
                    {
                        "پیمانـی اداری",
                        "پیمانی خدماتی"
                    }
                },
                {
                    "استخدام کشوری تأمین اجتماعی", new List <string>
                    {
                        "رسمی تأمین اجتماعی الف",
                        "رسمی تأمین اجتماعــی ب"
                    }
                }
            };
            var groupColors = new[]
            {
                ColorPallet.Goldenrod, ColorPallet.Teal, ColorPallet.CornflowerBlue, ColorPallet.ForestGreen,
                ColorPallet.Maroon, ColorPallet.Navy
            };
            #endregion


            #region MainGroups & SubGroups
            var seedMainGroups = new List <MainGroup>();
            foreach (var g in groupTitles)
            {
                var indexOfGroup = groupTitles.Keys.ToList().IndexOf(g.Key);
                var newGroupMain = new MainGroup
                {
                    Title     = g.Key,
                    Alias     = $"{alphabets[indexOfGroup]}",
                    ItemColor = groupColors[indexOfGroup],
                    SubGroups = new List <SubGroup>()
                };
                var indexOfSubGroup = 0;
                foreach (var s in g.Value)
                {
                    newGroupMain.SubGroups.Add(new SubGroup
                    {
                        Alias        = $"{alphabets[indexOfGroup]}{++indexOfSubGroup:D2}",
                        Title        = s,
                        ItemColor    = newGroupMain.ItemColor,
                        Is31         = _faker.Random.Bool(),
                        MainGroup    = newGroupMain,
                        WorkshopCode = string.Empty,
                    });
                }
                seedMainGroups.Add(newGroupMain);
            }

            context.MainGroups.AddRange(seedMainGroups);
            #endregion


            #region Employees
            var employeeFaker = new Faker <Employee>("fa").StrictMode(false).Rules((f, e) =>
            {
                e.FName   = f.Name.FirstName();
                e.LName   = f.Name.LastName();
                e.Address =
                    $"{f.Address.City()} - {f.Address.CitySuffix()} - {f.Address.StreetName()} - پلاک  {f.Address.BuildingNumber()}";
                e.BirthPlace        = f.Address.City();
                e.IdCardExportPlace = f.Address.City();
                e.CellNo            = $"{f.PickRandom(mobilePrefix)}{f.Phone.PhoneNumber("#######")}";
                e.HomeTel           = f.Phone.PhoneNumber();
                e.BirthDate         = f.Date.Between(new PersianDate(1330, 1, 1).ToDateTime(),
                                                     new PersianDate(1370, 12, 29).ToDateTime());
                e.IdCardExportDate = f.Date.Between(new PersianDate(1330, 1, 1).ToDateTime(),
                                                    new PersianDate(1370, 12, 29).ToDateTime());
                e.DossierNo      = $"{f.Random.Number(999999):d6}";
                e.PersonnelCode  = $"{f.Random.Number(999999):d6}";
                e.FatherName     = f.Name.FirstName();
                e.Sex            = f.PickRandom(Enum.GetValues(typeof(Sex)).Cast <Sex>().Where(sex => sex != Sex.Unknown));
                e.PostalCode     = $"{f.Random.Number(999999999):d10}";
                e.NationalCardNo = $"{f.Random.Number(999999999):d10}";
                e.IdCardNo       = $"{f.Random.Number(999999)}";
            });
            var seedEmployees = employeeFaker.Generate(200);
            context.Employees.AddRange(seedEmployees);
            #endregion


            #region ExpenseArticles
            var seedExpenseArticles = new List <ExpenseArticle>();
            var expenseArticleFaker = new Faker <ExpenseArticle>("fa").StrictMode(false).Rules((f, e) =>
            {
                e.Title    = f.PickRandom(expenseArticleTitles);
                e.Code     = $"{f.Random.Number(99999):D5}";
                e.IsActive = true;
            });
            for (var i = 0; i < 10; i++)
            {
                seedExpenseArticles.Add(expenseArticleFaker.Generate());
            }

            seedExpenseArticles.AddRange(seedExpenseArticles);
            #endregion


            #region Cities
            var seedCities = new List <City>();
            var cityFaker  = new Faker <City>("fa").StrictMode(false).Rules((f, e) =>
            {
                e.Title      = f.PickRandom(cityNames.Where(s => !seedCities.Select(city => city.Title).Contains(s)));
                e.Distance   = f.Random.Int(20, 999);
                e.Percentage = f.Random.Number(100);
            });
            for (var i = 0; i < 50; i++)
            {
                seedCities.Add(cityFaker.Generate());
            }

            context.Cities.AddRange(seedCities);
            #endregion


            #region Jobs
            var seedJobs = new List <Job>();
            var jobFaker = new Faker <Job>("fa").StrictMode(false).Rules((f, e) =>
            {
                e.JobNo     = $"{f.Random.Number(999999):d6}";
                e.ItemColor = f.PickRandom(Enum.GetValues(typeof(ColorPallet)).Cast <ColorPallet>()
                                           .Where(x => x != ColorPallet.Unknown));
            });
            foreach (var job in jobTitleAndDescriptions)
            {
                jobFaker.RuleFor(j => j.Title, job.Key).RuleFor(j => j.Description, job.Value);
                seedJobs.Add(jobFaker.Generate());
            }

            context.Jobs.AddRange(seedJobs);
            #endregion


            #region ContractFields
            var seedContractFields = new List <ContractField>();
            foreach (var cf in contractFields)
            {
                seedContractFields.Add(new ContractField
                {
                    Index = cf.Item1,
                    IndexInRetirementReport = cf.Item1,
                    IsEditable = cf.Item2,
                    MainGroup  = seedMainGroups.First(g => g.Alias == cf.Item3),
                    Alias      = cf.Item4,
                    Title      = cf.Item5,
                    Year       = PaySysSetting.CurrentYear,
                });
            }

            context.ContractFields.AddRange(seedContractFields);
            #endregion


            #region MiscTitles
            var seedMiscTitles = new List <MiscTitle>();
            foreach (var title in miscTitlesPayment)
            {
                seedMiscTitles.Add(new MiscTitle
                {
                    Title     = title,
                    IsPayment = true
                });
            }
            foreach (var title in miscTitlesDebt)
            {
                seedMiscTitles.Add(new MiscTitle
                {
                    Title     = title,
                    IsPayment = false
                });
            }

            context.MiscTitles.AddRange(seedMiscTitles);
            #endregion


            #region Miscs
            var miscFaker = new Faker <Misc>("fa").StrictMode(false).Rules((f, e) =>
            {
                e.Year           = PaySysSetting.CurrentYear;
                e.Month          = PaySysSetting.CurrentMonth;
                e.ExpenseArticle = f.PickRandom(seedExpenseArticles);
                e.MiscTitle      = f.PickRandom(seedMiscTitles);
            });
            var seedMiscs = new List <Misc>();
            foreach (var mainGroup in seedMainGroups)
            {
                foreach (var subGroup in mainGroup.SubGroups)
                {
                    for (var i = 0; i < 10; i++)
                    {
                        miscFaker.RuleFor(m => m.SubGroup, subGroup);
                        seedMiscs.Add(miscFaker.Generate());
                    }
                }
            }

            context.Miscs.AddRange(seedMiscs);
            #endregion


            #region TaxTables
            var taxTableFaker = new Faker <TaxTable>("fa").StrictMode(false)
                                .Rules((f, e) => { e.Month = PaySysSetting.CurrentMonth; });
            var seedTaxTables = new List <TaxTable>();
            foreach (var mainGroup in seedMainGroups)
            {
                foreach (var subGroup in mainGroup.SubGroups)
                {
                    for (var i = 1395; i <= PaySysSetting.CurrentYear; i++)
                    {
                        taxTableFaker.RuleFor(tt => tt.SubGroup, subGroup).RuleFor(tt => tt.Year, i);
                        seedTaxTables.Add(taxTableFaker.Generate());
                    }
                }
            }

            context.TaxTables.AddRange(seedTaxTables);
            var taxRowFaker = new Faker <TaxRow>("fa").StrictMode(false).Rules((f, e) =>
            {
                e.ValueTo = f.Random.Number(20000) * 1000;
                e.Factor  = f.Random.Number(10);
            });
            var seedTaxRows = new List <TaxRow>();
            foreach (var taxTable in seedTaxTables)
            {
                for (var i = 0; i < 10; i++)
                {
                    taxRowFaker.RuleFor(row => row.TaxTable, taxTable);
                    seedTaxRows.Add(taxRowFaker.Generate());
                }
            }

            context.TaxRows.AddRange(seedTaxRows);
            #endregion


            #region MissionFormulas
            var missionFormulaFaker = new Faker <MissionFormula>("fa").StrictMode(false).Rules((f, e) =>
            {
                e.Month        = PaySysSetting.CurrentMonth;
                e.DivideFactor = f.Random.Number(30);
                e.AddFactor    = f.Random.Number(250000);
                e.MaxFactor    = f.Random.Number(1000000);
                e.PerKmFactor  = f.Random.Number(500);
                e.MissionFormulaInvolvedContractFields = new List <MissionFormulaInvolvedContractField>();
            });
            var seedMissionFormulas = new List <MissionFormula>();
            foreach (var mainGroup in seedMainGroups)
            {
                foreach (var subGroup in mainGroup.SubGroups)
                {
                    for (var i = 1395; i <= PaySysSetting.CurrentYear; i++)
                    {
                        missionFormulaFaker.RuleFor(missionFormula => missionFormula.SubGroup, subGroup)
                        .RuleFor(missionFormula => missionFormula.Year, i);
                        seedMissionFormulas.Add(missionFormulaFaker.Generate());
                    }
                }
            }

            foreach (var missionFormula in seedMissionFormulas)
            {
                for (var i = 0; i < 10; i++)
                {
                    if (_faker.Random.Bool())
                    {
                        var item = new MissionFormulaInvolvedContractField();
                        var validContractFields = missionFormula.SubGroup.ContractFields.Where(field =>
                                                                                               !missionFormula.MissionFormulaInvolvedContractFields.Select(invFld => invFld.ContractField)
                                                                                               .Contains(field)).ToList();
                        if (validContractFields.Any())
                        {
                            item.ContractField  = _faker.PickRandom(validContractFields);
                            item.MissionFormula = missionFormula;
                            missionFormula.MissionFormulaInvolvedContractFields.Add(item);
                        }
                    }
                }
            }

            context.MissionFormulas.AddRange(seedMissionFormulas);
            #endregion


            #region HandselFormulaFaker
            var handselFormulaFaker = new Faker <HandselFormula>("fa").StrictMode(false).Rules((f, e) =>
            {
                e.Month        = PaySysSetting.CurrentMonth;
                e.DaysCount    = f.Random.Number(60);
                e.TaxRate      = f.Random.Number(10);
                e.Max          = f.Random.Number(5000) * 1000;
                e.Min          = f.Random.Number(5000) * 1000;
                e.TaxFreeValue = f.Random.Number(5000) * 1000;
            });
            var seedHandselFormulas = new List <HandselFormula>();
            foreach (var mainGroup in seedMainGroups)
            {
                foreach (var subGroup in mainGroup.SubGroups)
                {
                    for (var i = 1395; i <= PaySysSetting.CurrentYear; i++)
                    {
                        handselFormulaFaker.RuleFor(handselFormula => handselFormula.SubGroup, subGroup)
                        .RuleFor(handselFormula => handselFormula.Year, i);
                        seedHandselFormulas.Add(handselFormulaFaker.Generate());
                    }
                }
            }

            context.HandselFormulas.AddRange(seedHandselFormulas);
            #endregion


            #region ParameterTitles
            var seedParameterTitles = new List <ParameterTitle>();
            foreach (var prm in parameterTitles)
            {
                seedParameterTitles.Add(new ParameterTitle()
                {
                    Alias = prm.Key,
                    Title = prm.Value
                });
            }

            context.ParameterTitles.AddRange(seedParameterTitles);
            #endregion


            #region Parameters
            var seedParameters = new List <Parameter>();
            foreach (var prm in mainGroupParameters)
            {
                foreach (var sg in seedMainGroups.First(g => g.Alias == prm.Item1).SubGroups)
                {
                    seedParameters.Add(new Parameter
                    {
                        ParameterTitle = seedParameterTitles.First(t => t.Alias == prm.Item2),
                        Year           = PaySysSetting.CurrentYear,
                        Month          = PaySysSetting.CurrentMonth,
                        SubGroup       = sg,
                        Value          = _faker.Random.Number(999999),
                    });
                }
            }

            context.Parameters.AddRange(seedParameters);
            #endregion


            #region ParameterInvolvedContractFields
            var seedParameterInvolvedContractFields = new List <ParameterInvolvedContractField>();
            foreach (var p in seedParameters)
            {
                foreach (var c in p.SubGroup.ContractFields)
                {
                    if (_faker.Random.Number(1000) % 3 != 0)
                    {
                        seedParameterInvolvedContractFields.Add(new ParameterInvolvedContractField
                        {
                            Parameter     = p,
                            ContractField = c
                        });
                    }
                }
            }
            context.ParameterInvolvedContractFields.AddRange(seedParameterInvolvedContractFields);
            #endregion


            #region ExpenseArticleOfContractFieldForSubGroups
            var seedExpenseArticleOfContractFieldForSubGroups = new List <ExpenseArticleOfContractFieldForSubGroup>();
            foreach (var mainGroup in seedMainGroups)
            {
                foreach (var subGroup in mainGroup.SubGroups)
                {
                    foreach (var contractField in subGroup.ContractFields)
                    {
                        seedExpenseArticleOfContractFieldForSubGroups.Add(new ExpenseArticleOfContractFieldForSubGroup
                        {
                            Month          = PaySysSetting.CurrentMonth,
                            ContractField  = contractField,
                            ExpenseArticle = _faker.PickRandom(seedExpenseArticles),
                            SubGroup       = subGroup
                        });
                    }
                }
            }

            context.ExpenseArticleOfContractFieldForSubGroups.AddRange(seedExpenseArticleOfContractFieldForSubGroups);
            #endregion


            #region ContractMaster
            var contractMasterFaker = new Faker <ContractMaster>("fa").StrictMode(false).Rules((f, e) =>
            {
                e.Employee     = f.PickRandom(seedEmployees);
                e.AccountNoEmp =
                    $"{f.PickRandom(creditCardNoPrefix)}-{f.Random.Number(9999):d4}-{f.Random.Number(9999):d4}-{f.Random.Number(9999):d4}";
                e.AccountNoGov =
                    $"{f.PickRandom(creditCardNoPrefix)}-{f.Random.Number(9999):d4}-{f.Random.Number(9999):d4}-{f.Random.Number(9999):d4}";
                e.ContractNo     = $"{f.Random.Number(99999):d5}";
                e.DateEmployment = f.Date.Between(e.Employee.BirthDate.AddYears(20), DateTime.Now);
                e.DateExport     = f.Date.Between(e.DateEmployment, DateTime.Now);
                e.DateExecution  = f.Date.Between(e.DateExport, DateTime.Now);
                e.EducationStand = f.PickRandom(Enum.GetValues(typeof(EducationStand)).Cast <EducationStand>()
                                                .Where(sex => sex != EducationStand.Unknown));
                e.EmploymentType = f.PickRandom(Enum.GetValues(typeof(EmploymentType)).Cast <EmploymentType>()
                                                .Where(sex => sex != EmploymentType.Unknown));
                e.HardshipFactor = f.Random.Number(100);
                e.InsuranceNo    = $"{f.Random.Number(99999999):d8}";
                e.MaritalStatus  = f.PickRandom(Enum.GetValues(typeof(MaritalStatus)).Cast <MaritalStatus>()
                                                .Where(sex => sex != MaritalStatus.Unknown));
                e.Job            = f.PickRandom(seedJobs);
                e.SacrificeStand = f.PickRandom(Enum.GetValues(typeof(SacrificeStand)).Cast <SacrificeStand>()
                                                .Where(sex => sex != SacrificeStand.Unknown));
                e.SubGroup = f.PickRandom(f.PickRandom(seedMainGroups).SubGroups);
            });
            var seedContractMasters = contractMasterFaker.Generate(200);
            context.ContractMasters.AddRange(seedContractMasters);
            #endregion


            #region ContractDetail
            var contractDetailFaker = new Faker <ContractDetail>("fa").StrictMode(false)
                                      .Rules((f, e) => { e.Value = f.Random.Number(100) * 10000; });
            var seedContractDetails = new List <ContractDetail>();
            foreach (var contMast in seedContractMasters)
            {
                foreach (var grpCntField in seedContractFields.Where(c => c.MainGroup.Equals(contMast.MainGroup)))
                {
                    contractDetailFaker.RuleFor(detail => detail.ContractMaster, contMast);
                    contractDetailFaker.RuleFor(detail => detail.ContractField, grpCntField);
                    var contractDetail = contractDetailFaker.Generate();
                    seedContractDetails.Add(contractDetail);
                }
            }

            context.ContractDetails.AddRange(seedContractDetails);
            #endregion


            #region Set CurrentContract for each Employee
            var queryEmpContracts = from cont in seedContractMasters
                                    group cont by cont.Employee
                                    into newGroup
                                    select newGroup;
            foreach (var empContract in queryEmpContracts)
            {
                var lastCnt = empContract.LastOrDefault();
                if (lastCnt != null)
                {
                    lastCnt.IsCurrent = true;
                }
            }
            #endregion


            #region MiscRecharges
            var seedMiscRecharges = new List <MiscRecharge>();
            var miscRechargeFaker = new Faker <MiscRecharge>("fa").StrictMode(false)
                                    .Rules((f, e) => { e.Value = f.Random.Number(100) * 1000; });
            var firstTenContracts = seedContractMasters.Where(master => master.IsCurrent).Take(10);
            foreach (var contract in firstTenContracts)
            {
                var contractMiscs = contract.SubGroup.Miscs.Take(_faker.Random.Number(contract.SubGroup.Miscs.Count));
                foreach (var misc in contractMiscs)
                {
                    miscRechargeFaker.RuleFor(r => r.Employee, contract.Employee).RuleFor(r => r.Misc, misc);
                    for (var y = 1395; y <= PaySysSetting.CurrentYear; y++)
                    {
                        for (var m = 5; m <= 11; m++)
                        {
                            miscRechargeFaker.RuleFor(r => r.Year, y).RuleFor(r => r.Month, m);
                            seedMiscRecharges.Add(miscRechargeFaker);
                        }
                    }
                }
            }

            context.MiscRecharges.AddRange(seedMiscRecharges);
            #endregion


            #region Missions
            var seedMissions = new List <Mission>();
            var missionFaker = new Faker <Mission>("fa").StrictMode(false).Rules((f, e) =>
            {
                e.AmountNonResident = f.Random.Number(15);
                e.AmountResident    = f.Random.Number(15);
                e.City = f.PickRandom(seedCities);
                e.MissionContractNo = f.Random.Number(99999).ToString("d5");
                e.VehicleType       = f.PickRandom(Enum.GetValues(typeof(VehicleType)).Cast <VehicleType>()
                                                   .Where(v => v != VehicleType.Unknown));
                e.TravelExpense = f.Random.Number(1000) * 1000;
            });

            foreach (var contract in seedContractMasters)
            {
                var startMonth = _faker.Random.Number(9) + 1;
                missionFaker.RuleFor(m => m.ContractMaster, contract);
                missionFaker.RuleFor(m => m.StartDate, _faker.Date.Between(contract.DateEmployment, DateTime.Now));
                missionFaker.RuleFor(m => m.EndDate, (f, m) => f.Date.Between(m.StartDate, DateTime.Now));
                missionFaker.RuleFor(m => m.StartTime, _faker.Date.Past());
                missionFaker.RuleFor(m => m.EndTime, _faker.Date.Past());

                for (var i = 0; i < 10; i++)
                {
                    seedMissions.Add(missionFaker.Generate());
                }
            }

            context.Missions.AddRange(seedMissions);
            #endregion


            #region VariableTitles
            var seedVariables = new List <Variable>();

            foreach (var mainGroup in seedMainGroups)
            {
                foreach (var v in variables)
                {
                    seedVariables.Add(new Variable
                    {
                        Index     = v.Item1,
                        Alias     = v.Item2,
                        Title     = v.Item3,
                        ValueType =
                            _faker.PickRandom(Enum.GetValues(typeof(ValueType)).Cast <ValueType>()
                                              .Where(type => type != ValueType.Unknown)),
                        FromMonth = 1,
                        FromYear  = 1397,
                        ToMonth   = 12,
                        ToYear    = 1397,
                        MainGroup = mainGroup
                    });
                }
            }

            context.Variables.AddRange(seedVariables);
            #endregion


            #region VariableValueForEmployees
            var seedVariableValues = new List <VariableValueForEmployee>();
            var variableValueFaker = new Faker <VariableValueForEmployee>("fa").StrictMode(false);

            foreach (var contract in seedContractMasters)
            {
                if (_faker.Random.Bool())
                {
                    continue;
                }

                foreach (var variable in seedVariables)
                {
                    variableValueFaker.RuleFor(r => r.Employee, contract.Employee).RuleFor(r => r.Variable, variable);
                    for (var y = 1395; y <= PaySysSetting.CurrentYear; y++)
                    {
                        for (var m = 5; m <= 11; m++)
                        {
                            variableValueFaker.RuleFor(r => r.Year, y).RuleFor(r => r.Month, m).RuleFor(v => v.Value,
                                                                                                        (f, v) =>
                            {
                                switch (v.Variable.ValueType)
                                {
                                case ValueType.Unknown:
                                    return(null);

                                case ValueType.Absolute:
                                case ValueType.Rial:
                                    return(f.Random.Number(100) * 1000);

                                case ValueType.Percent:
                                    return(f.Random.Number(100));

                                case ValueType.Date:
                                    return(f.Date.Past(3, DateTime.Now));

                                case ValueType.String:
                                    return(f.Commerce.ProductAdjective());

                                default:
                                    return(string.Empty);
                                }
                            });
                            seedVariableValues.Add(variableValueFaker);
                        }
                    }
                }
            }

            context.VariableValueForEmployees.AddRange(seedVariableValues);
            #endregion


            base.Seed(context);
        }