Esempio n. 1
0
        public void UpdateFlats(bool isUpdateSections)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.InitialDirectory = "c:\\";
            openFileDialog.Filter           = "Файл с квартирами (*.xlsx)|*.xlsx";
            openFileDialog.RestoreDirectory = true;
            string excelPath = "";

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                excelPath = openFileDialog.FileName;
            }
            if (excelPath == "")
            {
                return;
            }
            Exporter.ExportFlatsToSQL(excelPath);//Обновляется таблица Flats
            FrameWork fw       = new FrameWork();
            var       roomInfo = fw.GetRoomData(excelPath);

            if (isUpdateSections)
            {
                //  Parallel.For(6, 11, (q) => Exporter.ExportSectionsToSQL(q * 4, "Рядовая", 9, false, false, roomInfo)); //Рядовая 2-9 с 6 по 10 этаж
                Parallel.For(8, 12, (q) => Exporter.ExportSectionsToSQL(q * 4, "Угловая лево", 9, true, false, roomInfo));   //Угловая лево 2-9
                Parallel.For(8, 12, (q) => Exporter.ExportSectionsToSQL(q * 4, "Угловая право", 9, false, true, roomInfo));  //Угловая право 2-9
                Parallel.For(7, 15, (q) => Exporter.ExportSectionsToSQL(q * 4, "Угловая лево", 18, true, false, roomInfo));  //Угловая лево 10-18
                Parallel.For(7, 15, (q) => Exporter.ExportSectionsToSQL(q * 4, "Угловая право", 18, false, true, roomInfo)); //Угловая право 10-18
                //  Parallel.For(7, 15, (q) => Exporter.ExportSectionsToSQL(q * 4, "Рядовая", 25, false, false, roomInfo)); //Рядовая 19-25
                // Parallel.For(7, 15, (q) => Exporter.ExportSectionsToSQL(q * 4, "Рядовая", 18, false, false, roomInfo)); //Рядовая 10-18
            }
        }
 /// <summary>
 /// Distributes a message to all instances, which have subscribed the message distributor.
 /// </summary>
 /// <param name="message">The message.</param>
 /// <param name="parameter">The parameter.</param>
 /// <param name="sender">The sender.</param>
 public void DistributeMessage(String message, object parameter, FrameWork.Plugins.BasePlugin sender)
 {
     if (MessageArrived != null)
     {
         MessageArrived(message, parameter, sender);
     }
 }
Esempio n. 3
0
        private static void Export()
        {
            FrameWork fw        = new FrameWork();
            string    excelPath = @"E:\__ROM_Типы квартир.xlsx";
            var       roomInfo  = fw.GetRoomData(excelPath);

            projectInfo = fw.GetDefaultSpotInfo();
            Exporter.ExportSectionsToSQL(11 * 4, "Угловая право", 9, false, true, roomInfo);//Если нужно залить 1 тип секции
            Environment.Exit(48);
        }
Esempio n. 4
0
        public Form1()
        {
            FactorySupport factorySupport = new FactorySupport();

            Log.Logger = new LoggerConfiguration().WriteTo.File(@"C:\Log\Log.txt", rollingInterval: RollingInterval.Hour).CreateLogger();
            Directory.CreateDirectory(@"C:\db");
            LiteRepository repo = new LiteRepository(ApplicationConfig.DbConnectionString);

            frameWork = factorySupport.Create(isMySQL, repo);

            InitializeComponent();
        }
Esempio n. 5
0
        private ProjectInfo LoadSpotInfo()
        {
            var        fw       = new FrameWork();
            Serializer s        = new Serializer();
            var        spotInfo = s.LoadSpotInfoFromFile();

            if (spotInfo == null)
            {
                spotInfo = fw.GetDefaultSpotInfo();
            }
            return(spotInfo);
        }
Esempio n. 6
0
 // Constructor
 public GraphSearch(FrameWork problem, int type)
 {
     frontier = new List <List <int[]> >();
     frontier.Add(problem.getInitialStates());
     foreach (var element in problem.initialStates)
     {
         Debug.Log(element[0] + ", " + element[1] + " 3");
     }
     explored  = new List <int[]>();
     framework = problem;
     finalPath = new List <int[]>();
 }
Esempio n. 7
0
        public string insertCategory(FrameWork.Length cats)
        {
            string Message = string.Empty;
            int result = 0;
            con.Open();
            SqlCommand cmd = new SqlCommand("INSERT INTO [Length]([Lengths]) VALUES (@Length)", con);
            cmd.Parameters.AddWithValue("@Length", cats.Lengths);

            result = cmd.ExecuteNonQuery();

            con.Close();
            return Message;
        }
Esempio n. 8
0
        public void Add_Item_ReturnItem()
        {
            //Arrange
            IItemActive item = new ItemActive();
            item.DeviceName = "akármi";
            var testObject = new FrameWork(dataService.Object, logService.Object, errorService.Object);

            //Act
            testObject.AddItemActive(item);
            var result = testObject.GetItemByID(item.ID);

            //Assert
            Assert.That(result, Is.EqualTo(item));
        }
Esempio n. 9
0
        public void Add_Item_When_ReturnItemName_ThenEqualToName()
        {
            //Arrange
            IItemActive item = new ItemActive();

            item.DeviceName = "router";
            IFrameWork testObject = new FrameWork(dataService.Object, logService.Object, errorService.Object, userService.Object);

            //Act
            bool ok     = testObject.AddItemActive(item);
            var  result = testObject.GetItemActive(item.Id);

            //Assert
            Assert.That(result.DeviceName, Is.EqualTo(item.DeviceName));
        }
    public void solveLab(string algorithm)
    {
        FrameWork myProblem = new FrameWork(colorsMatrixNormalized, Int32.Parse(nSize.text));

        foreach (var element in myProblem.initialStates)
        {
            Debug.Log(element[0] + ", " + element[1] + " 2");
        }
        GraphSearch  graph = new GraphSearch(myProblem, 1);
        List <int[]> path  = graph.JustDoIt();

        foreach (var element in path)
        {
            Debug.Log(element[0] + ", " + element[1]);
        }
    }
Esempio n. 11
0
        public void Change_ItemName()
        {
            //Arrange
            IItemActive item = new ItemActive();
            item.DeviceName = "akarmi";
            var testObject = new FrameWork(dataService.Object, logService.Object, errorService.Object);

            //Act
            testObject.AddItemActive(item);
            IItemActive change = testObject.GetItemByID(item.ID);
            change.DeviceName = "zsiraf";
            IItemActive result = testObject.GetItemByID(item.ID);


            //Assert
            Assert.That(result.DeviceName, Is.EqualTo("zsiraf"));
        }
Esempio n. 12
0
        public void Change_ItemName()
        {
            //Arrange
            IItemActive item = new ItemActive();

            item.DeviceName = "router";
            IFrameWork testObject = new FrameWork(dataService.Object, logService.Object, errorService.Object, userService.Object);

            //Act
            bool        ok     = testObject.AddItemActive(item);
            IItemActive change = testObject.GetItemActive(item.Id);

            change.DeviceName = "switch";
            IItemActive result = testObject.GetItemActive(item.Id);

            //Assert
            Assert.That(result.DeviceName, Is.EqualTo("switch"));
        }
Esempio n. 13
0
        public string insertProducts(FrameWork.Products prods)
        {
            string Message = string.Empty;
            int result = 0;
            con.Open();
            SqlCommand cmd = new SqlCommand("INSERT INTO [Products]([ProductName],[ProductCode],[Description] ,[UnitOfMeasureID] ,[CategoryID] ,[ProductSizeID],[Discontinued]) VALUES (@ProductName,@ProductCode,@Description ,@UnitOfMeasureID ,@CategoryID ,@ProductSizeID,@Discontinued)", con);
            cmd.Parameters.AddWithValue("@ProductName", prods.ProductName);
            cmd.Parameters.AddWithValue("@ProductCode", prods.ProductCode);
            cmd.Parameters.AddWithValue("@Description", prods.Description);
            cmd.Parameters.AddWithValue("@UnitOfMeasureID", prods.UnitOfMeasureID);
            cmd.Parameters.AddWithValue("@CategoryID", prods.CategoryID);
            cmd.Parameters.AddWithValue("@ProductSizeID", prods.ProductSizeID);
            cmd.Parameters.AddWithValue("@Discontinued", 1);

            result = cmd.ExecuteNonQuery();

            con.Close();
            return Message;
        }
Esempio n. 14
0
        public string insertProducts(FrameWork.Products prods)
        {
            string Message = string.Empty;
            int result = 0;
            con.Open();
            SqlCommand cmd = new SqlCommand("INSERT INTO [Products]([ProductName],[ProductCode],[Description] ,[UnitOfMeasureID] ,[CategoryID] ,[ProductSizeID],[Discontinued]) VALUES (@ProductName,@ProductCode,@Description ,@UnitOfMeasureID ,@CategoryID ,@ProductSizeID,@Discontinued)", con);
            cmd.Parameters.AddWithValue("@ProductName", prods.ProductName);
            cmd.Parameters.AddWithValue("@ProductCode", prods.ProductCode);
            cmd.Parameters.AddWithValue("@Description", prods.Description);
            cmd.Parameters.AddWithValue("@UnitOfMeasureID", prods.UnitOfMeasureID);
            cmd.Parameters.AddWithValue("@CategoryID", prods.CategoryID);
            cmd.Parameters.AddWithValue("@ProductSizeID", prods.ProductSizeID);
            cmd.Parameters.AddWithValue("@Discontinued", 1);

            result = cmd.ExecuteNonQuery();

            cmd = new SqlCommand( "select ID from Products where ProductName='" + prods.ProductName + "'",con);
            result = (int)cmd.ExecuteScalar();

            cmd = new SqlCommand("INSERT INTO [Inventory]([ProductID],[ReorderLevel],[TargetLevel],[MinimumReorderQuantity],[Received],[OnOrder], [Shrinkage],[Shipped],[Allocated],[BackOrdered],[InitialLevel],[OnHand],[Available],[CurrentLevel] ,[BelowTargetLevel],[ReorderQuantity]) VALUES (@ProductID,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)", con);
            cmd.Parameters.AddWithValue("@ProductID", result);
            //result = cmd.ExecuteNonQuery();
            //return Message;

            //con.Close();
            try
            {
                result = cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                Message = ex.Message;
            }
            finally
            {
                con.Close();
                Message = string.Empty;
            }
            return Message;
        }
Esempio n. 15
0
        //private static void ExportBasicInfo(string excelPath)
        //{
        //    FrameWork fw = new FrameWork();
        //    var roomInfo = fw.GetRoomData(excelPath);
        //    PIK1TableAdapters.C_Flats_PIK1TableAdapter flatsPIK1 = new C_Flats_PIK1TableAdapter();
        //    var flats = flatsPIK1.GetData();
        //    foreach (var rr in roomInfo)
        //    {
        //        if (flats.Any(x => x.Type.Equals(rr.Type)))
        //            continue;
        //        //flatsPIK1.UpdateFlat(rr.ShortType, rr.AreaLive, rr.AreaTotalStandart, rr.AreaTotal,Convert.ToInt16(rr.AreaModules), 0, 0, rr.LinkageDO, rr.LinkagePOSLE,
        //        //    rr.FactorSmoke, rr.LightingNiz, rr.LightingTop, rr.IndexLenghtTOP, rr.IndexLenghtNIZ, rr.SubZone,rr.LinkageOR, rr.Type);

        //        else
        //            flatsPIK1.InsertFlat(rr.Type, rr.ShortType, rr.AreaLive, rr.AreaTotalStandart, rr.AreaTotal,
        //                Convert.ToInt16(rr.AreaModules), 0, 0, rr.LinkageDO, rr.LinkagePOSLE,
        //                rr.FactorSmoke, rr.LightingNiz, rr.LightingTop, rr.IndexLenghtTOP, rr.IndexLenghtNIZ, rr.SubZone,
        //                rr.LinkageOR);

        //    }
        //}


        public static void ExportSectionsToSQL(int countModules, string typeSection, int countFloors, bool isCornerLeft, bool isCornerRight, List <RoomInfo> roomInfo)
        {
            FrameWork fw = new FrameWork();
            //var roomInfo = fw.GetRoomData("");
            string floors = "AB";

            if (countFloors <= 30 & countFloors >= 19)
            {
                floors = "ABB";
            }
            else if (countFloors <= 12)
            {
                floors = "A";
            }
            var sections = fw.GenerateSections(roomInfo, countModules, isCornerLeft, isCornerRight, floors);


            PIK1TableAdapters.C_SectionsTableAdapter          sects           = new C_SectionsTableAdapter();
            PIK1TableAdapters.F_nn_FlatsInSectionTableAdapter flatInSection   = new F_nn_FlatsInSectionTableAdapter();
            PIK1TableAdapters.C_Flats_PIK1TableAdapter        flatsISectionDB = new C_Flats_PIK1TableAdapter();
            var allFlats = flatsISectionDB.GetData();

            foreach (var section in sections)
            {
                var idSection = sects.InsertSection(countModules / 4, typeSection, floors);
                int idSec     = Convert.ToInt32(idSection);
                foreach (var flat in section.Flats)
                {
                    try
                    {
                        int idF = allFlats.First(x => x.Type.Equals(flat.Type) & x.LinkageBefore.Equals(flat.LinkageDO.Trim()) &
                                                 x.LinkageAfter.Equals(flat.LinkagePOSLE.Trim()) & x.LinkageOr.Trim().Equals(flat.LinkageOR.Trim())).ID_Flat;
                        flatInSection.InsertFlatInSection(idSec, Convert.ToInt32(idF), flat.SelectedIndexBottom,
                                                          flat.SelectedIndexTop);
                    }
                    catch { }
                }
            }
        }
Esempio n. 16
0
 public void SetUp()
 {
     FrameWork.SetLogger();
     WebDriver.GetDriver();
     WebDriver.GoTo(FrameWork.Config.Test.Url);
 }
Esempio n. 17
0
        static void ExportFlatsAreas(string excelPath)
        {
            FrameWork fw = new FrameWork();
            C_Flats_PIK1_AreasTableAdapter flatsPik1Areas = new C_Flats_PIK1_AreasTableAdapter();
            var flatsAreas = flatsPik1Areas.GetData();

            using (var xlPackage = new ExcelPackage(new FileInfo(excelPath)))
            {
                int counter   = 2;
                var worksheet = xlPackage.Workbook.Worksheets[2];
                while (worksheet.Cells[counter, 1].Value != null)
                {
                    string shortType                       = Convert.ToString(worksheet.Cells[counter, 2].Value);
                    double area_Total_Low18                = fw.DoubleConvert(worksheet.Cells[counter, 4].Value);
                    double area_Total_Standart_More18      = fw.DoubleConvert(worksheet.Cells[counter, 5].Value);
                    double area_Total_Strong_More18        = fw.DoubleConvert(worksheet.Cells[counter, 6].Value);
                    double area_Total_End_Low18            = fw.DoubleConvert(worksheet.Cells[counter, 7].Value);
                    double area_Total_Standart_End_More18  = fw.DoubleConvert(worksheet.Cells[counter, 8].Value);
                    double area_Total_Strong_End_More18    = fw.DoubleConvert(worksheet.Cells[counter, 9].Value);
                    double area_Total_Standart_Seam_Low18  = fw.DoubleConvert(worksheet.Cells[counter, 10].Value);
                    double area_Total_Standart_Seam_More18 = fw.DoubleConvert(worksheet.Cells[counter, 11].Value);
                    double area_Total_Strong_Seam_More18   = fw.DoubleConvert(worksheet.Cells[counter, 12].Value);
                    string correction_Low18                = Convert.ToString(worksheet.Cells[counter, 13].Value);
                    string correction_More18               = Convert.ToString(worksheet.Cells[counter, 14].Value);
                    double area_Live_Low18                 = fw.DoubleConvert(worksheet.Cells[counter, 15].Value);
                    double area_Live_Standart_More18       = fw.DoubleConvert(worksheet.Cells[counter, 16].Value);
                    double area_Live_Strong_More18         = fw.DoubleConvert(worksheet.Cells[counter, 17].Value);
                    double area_Live_End_Low18             = fw.DoubleConvert(worksheet.Cells[counter, 18].Value);
                    double area_Live_Standart_End_More18   = fw.DoubleConvert(worksheet.Cells[counter, 19].Value);
                    double area_Live_Strong_End_More18     = fw.DoubleConvert(worksheet.Cells[counter, 20].Value);
                    double area_Live_Seam_Low18            = fw.DoubleConvert(worksheet.Cells[counter, 21].Value);
                    double area_Live_Standart_Seam_More18  = fw.DoubleConvert(worksheet.Cells[counter, 22].Value);
                    double area_Live_Strong_Seam_More18    = fw.DoubleConvert(worksheet.Cells[counter, 23].Value);
                    double area_Level_Combo                = fw.DoubleConvert(worksheet.Cells[counter, 24].Value);
                    double area_Level_End                  = fw.DoubleConvert(worksheet.Cells[counter, 25].Value);
                    double area_Level_Seam                 = fw.DoubleConvert(worksheet.Cells[counter, 26].Value);
                    double area_OutFlat_Combo              = fw.DoubleConvert(worksheet.Cells[counter, 27].Value);
                    double area_OutFlat_Strong             = fw.DoubleConvert(worksheet.Cells[counter, 28].Value);
                    if (flatsAreas.Any(x => x.Short_Type.Equals(shortType)))
                    {
                        flatsPik1Areas.UpdateAreaFlat(area_Total_Low18, area_Total_Standart_More18,
                                                      area_Total_Strong_More18, area_Total_End_Low18, area_Total_Standart_End_More18,
                                                      area_Total_Strong_End_More18, area_Total_Standart_Seam_Low18, area_Total_Standart_Seam_More18,
                                                      area_Total_Strong_Seam_More18,
                                                      correction_Low18, correction_More18, area_Live_Low18, area_Live_Standart_More18,
                                                      area_Live_Strong_More18,
                                                      area_Live_End_Low18, area_Live_Standart_End_More18, area_Live_Strong_End_More18,
                                                      area_Live_Seam_Low18, area_Live_Standart_Seam_More18,
                                                      area_Live_Strong_Seam_More18, area_Level_Combo, area_Level_End, area_Level_Seam, area_OutFlat_Combo, area_OutFlat_Strong, shortType);
                    }
                    else
                    {
                        flatsPik1Areas.Insert(shortType, area_Total_Low18, area_Total_Standart_More18,
                                              area_Total_Strong_More18, area_Total_End_Low18, area_Total_Standart_End_More18,
                                              area_Total_Strong_End_More18, area_Total_Standart_Seam_Low18, area_Total_Standart_Seam_More18,
                                              area_Total_Strong_Seam_More18,
                                              correction_Low18, correction_More18, area_Live_Low18, area_Live_Standart_More18,
                                              area_Live_Strong_More18,
                                              area_Live_End_Low18, area_Live_Standart_End_More18, area_Live_Strong_End_More18,
                                              area_Live_Seam_Low18, area_Live_Standart_Seam_More18,
                                              area_Live_Strong_Seam_More18, area_Level_Combo, area_Level_End, area_Level_Seam, area_OutFlat_Combo, area_OutFlat_Strong, 0);
                    }

                    counter++;
                }
            }
        }
Esempio n. 18
0
 // Start is called before the first frame update
 void Start()
 {
     frameWork = new FrameWork();
 }
Esempio n. 19
0
 /// <summary>
 /// Requests the install.
 /// </summary>
 /// <param name="plugin">The plugin.</param>
 /// <param name="callBackParameter">The call back parameter.</param>
 public void RequestInstall(FrameWork.Plugins.BasePlugin plugin, object callBackParameter)
 {
     plugin.Install(callBackParameter);
 }
Esempio n. 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //***No Direct Access Start***//
            if (String.IsNullOrEmpty(Request.Form["hmisc"]))
            {
                SignalAlert("Error", "Invalid Operation", "main.aspx");
            }
            //***No Direct Access End***//


            //***Employees Init variables start***//
            List <string> textboxes = new List <string> {
                Request.Form["emp1"],
                Request.Form["emp2"], Request.Form["emp3"], Request.Form["emp4"],
                Request.Form["emp5"], Request.Form["emp6"], Request.Form["emp7"],
                Request.Form["emp8"], Request.Form["emp9"], Request.Form["emp10"]
            };

            List <HtmlInputText> employees = new List <HtmlInputText>();

            foreach (string emp in textboxes)
            {
                HtmlInputText temp = new HtmlInputText();
                temp.Value = emp;
                employees.Add(temp);
            }
            //***Employees Init variables end***//


            //***Timing Init Variables Start***//
            DateTime startdate;
            DateTime enddate;
            DateTime startdate2;

            try
            {
                startdate = DateTime.Parse(Request.Form["hstartdate"]);
            }
            catch (Exception)
            {
                startdate = fakeDate;
            }
            try
            {
                startdate = DateTime.Parse(Request.Form["hstartdate"]);
            }
            catch (Exception)
            {
                startdate = fakeDate;
            }
            try
            {
                enddate = DateTime.Parse(Request.Form["henddate"]);
            }
            catch (Exception)
            {
                enddate = fakeDate;
            }
            try
            {
                startdate2 = DateTime.Parse(Request.Form["hstartdate2"]);
            }
            catch (Exception)
            {
                startdate2 = fakeDate;
            }
            int numofweeks = int.Parse(Request.Form["weeks"]);
            //***Timing Init Variables end***//


            //***Options Init Variables start***//
            bool includesaturdays = bool.Parse(Request.Form["hincludesaturdays"]);
            bool includesundays   = bool.Parse(Request.Form["hincludesundays"]);
            bool fullday          = bool.Parse(Request.Form["hfullday"]);
            bool showdates        = bool.Parse(Request.Form["hshowddates"]);

            String title = Request.Form["title"];
            String msst  = Request.Form["msst"];
            String asst  = Request.Form["asst"];
            String aset  = Request.Form["aset"];
            String theme = Request.Form["theme"];
            //***Options Init Variables end***//


            //***Validate Timings Start***//
            int numweeks    = 0;
            int numdays     = 0;
            int numweekdays = 0;
            int weekformat  = 5;

            if (startdate != fakeDate && enddate != fakeDate)
            {
                if (includesaturdays)
                {
                    weekformat++;
                }
                if (includesundays)
                {
                    weekformat++;
                }

                numdays     = Utility.GetNumberOfDays(startdate, enddate, weekformat, includesaturdays, includesundays);
                numweeks    = Utility.GetNumberOfWeeks(numdays, weekformat);
                numweekdays = weekformat;
            }
            else
            {
                if (numofweeks > 0)
                {
                    if (includesaturdays)
                    {
                        weekformat++;
                    }
                    if (includesundays)
                    {
                        weekformat++;
                    }

                    numweeks    = numofweeks;
                    numdays     = weekformat * numweeks;
                    numweekdays = weekformat;
                }
            }

            //***Validate Timings End***//


            //Set Schedule Title
            HtmlGenericControl h4 = new HtmlGenericControl("h4");

            h4.InnerHtml = title;
            dtitle.Controls.Add(h4);


            //***Validate Employees Start***//
            //Check Invalid Data
            if (numweeks == 0 || numdays == 0 || numweekdays == 0)
            {
                SignalAlert("Error", "Invalid Date Range", "main.aspx");
            }

            //Check Date Range
            if (startdate != fakeDate && enddate != fakeDate)
            {
                if (numdays < 5)
                {
                    SignalAlert("Error", "Number of days must be greater than 5", "main.aspx");
                }
            }
            else
            {
                if (numofweeks <= 0 || startdate2.Equals(fakeDate))
                {
                    SignalAlert("Error", "Number of weeks must be more than one", "main.aspx");
                }
            }

            /**
             *
             * TODO: Check Date Range
             * TODO: Check Number of Employees
             * TODO: Run No of Employees against date range
             *
             */
            employees = Utility.Clean(employees);
            employees = Utility.Shuffle(employees);
            List <HtmlInputText> distinct = new List <HtmlInputText>();

            //Copy
            distinct = new List <HtmlInputText>(employees);

            //Check Minimum Employees Allowed
            if (employees.Count < 5)
            {
                SignalAlert("Error", "Number of employees must be more than 4", "main.aspx");
            }

            //Check For Minimum Allowed Selection
            if (numdays < employees.Count)
            {
                SignalAlert("Error", "Number of employees must be more than Number of days", "main.aspx");
            }

            //Repopulate
            employees = Utility.Repopulate(employees, numdays);

            HashMap <int, List <HtmlInputText> > empdata = new HashMap <int, List <HtmlInputText> >();

            empdata = Utility.Split(employees, numweeks, numweekdays, fullday);
            //***Validate Employees End***//


            //***Shift Times and Dates Start***//
            string[] shifttime = fullday ? new string[] { msst + " - " + aset } : new string[] { msst + " - " + asst, asst + " - " + aset };

            List <DateTime> dates = startdate != fakeDate && enddate != fakeDate?
                                    Utility.PopulateDates(startdate, enddate, numweekdays, includesaturdays, includesundays) :
                                        Utility.PopulateDates(startdate2, numdays, includesaturdays, includesundays);

            //***Shift Times and Dates End***//


            //***Render Tables Start***//

            //Implement Rules
            empdata = RuleBook.RuleCompile(empdata, RuleCheck.OneHalfDayShift, fullday, distinct);
            empdata = RuleBook.RuleCompile(empdata, RuleCheck.NoTwoNoonShift, fullday, distinct);

            /*empdata = RuleBook.RuleCompile(empdata, RuleCheck.TwoDaysExemption);*/

            //Tie Up Loose Ends
            //empdata = RuleBook.RuleCompile(empdata, RuleCheck.OneHalfDayShift, fullday, distinct);

            for (int i = 0; i < empdata.Size(); i++)
            {
                int start = numweekdays * i;
                int end   = (start + numweekdays) > dates.Count ? (dates.Count - start) + start - 1 : (start + numweekdays) - 1;

                HtmlGenericControl h5 = new HtmlGenericControl("h5");
                h5.InnerHtml = "Week " + (i + 1) + (showdates ? " : " + dates.ElementAt(start).ToString("MMMM dd") +
                                                    " - " + dates.ElementAt(end).ToString("MMMM dd") : "");
                container.Controls.Add(h5);

                FrameWork.GetTable(container, empdata.GetValue(i), showdates, numweekdays, i, dates, shifttime, theme, fullday);
            }
            //***Render Tables End***//


            //***Secure PDF Start***//
            FrameWork.GetPDF(empdata, title, showdates, numweekdays, dates, shifttime, theme, fullday);
            //***Secure PDF End***//
        }
Esempio n. 21
0
 void UserIntelligence_UserLoggedIn(FrameWork.Intelligence.Accounting.TableModels.UserModel accountData)
 {
     BaseIntelligence.CoreIntelligence.SocialIntelligence.Initialize();
     initPages();
 }
 public ConfigurationViewModel(FrameWork.Intelligence.CoreIntelligence intelligence)
 {
     // TODO: Complete member initialization
     this.intelligence = intelligence;
 }
Esempio n. 23
0
 public void OneTimeSetUp()
 {
     FrameWork.SetConfig();
     FrameWork.CreateTestResultsDirectory();
 }