Exemplo n.º 1
0
        public static List <DataPoint> recieveData(string shiYanHao)
        {
            System.Collections.Generic.List <ZhiLiangCanShuDataMember.DataValue> data = ZhiLiangCanShuDataMember.SelectData.getData(shiYanHao);
            List <DataPoint> list = new List <DataPoint>(data.Count());

            for (int i = 0; i < data.Count(); i++)
            {
                DataPoint dataPoint = new DataPoint();
                dataPoint.ValueX = i + 1;
                dataPoint.ValueY = data[i].Y;
                if (data[i].CanShuNumber == "000003")
                {
                    dataPoint.ValueR = data[i].Y / 5;
                }
                else
                {
                    dataPoint.ValueR = data[i].Y + 30;
                }
                dataPoint.ValueDateTime = data[i].date;

                dataPoint.ValueOfTem = "温度:" + Convert.ToString(data[i].GrainTemp) + "+" + "水分:" + data[i].Water;
                list.Add(dataPoint);
            }
            return(list);
        }
Exemplo n.º 2
0
        public static List <DataPoint> recieveData(string shiYanHao)
        {
            System.Collections.Generic.List <CornPeatsTeXingDataMember.DataValue> data = CornPeatsTeXingDataMember.SelectData.getData(shiYanHao);
            List <DataPoint> list = new List <DataPoint>(data.Count());

            for (int i = 0; i < data.Count(); i++)
            {
                DataPoint dataPoint = new DataPoint();
                dataPoint.ValueX = i + 1;
                dataPoint.ValueY = data[i].Y;

                if (data[i].CanShuNumber == "000005")
                {
                    dataPoint.ValueR = data[i].Y / 10;
                }
                else
                {
                    dataPoint.ValueR = data[i].Y + 30;
                }

                dataPoint.ValueDateTime = data[i].date;

                dataPoint.ValueOfTem = "粮温:" + data[i].InTemp;
                list.Add(dataPoint);
            }
            return(list);
        }
Exemplo n.º 3
0
 public static System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.OrdersPerMonth> GroupRAOrders(int?year, string agentCode)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("OrdersPerMonth", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "GroupRAOrders")) {
         DateTime?d = new DateTime((year).GetValueOrDefault(0), 01, 01, 0, 0, 0, DateTimeKind.Utc);
         System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderWMS>       ordersFiltered = new DSS3_LogisticsPoolingForUrbanDistribution.DAL.Repository().Get <DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderWMS>((or) => or.OrdAgencyCode == agentCode);
         System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.OrdersPerMonth> ordersPerMonth = new System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.OrdersPerMonth>();
         for (var i = 1; i < 13; i = i + 1)
         {
             DSS3_LogisticsPoolingForUrbanDistribution.BO.OrdersPerMonth orderPerMonth = new DSS3_LogisticsPoolingForUrbanDistribution.BO.OrdersPerMonth();
             orderPerMonth.Label = i.ToString(); DateTime?currentMonth = new DateTime(int.Parse((year?.ToString() ?? "")), int.Parse(i.ToString()), 01, 0, 0, 0, DateTimeKind.Utc);
             int?     j         = new int?();
             DateTime?nextMonth = new DateTime?();
             if ((i == 12))
             {
                 year = year.GetValueOrDefault(0) + 1; j = 01; nextMonth = new DateTime(int.Parse((year?.ToString() ?? "")), int.Parse((j?.ToString() ?? "")), 01, 0, 0, 0, DateTimeKind.Utc);
             }
             else
             {
                 j = i + 1; nextMonth = new DateTime(int.Parse((year?.ToString() ?? "")), int.Parse((j?.ToString() ?? "")), 01, 0, 0, 0, DateTimeKind.Utc);
             }
             zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "OrdersPerMonth", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, "Current month " + currentMonth.GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value) + " next month " + nextMonth.GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value));
             System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderWMS> ordersCounted = ordersFiltered?.Where((ord) => ord.OrdRegDateTime >= currentMonth && ord.OrdRegDateTime < nextMonth).ToList();
             orderPerMonth.Value = (ordersCounted?.Count() ?? 0); ordersPerMonth?.Add(orderPerMonth);
         }
         return(ordersPerMonth);
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// Проверяет БД на наличие записей о группах,
        /// если таковых нет вообще, то метод добавляет
        /// указанные в ТЗ
        /// </summary>
        private void CheckGroupsInDb(object sender, RoutedEventArgs e)
        {
            bool isEmpty = false;

            using (DataModelContext context = new DataModelContext())
            {
                System.Collections.Generic.List <Group> groups = context.Groups.ToList();
                if (groups.Count() == 0)
                {
                    isEmpty = true;

                    Group g1 = new Group {
                        Name = "Manager", SubNumberCoeff = 0.005D, YearsCoefficient = 0.05D, Limit = 0.4D
                    };
                    Group g2 = new Group {
                        Name = "Salesman", SubNumberCoeff = 0.003D, YearsCoefficient = 0.01D, Limit = 0.35D
                    };
                    Group g3 = new Group {
                        Name = "Employee", SubNumberCoeff = 0D, YearsCoefficient = 0.03D, Limit = 0.3D
                    };
                    context.Groups.Add(g1);
                    context.Groups.Add(g2);
                    context.Groups.Add(g3);
                    context.SaveChanges();
                }
            }

            if (isEmpty == true)
            {
                ExampleClass Test = new ExampleClass();
                Test.AddTestPersons();
            }
        }
        static void Main(string[] args)
        {
            //var srcPath = @"C:\Users\a.de.melo.pinheiro\Downloads\drive-download-20201226T220426Z-001\Teste0";
            var srcPath = @"C:\Users\a.de.melo.pinheiro\Downloads\drive-download-20201226T220426Z-001\Massas de teste";
            var dstPath = @$ "{srcPath}\Crops3";

            InitializeGoogleCredentials();

            //var fileList = System.IO.Directory.EnumerateFiles(srcPath);
            var fileList = new System.Collections.Generic.List <string>();

            fileList.Add(@"C:\Users\a.de.melo.pinheiro\Downloads\drive-download-20201226T220426Z-001\Massas de teste\ROI_save.png");
            var index = 0;
            var total = fileList.Count();

            foreach (var item in fileList)
            {
                Console.WriteLine($"Progress: {index}/{total} - {(index / total) * 100}%");

                var btm = DrawUtils.GetBitmapFromPath(item);
                btm.Save(Path.Combine(dstPath, Path.GetFileName(item)));
                var cropBoxes = CloudVisionTextExtraction.GetTextExtraction(item, btm);

                ExtractFields(btm, dstPath, item, cropBoxes);

                ExtractOptionsFields(btm, dstPath, item, cropBoxes);
                index++;
            }
        }
Exemplo n.º 6
0
        public void ResourceAssembliesProperlyDetermined()
        {
            var packageAssemblyName = "solution.resources";
            var libs = new System.Collections.Generic.List <string>()
            {
                "lib/" + packageAssemblyName + ".dll",
                "lib/net40/" + packageAssemblyName + ".dll",
                "lib/net40/" + packageAssemblyName + "a.dll",
                "lib/net40/" + packageAssemblyName + "b.dll",
                "lib/net45/" + packageAssemblyName + ".dll",
                "lib/" + packageAssemblyName + "_extra.dll",
                "lib/" + packageAssemblyName + ".js",
            };

            var assembliesCount = libs.Count() - 1; // one is ignored because of the ext.

            foreach (var culture in CultureInfo.GetCultures(CultureTypes.AllCultures).Where(p => !string.IsNullOrEmpty(p.Name)).Select(c => c.Name))
            {
                // Add all non-standart cultures.
                libs.Add("lib/net45/" + culture + "/" + packageAssemblyName + ".resources.dll");
            }

            var asemblyReferencesCount = libs.Where(p => PackageReaderBase.IsAssemblyReference(p)).Count();

            Assert.Equal(asemblyReferencesCount, assembliesCount);
        }
 public char[][] mergeFiles(System.Collections.Generic.List <string[]> args)
 {
     char[][] ar = new char[args.First().Length][];
     for (int i = 0; i < ar.Length; i++)
     {
         ar[i] = new char[args.First()[0].Length];
     }
     for (int i = 0; i < args.Count(); i++)
     {
         if (args[i].Length != ar.Length)
         {
             return(null);
         }
         for (int j = 0; j < args.First().Length; j++)
         {
             if (args[i][j].Length != ar[0].Length)
             {
                 return(null);
             }
             for (int k = 0; k < args.First()[0].Length; k++)
             {
                 if (args[i][j][k] != ' ')
                 {
                     ar[j][k] = args[i][j][k];
                 }
             }
         }
     }
     return(ar);
 }
        /// <summary>
        /// لیست نمادها رو یک به یک بازکرده و آدرس صفحه اطلاعاتی آن ها را بازیابی کرده و از طریق اون صفحه
        /// اطلاعات رو ثبت می کنه
        /// </summary>
        /// <param name="baseUrl"></param>
        /// <param name="finalStocksList"></param>
        /// <returns></returns>
        public async Task SaveStockList(string baseUrl, string finalStocksList, Enums.MarketTypeEnum marketType)
        {
            HtmlDocument stocksListDocument = new HtmlDocument();

            stocksListDocument.LoadHtml(finalStocksList);
            HtmlNode stockNameNode = stocksListDocument.DocumentNode.SelectSingleNode("//tbody");

            //_unitOfWork.StockService.DeleteAll(Enums.MarketTypeEnum.FaraBoors);
            //await _unitOfWork.SaveAsync();
            foreach (HtmlNode rowElement in stockNameNode.ChildNodes)
            {
                System.Collections.Generic.List <HtmlNode> items = rowElement.Descendants().Where(a => a.Name.ToLower() == "td").ToList();
                if (items != null && items.Count() > 0)
                {
                    string stockName = items[0].InnerText;
                    foreach (var atag in items[0].ChildNodes)
                    {
                        //آدرس مشخصات سهم
                        string url = atag.Attributes["href"].Value;
                        if (!string.IsNullOrEmpty(url))
                        {
                            await ParsAndSaveStockInfo(baseUrl + url, marketType);
                        }
                    }
                }
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// Refresh Customer's custom ServerCalculated field 'AddressCount' on insert or delete
        /// </summary>
        /// <param name="changeSet"></param>
        /// <param name="refreshResult"></param>
        /// <returns></returns>
        public override async Task AfterChangeSetCommited(ChangeSetRequest changeSet, SubResultList refreshResult)
        {
            DbSetInfo custAddrDbSet = this.GetSetInfosByEntityType(typeof(CustomerAddress)).Single();
            DbSetInfo customerDbSet = this.GetSetInfosByEntityType(typeof(Customer)).Single();

            DbSet dbCustAddr = changeSet.dbSets.FirstOrDefault(d => d.dbSetName == custAddrDbSet.dbSetName);

            if (dbCustAddr != null)
            {
                int[] custIDs = dbCustAddr.rows.Where(r => r.changeType == ChangeType.Deleted || r.changeType == ChangeType.Added).Select(r => r.values.First(v => v.fieldName == "CustomerId").val).Select(id => int.Parse(id)).ToArray();

                System.Collections.Generic.List <Customer> customersList = await DB.Customer.AsNoTracking().Where(c => custIDs.Contains(c.CustomerId)).ToListAsync();

                System.Collections.Generic.List <int> customerAddress = await DB.CustomerAddress.AsNoTracking().Where(ca => custIDs.Contains(ca.CustomerId)).Select(ca => ca.CustomerId).ToListAsync();

                customersList.ForEach(customer =>
                {
                    customer.AddressCount = customerAddress.Count(id => id == customer.CustomerId);
                });

                SubResult subResult = new SubResult
                {
                    dbSetName = customerDbSet.dbSetName,
                    Result    = customersList
                };
                refreshResult.Add(subResult);
            }
        }
Exemplo n.º 10
0
        public async Task <IActionResult> Dashboard()
        {
            System.Collections.Generic.List <Application> applications = await _context.Application.ToListAsync();

            Dashboard dashboard = new Dashboard
            {
                Applications = applications.Count()
            };

            foreach (Application application in applications)
            {
                if (application.Status.Equals("Accepted"))
                {
                    dashboard.Accepted++;
                }
                else if (application.Status.Equals("Rejected"))
                {
                    dashboard.Rejected++;
                }
                else if (application.Status.Equals("Pending") && (dashboard.PendingApplications.Count <= 5))
                {
                    dashboard.PendingApplications.Add(application);
                }
            }
            return(View(dashboard));
        }
Exemplo n.º 11
0
        private static void DownloadFinancialData(System.Collections.Generic.List <CompanyDetail> miniCompDetails, int downloadStart)
        {
            Stopwatch stopWatch        = new Stopwatch();
            int       counter          = 0;
            int       downloadCount    = downloadStart;
            var       handleFinancials = Provider.GetService <HandleFinacials>();
            var       listCount        = miniCompDetails.Count();

            foreach (var company in miniCompDetails)
            {
                stopWatch.Reset();
                stopWatch.Start();
                Console.WriteLine($"Working on {++counter} of {listCount}  => {company.Name}; its Ticker is {company.Ticker}");
                var getFinanceStatus = handleFinancials.UpdateStatements(company.SimId).Result;
                var status           = getFinanceStatus ? "Success" : "Failed";
                Console.WriteLine($"Financial for {company.Name} obtained {status}");
                stopWatch.Stop();
                var msg = company.Name + " took ";
                DisplayTimeTaken(stopWatch, msg);
                downloadCount += stopWatch.Elapsed.Seconds > 4 ? 1 : 0;
                //var limit = financialDownloadLimit;
                if (downloadCount >= financialDownloadLimit)
                {
                    Console.WriteLine($"Obtained data for more than {financialDownloadLimit} companies. Terminating this run.");
                    break;
                }
                else
                {
                    Console.WriteLine($"Downloaded {downloadCount} against allocated quota of {financialDownloadLimit} for this run");
                }
            }
        }
Exemplo n.º 12
0
        private int GetCountryCount(System.Collections.Generic.List <Models.Book> Books)
        {
            int count =
                Books
                .Count();

            return(count);
        }
Exemplo n.º 13
0
        protected void Update()
        {
            if (State != NodeState.Running)
            {
                return;
            }

            if (nodes.Count(x => x.State == NodeState.Succeed) > 0)
            {
                FinishNode(NodeState.Succeed, NodeState.Disable);
            }

            if (nodes.Count(x => x.State == NodeState.Failed) == nodes.Count)
            {
                FinishNode(NodeState.Failed, NodeState.Failed);
            }
        }
Exemplo n.º 14
0
                /**
                 * This protected method selects one item by its index.
                 */
                protected void SelectOne(int index, bool relative = false)
                {
                    if (items == null)
                    {
                        return;
                    }

                    if (!multiSelect)
                    {
                        selectedItems.Clear();
                    }
                    if (relative)
                    {
                        index = (index + position) % items.Count();
                    }
                    selectedItems.Add(items[index]);
                    RenderItems();
                }
 public static System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.SLAStatistics> ItemDeliveryPercentageWithCriteria(System.Collections.Generic.List <int?> supplierIds, System.Collections.Generic.List <int?> warehouseIds, System.Collections.Generic.List <int?> businessUnitIds, System.Collections.Generic.List <int?> categoryIds, System.Collections.Generic.List <int?> subCategoryIds, System.Collections.Generic.List <int?> baseUnitIds, System.Collections.Generic.List <string> SKUs, DateTime?fromDate, DateTime?toDate)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("SLADelivery", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "ItemDeliveryPercentageWithCriteria")) {
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.SLAStatistics> stats = new System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.SLAStatistics>();
         System.Collections.Generic.List <int?>   emptyIDs  = new System.Collections.Generic.List <int?>();
         System.Collections.Generic.List <string> emptySKUs = new System.Collections.Generic.List <string>();
         if ((warehouseIds == null))
         {
             warehouseIds = emptyIDs.ToList();
         }
         if ((SKUs == null))
         {
             SKUs = emptySKUs.ToList();
         }
         if ((businessUnitIds == null))
         {
             businessUnitIds = emptyIDs.ToList();
         }
         if ((categoryIds == null))
         {
             categoryIds = emptyIDs.ToList();
         }
         if ((subCategoryIds == null))
         {
             subCategoryIds = emptyIDs.ToList();
         }
         if ((baseUnitIds == null))
         {
             baseUnitIds = emptyIDs.ToList();
         }
         if ((supplierIds == null))
         {
             supplierIds = emptyIDs.ToList();
         }
         var _var0 = (fromDate?.Month ?? 0); var _var1 = (toDate?.Month ?? 0); System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.SLADelivery> filteredDeliveries = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().Get <DSS1_RetailerDriverStockOptimisation.BO.SLADelivery>((a) => (SKUs.Count() == 0 || SKUs.Contains(a.Item.SKU)) && (businessUnitIds.Count() == 0 || businessUnitIds.Contains((a.Item.BusinessUnit.Id).GetValueOrDefault(0))) && (categoryIds.Count() == 0 || categoryIds.Contains((a.Item.Category.Id).GetValueOrDefault(0))) && (subCategoryIds.Count() == 0 || subCategoryIds.Contains((a.Item.SubCategory.Id).GetValueOrDefault(0))) && (baseUnitIds.Count() == 0 || baseUnitIds.Contains((a.Item.BaseUnit.Id).GetValueOrDefault(0))) && (supplierIds.Count() == 0 || supplierIds.Contains((a.Item.Supplier.Id).GetValueOrDefault(0))) && (warehouseIds.Count() == 0 || warehouseIds.Contains((a.Warehouse.Id).GetValueOrDefault(0))) && (fromDate == null || a.Month >= _var0) && (toDate == null || a.Month <= _var1));
         System.Collections.Generic.List <int?> uniqueMonths = filteredDeliveries?.Select((a) => a.Month).ToList().Distinct().ToList().OrderBy((a) => a).ToList();
         if (SKUs.Contains("4047706") && SKUs.Count() == 1)
         {
             zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "SLADelivery", DSS1_RetailerDriverStockOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Months: " + uniqueMonths.Count());
         }
         foreach (var i in uniqueMonths ?? Enumerable.Empty <int?>())
         {
             System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.SLADelivery> thisMonthsDeliveries = filteredDeliveries?.Where((a) => a.Month == i).ToList();
             if ((thisMonthsDeliveries?.Count() == 0))
             {
                 continue;
             }
             if (SKUs.Contains("4047706") && SKUs.Count() == 1)
             {
                 zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "SLADelivery", DSS1_RetailerDriverStockOptimisation.Hubs.EventsHub.RaiseDebugMessage, "thisMonthsDeliveries: " + (thisMonthsDeliveries?.Count() ?? 0));
             }
             DSS1_RetailerDriverStockOptimisation.BO.SLAStatistics stat = new DSS1_RetailerDriverStockOptimisation.BO.SLAStatistics();
             stat.Percentage = (thisMonthsDeliveries?.Sum((a) => a.Percentage) ?? 0) / (thisMonthsDeliveries?.Count() ?? 0); stat.Percentage = Math.Round((stat?.Percentage ?? 0), 2); stat.Month = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName((i).GetValueOrDefault(0)); stat.Threshold = 80; stats?.Add(stat);
         }
         return(stats);
     }
 }
Exemplo n.º 16
0
        private void RegisterForm_Load(object sender, System.EventArgs e)
        {
            int newUserNumber;

            #region first open
            if (Infrastructure.Utility.EndUserId == string.Empty || Infrastructure.Utility.EndUserId == null)
            {
                Models.DatabaseContext databaseContext = null;
                try
                {
                    databaseContext = new Models.DatabaseContext();

                    System.Collections.Generic.List <Models.User> endUser = null;

                    endUser =
                        databaseContext.Users
                        .OrderBy(current => current.Id)
                        .ToList();

                    newUserNumber = endUser.Count();


                    Infrastructure.Utility.EndUserId = newUserNumber.ToString();
                }
                catch (System.Exception ex)
                {
                    System.Windows.Forms.MessageBox.Show(ex.Message);

                    return;
                }
                finally
                {
                    if (databaseContext != null)
                    {
                        databaseContext.Dispose();

                        databaseContext = null;
                    }
                }
            }

            #endregion /first open

            #region next open
            else
            {
                newUserNumber = System.Convert.ToInt32(Infrastructure.Utility.EndUserId);
            }

            #endregion /next open

            newUserNumber++;

            userCodeTextBox.Text = newUserNumber.ToString();

            TextBoxBackColor = usernameTextBox.BackColor;
        }
        public void fctPlay(NLX.Robot.Kuka.Controller.RobotController rob)
        {
            if (listPos.Count() != 0)
            {
                // play the list, then empty it
                rob.PlayTrajectory(listPos);

                listPos.Clear();
            }
        }
Exemplo n.º 18
0
        public static IQueryable <ViewEntity> OrderByList <ViewEntity>(this IQueryable <ViewEntity> queryable, System.Collections.Generic.List <string> OrderNamesList)
        {
            for (var i = 0; i < OrderNamesList.Count(); i++)
            {
                var isAsc       = true;
                var param       = OrderNamesList[i];
                var param_split = param.Split(' ');
                if (param_split.Count() == 2)
                {
                    if (param_split[1].ToUpper() == "ASC")
                    {
                        isAsc = true;
                    }
                    if (param_split[1].ToUpper() == "DESC")
                    {
                        isAsc = false;
                    }
                }
                param = param_split[0];

                var propertyInfo = typeof(ViewEntity).GetProperty(param);
                if (propertyInfo == null)
                {
                    param        = param.ToUpperFirstIndexStringBuilder();
                    propertyInfo = typeof(ViewEntity).GetProperty(param);
                }
                if (i == 0)
                {
                    if (isAsc)
                    {
                        queryable = queryable.OrderBy(x => propertyInfo.GetValue(x, null));
                    }
                    else
                    {
                        queryable = queryable.OrderByDescending(x => propertyInfo.GetValue(x, null));
                    }
                }
                else
                {
                    if (isAsc)
                    {
                        queryable = ((IOrderedQueryable <ViewEntity>)queryable).ThenBy(x => propertyInfo.GetValue(x, null)).AsQueryable();
                    }
                    else
                    {
                        queryable = ((IOrderedQueryable <ViewEntity>)queryable).ThenByDescending(x => propertyInfo.GetValue(x, null)).AsQueryable();
                    }
                }
            }

            return(queryable);
        }
Exemplo n.º 19
0
        // GET: indicadoresAsesor
        public ActionResult Index(int?menu)
        {
            string[] meses =
            {
                "",          "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre",
                "Noviembre", "Diciembre"
            };
            int asesor_logeado = Convert.ToInt32(Session["user_usuarioid"]);

            ViewBag.mes_actual = meses[DateTime.Now.Month];

            System.Collections.Generic.List <vpedido> cant_pedidos = context.vpedido.Where(x =>
                                                                                           x.vendedor == asesor_logeado && x.fecha.Month == DateTime.Now.Month &&
                                                                                           x.fecha.Year == DateTime.Now.Year && x.anulado == false).ToList();
            ViewBag.cant_pedidos  = cant_pedidos.Count();
            ViewBag.datos_pedidos = cant_pedidos;

            //var vh_entregados = (from e in context.icb_vehiculo_eventos
            //                     join l in context.lineas_documento
            //                     on e.planmayor equals l.codigo
            //                     where e.id_tpevento == 14
            //                     && e.fechaevento.Month == DateTime.Now.Month
            //                     select new {
            //                         e.planmayor,
            //                         e.placa,
            //                         nombre =  e.icb_terceros.prinom_tercero
            //                     }).ToList();

            System.Collections.Generic.List <icb_vehiculo_eventos> vh_entregados = context.icb_vehiculo_eventos.Where(x =>
                                                                                                                      x.fechaevento.Month == DateTime.Now.Month && x.fechaevento.Year == DateTime.Now.Year &&
                                                                                                                      x.id_tpevento == 14).ToList();
            ViewBag.vh_entregados       = vh_entregados.Count();
            ViewBag.datos_vh_entregados = vh_entregados;


            System.Collections.Generic.List <v_creditos> cred_aprobados = context.v_creditos.Where(x => x.fec_aprobacion.Value.Month == DateTime.Now.Month &&
                                                                                                   x.fec_aprobacion.Value.Year == DateTime.Now.Year &&
                                                                                                   x.asesor_id == asesor_logeado).ToList();
            ViewBag.cred_aprobados       = cred_aprobados.Count();
            ViewBag.datos_cred_aprobados = cred_aprobados;


            System.Collections.Generic.List <v_creditos> comisiones = context.v_creditos.Where(c => c.fec_facturacomision.Value.Month == DateTime.Now.Month &&
                                                                                               c.fec_facturacomision.Value.Year == DateTime.Now.Year &&
                                                                                               c.asesor_id == asesor_logeado).ToList();
            ViewBag.comisiones_hoy   = comisiones.Sum(x => x.valor_comision);
            ViewBag.datos_comisiones = comisiones;
            BuscarFavoritos(menu);
            return(View());
        }
Exemplo n.º 20
0
        /// <summary>
        /// Serializes the group furni page.
        /// </summary>
        internal void SerializeGroupFurniPage()
        {
            try
            {
                var userGroups = Plus.GetGame().GetGroupManager().GetUserGroups(Session.GetHabbo().Id);
                Response.Init(LibraryParser.OutgoingRequest("GroupFurniturePageMessageComposer"));

                var responseList = new System.Collections.Generic.List <ServerMessage>();
                foreach (
                    var @group in
                    userGroups.Where(current => current != null).Select(
                        current => Plus.GetGame().GetGroupManager().GetGroup(current.GroupId)))
                {
                    if (@group == null)
                    {
                        continue;
                    }
                    var subResponse = new ServerMessage();
                    subResponse.AppendInteger(@group.Id);
                    subResponse.AppendString(@group.Name);
                    subResponse.AppendString(@group.Badge);
                    subResponse.AppendString(
                        Plus.GetGame().GetGroupManager().SymbolColours.Contains(@group.Colour1)
                            ? ((GroupSymbolColours)
                               Plus.GetGame().GetGroupManager().SymbolColours[@group.Colour1]).Colour
                            : "4f8a00");
                    subResponse.AppendString(
                        Plus.GetGame().GetGroupManager().BackGroundColours.Contains(@group.Colour2)
                            ? ((GroupBackGroundColours)
                               Plus.GetGame().GetGroupManager().BackGroundColours[@group.Colour2]).Colour
                            : "4f8a00");
                    subResponse.AppendBool(@group.CreatorId == Session.GetHabbo().Id);
                    subResponse.AppendInteger(@group.CreatorId);
                    subResponse.AppendBool(@group.HasForum);

                    responseList.Add(subResponse);
                }
                Response.AppendInteger(responseList.Count());
                Response.AppendServerMessages(responseList);

                responseList.Clear();
                responseList = null;

                SendResponse();
            }
            catch (System.Exception e)
            {
                System.Console.WriteLine(e);
            }
        }
Exemplo n.º 21
0
 public static System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.SLAStatistics> CalculateOrderForecastAccuracy(System.Collections.Generic.List <int?> supplierIds, System.Collections.Generic.List <int?> warehouseIds, System.Collections.Generic.List <int?> businessUnitIds, System.Collections.Generic.List <int?> categoryIds, System.Collections.Generic.List <int?> subCategoryIds, System.Collections.Generic.List <int?> baseUnitIds, System.Collections.Generic.List <string> SKUs, DateTime?fromDate, DateTime?toDate)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("Platform", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "CalculateOrderForecastAccuracy")) {
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.SLAStatistics> stats = new System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.SLAStatistics>();
         System.Collections.Generic.List <int?>   emptyIDs  = new System.Collections.Generic.List <int?>();
         System.Collections.Generic.List <string> emptySKUs = new System.Collections.Generic.List <string>();
         if ((warehouseIds == null))
         {
             warehouseIds = emptyIDs.ToList();
         }
         if ((SKUs == null))
         {
             SKUs = emptySKUs.ToList();
         }
         if ((businessUnitIds == null))
         {
             businessUnitIds = emptyIDs.ToList();
         }
         if ((categoryIds == null))
         {
             categoryIds = emptyIDs.ToList();
         }
         if ((subCategoryIds == null))
         {
             subCategoryIds = emptyIDs.ToList();
         }
         if ((baseUnitIds == null))
         {
             baseUnitIds = emptyIDs.ToList();
         }
         if ((supplierIds == null))
         {
             supplierIds = emptyIDs.ToList();
         }
         var _var0 = (fromDate?.Month ?? 0); var _var1 = (toDate?.Month ?? 0); System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Platform> filteredPlatforms = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().Get <DSS1_RetailerDriverStockOptimisation.BO.Platform>((a) => (SKUs.Count() == 0 || SKUs.Contains(a.Item.SKU)) && (businessUnitIds.Count() == 0 || businessUnitIds.Contains((a.Item.BusinessUnit.Id).GetValueOrDefault(0))) && (categoryIds.Count() == 0 || categoryIds.Contains((a.Item.Category.Id).GetValueOrDefault(0))) && (subCategoryIds.Count() == 0 || subCategoryIds.Contains((a.Item.SubCategory.Id).GetValueOrDefault(0))) && (baseUnitIds.Count() == 0 || baseUnitIds.Contains((a.Item.BaseUnit.Id).GetValueOrDefault(0))) && (supplierIds.Count() == 0 || supplierIds.Contains((a.Item.Supplier.Id).GetValueOrDefault(0))) && (warehouseIds.Count() == 0 || warehouseIds.Contains((a.Warehouse.Id).GetValueOrDefault(0))) && (fromDate == null || int.Parse(a.Month) >= _var0) && (toDate == null || int.Parse(a.Month) <= _var1));
         System.Collections.Generic.List <int?> uniqueMonths = filteredPlatforms?.Select((a) => int.Parse(a.Month)).Select(_n => _n as int?).ToList().Distinct().ToList().OrderBy((a) => a).ToList();
         foreach (var i in uniqueMonths ?? Enumerable.Empty <int?>())
         {
             System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Platform> thisMonthsPlatforms = filteredPlatforms?.Where((a) => int.Parse(a.Month) == i).ToList();
             if ((thisMonthsPlatforms?.Count() == 0))
             {
                 continue;
             }
             DSS1_RetailerDriverStockOptimisation.BO.SLAStatistics stat = new DSS1_RetailerDriverStockOptimisation.BO.SLAStatistics();
             stat.Percentage = (thisMonthsPlatforms?.Sum((a) => a.percentage) ?? 0) / (thisMonthsPlatforms?.Count() ?? 0); stat.Percentage = Math.Round((stat?.Percentage ?? 0), 2) / 100; stat.Month = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName((i).GetValueOrDefault(0)); stat.Threshold = 80; stats?.Add(stat);
         }
         return(stats);
     }
 }
Exemplo n.º 22
0
        public void TestMethodTranslate()
        {
            System.Collections.Generic.List <GlobalStructureInfo> AllStructures = new System.Collections.Generic.List <GlobalStructureInfo>();

            var UnusedObjects = CleanUp.GetUnusedObjects(
                Path.Combine(@"C:\steamcmd\empyrion\Saves\Games\Server\Shared"),
                AllStructures).ToArray();

            var PossibleCleanUpObjects = UnusedObjects.Where(O => (DateTime.Now - O.LastAccess).TotalDays > 14).ToArray();

            var usedTypes = AllStructures.Distinct(new StructureTypeEqualityComparer());
            var Result    =
                usedTypes.Aggregate("", (L, T) => L + T.type + ": " + AllStructures.Count(S => S.type == T.type)) + "\n" +
                $"Unused:{UnusedObjects.Length} ({UnusedObjects.Aggregate(0L, (S, O) => S + O.GetSize()) / (1024 * 1024):N2}MB) possible CleanUp:{PossibleCleanUpObjects.Length} ({PossibleCleanUpObjects.Aggregate(0L, (S, O) => S + O.GetSize()) / (1024 * 1024):N2}MB)"
            ;
        }
Exemplo n.º 23
0
        private void InitializeListOfItems(System.Collections.Generic.List <Models.Transactions> employeeTransactions)
        {
            Items = new ObservableCollection <HistoricTransactionViewModel>();

            foreach (var transaction in employeeTransactions)
            {
                var cigar = Task.Run(async() => await _context.CigaretteRepository.GetCigaretteById(transaction.CigaretteID)).Result;
                Items.Add(new HistoricTransactionViewModel()
                {
                    CigarId   = transaction.CigaretteID,
                    CigarName = cigar.Name,
                    Quantity  = employeeTransactions.Count(tr => tr.CigaretteID == transaction.CigaretteID),
                    Time      = transaction.Time
                });
            }
        }
Exemplo n.º 24
0
        public void GetCoinInformation_ReturnsCoinInformation()
        {
            //act
            System.Collections.Generic.List <CoinInformation> coinInformation = ApiContext.GetCoinInformation();

            //assert
            Assert.IsTrue(coinInformation.Count > 0);
            Assert.IsTrue(coinInformation.Count(c => c.AdjustedProfitability > 0.00) > 0);
            Assert.IsTrue(coinInformation.Count(c => c.Price > 0.00) > 0);
            Assert.IsTrue(coinInformation.Count(c => c.Profitability > 0.00) > 0);
            Assert.IsTrue(coinInformation.Count(c => c.AverageProfitability > 0.00) > 0);
            Assert.IsTrue(coinInformation.Count(c => c.Difficulty > 0.00) > 0);
            Assert.IsTrue(coinInformation.Count(c => c.Algorithm.Equals("scrypt")) > 0);
            Assert.IsTrue(coinInformation.Count(c => c.Algorithm.Equals("SHA-256")) > 0);
        }
Exemplo n.º 25
0
        // GET: vdocumentosflota/Edit/5
        public ActionResult Edit(int?id, int?menu)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            System.Collections.Generic.List <vdocumentosflota> vdocumentosflota = db.vdocumentosflota.Where(x => x.iddocumento == id).ToList();
            if (vdocumentosflota.Count() == 0)
            {
                return(HttpNotFound());
            }

            var listaDocu = (from td in db.tipo_documentos
                             select new
            {
                td.id,
                nombre = td.tipo_nombre
            }).ToList();

            System.Collections.Generic.IEnumerable <int> numerodocumentos = vdocumentosflota.Select(d => d.id_tipo_documento);
            // ViewBag.tercero_id = new SelectList(terceros, "id", "docyNombre");
            ViewBag.tdocumento = new MultiSelectList(listaDocu, "id", "nombre", numerodocumentos);
            ViewBag.docFlotas  =
                new SelectList(db.documento_facturacion.Where(x => x.docfac_estado).OrderBy(x => x.docfac_nombre),
                               "docfac_id", "docfac_nombre", vdocumentosflota.First().iddocumento);

            vdocumentosflotaform docu = new vdocumentosflotaform
            {
                iddocumento          = vdocumentosflota.First().iddocumento.Value,
                documento            = vdocumentosflota.First().documento,
                estado               = vdocumentosflota.First().estado,
                id_tipo_documento    = vdocumentosflota.First().id_tipo_documento,
                razon_inactivo       = vdocumentosflota.First().razon_inactivo,
                id_licencia          = vdocumentosflota.First().id_licencia,
                fec_actualizacion    = vdocumentosflota.First().fec_actualizacion,
                fec_creacion         = vdocumentosflota.First().fec_creacion,
                userid_creacion      = vdocumentosflota.First().userid_creacion,
                user_idactualizacion = vdocumentosflota.First().user_idactualizacion
            };

            ConsultaDatosCreacion(docu);
            BuscarFavoritos(menu);
            return(View(docu));
        }
Exemplo n.º 26
0
        //bing 번역기로부터 번역문 얻기
        private static Translation TranslateString(TranslatorContainer tc, string inputString, string transCode, string resultCode)
        {
            System.Data.Services.Client.DataServiceQuery <MORT.TransFormOver.Translation> translationQuery = tc.Translate(inputString, resultCode, transCode);

            // Call the query and get the results as a List
            System.Collections.Generic.List <MORT.TransFormOver.Translation> translationResults = translationQuery.Execute().ToList();

            // Verify there was a result
            if (translationResults.Count() <= 0)
            {
                return(null);
            }

            // In case there were multiple results, pick the first one
            Translation translationResult = translationResults.First();

            return(translationResult);
        }
 private string Get_CurrentAgreementStatus()
 {
     if (this?.agreementStatus != null)
     {
         System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.AgreementStatus> firstAgreementStatus = this?.agreementStatus?.OrderByDescending((a) => a.DateOccured).ToList();
         if (((firstAgreementStatus?.Count() ?? 0) > 0))
         {
             return(firstAgreementStatus?.FirstOrDefault()?.Status ?? "");
         }
         else
         {
             return("");
         }
     }
     else
     {
         return("");
     }
 }
 public static string Get_CurrentAgreementStatus(this BO.Agreement @this)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("Agreement", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "Get_CurrentAgreementStatus")) {
         if (@this?.AgreementStatus != null)
         {
             System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.AgreementStatus> firstAgreementStatus = @this?.AgreementStatus?.OrderByDescending((a) => a.DateOccured).ToList();
             if (((firstAgreementStatus?.Count() ?? 0) > 0))
             {
                 return(firstAgreementStatus?.FirstOrDefault()?.Status ?? "");
             }
             else
             {
                 return("");
             }
         }
         else
         {
             return("");
         }
     }
 }
Exemplo n.º 29
0
        protected void Update()
        {
            if (State != NodeState.Running)
            {
                return;
            }

            bool isReturn = nodes.Count(x => x.State == NodeState.Succeed || x.State == NodeState.Disable) != nodes.Count;

            if (nodes.Any(x => x.State == NodeState.Failed))
            {
                FinishNode(NodeState.Failed, NodeState.Disable);
            }

            if (isReturn)
            {
                return;
            }

            FinishNode(NodeState.Succeed, NodeState.Succeed);
        }
        public async Task <IViewComponentResult> InvokeAsync(int qtd)
        {
            if (qtd == 0)
            {
                qtd = 10;
            }

            OperationResultListVo <NotificationItemViewModel> result = _notificationAppService.GetByUserId(CurrentUserId, qtd);

            System.Collections.Generic.List <NotificationItemViewModel> model = result.Value.ToList();

            foreach (NotificationItemViewModel item in model)
            {
                item.Url = string.Format("{0}?notificationclicked={1}", item.Url, item.Id);
            }

            model.DefineVisuals();

            ViewData["UnreadCount"] = model.Count(x => !x.IsRead);

            return(await Task.Run(() => View(model)));
        }
Exemplo n.º 31
0
    private void Display_ViewContent()
    {
        m_refMsg = m_refContentApi.EkMsgRef;
        bool bCanAlias = false;
        PermissionData security_task_data;
        StringBuilder sSummaryText;
        Ektron.Cms.UrlAliasing.UrlAliasManualApi m_aliasname = new Ektron.Cms.UrlAliasing.UrlAliasManualApi();
        Ektron.Cms.UrlAliasing.UrlAliasAutoApi m_autoaliasApi = new Ektron.Cms.UrlAliasing.UrlAliasAutoApi();
        Ektron.Cms.Common.UrlAliasManualData d_alias;
        System.Collections.Generic.List<Ektron.Cms.Common.UrlAliasAutoData> auto_aliaslist = new System.Collections.Generic.List<Ektron.Cms.Common.UrlAliasAutoData>();
        Ektron.Cms.UrlAliasing.UrlAliasSettingsApi m_urlAliasSettings = new Ektron.Cms.UrlAliasing.UrlAliasSettingsApi();
        int i;
        bool IsStagingServer;

        IsStagingServer = m_refContentApi.RequestInformationRef.IsStaging;

        security_task_data = m_refContentApi.LoadPermissions(m_intId, "tasks", ContentAPI.PermissionResultType.Task);
        security_data = m_refContentApi.LoadPermissions(m_intId, "content", ContentAPI.PermissionResultType.All);
        security_data.CanAddTask = security_task_data.CanAddTask;
        security_data.CanDestructTask = security_task_data.CanDestructTask;
        security_data.CanRedirectTask = security_task_data.CanRedirectTask;
        security_data.CanDeleteTask = security_task_data.CanDeleteTask;

        active_subscription_list = m_refContentApi.GetAllActiveSubscriptions();

        if ("viewstaged" == m_strPageAction)
        {
            ContentStateData objContentState;
            objContentState = m_refContentApi.GetContentState(m_intId);
            if ("A" == objContentState.Status)
            {
                // Can't view staged
                m_strPageAction = "view";
            }
        }
        try
        {
            if (m_strPageAction == "view")
            {
                content_data = m_refContentApi.GetContentById(m_intId, 0);
            }
            else if (m_strPageAction == "viewstaged")
            {
                content_data = m_refContentApi.GetContentById(m_intId, ContentAPI.ContentResultType.Staged);
            }
        }
        catch (Exception ex)
        {
            Response.Redirect("reterror.aspx?info=" + EkFunctions.UrlEncode(ex.Message), true);
            return;
        }

        if ((content_data != null) && (Ektron.Cms.Common.EkConstants.IsAssetContentType(Convert.ToInt64 (content_data.Type), Convert.ToBoolean (-1))))
        {
            ContentPaneHeight = "700px";
        }
        //ekrw = m_refContentApi.EkUrlRewriteRef()
        //ekrw.Load()
        if (((m_urlAliasSettings.IsManualAliasEnabled || m_urlAliasSettings.IsAutoAliasEnabled) && m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias)) && (content_data != null) && (content_data.AssetData != null) && !(Ektron.Cms.Common.EkFunctions.IsImage((string)("." + content_data.AssetData.FileExtension))))
        {
            bCanAlias = true;
        }

        blog_post_data = new BlogPostData();
        blog_post_data.Categories = (string[])Array.CreateInstance(typeof(string), 0);
        if (content_data.MetaData != null)
        {
            for (i = 0; i <= (content_data.MetaData.Length - 1); i++)
            {
                if ((string)(content_data.MetaData[i].TypeName.ToLower()) == "blog categories")
                {
                    content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace("&#39;", "\'");
                    content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace("&quot", "\"");
                    content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace("&gt;", ">");
                    content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace("&lt;", "<");
                    blog_post_data.Categories = Strings.Split((string)(content_data.MetaData[i].Text), ";", -1, 0);
                }
                else if ((string)(content_data.MetaData[i].TypeName.ToLower()) == "blog pingback")
                {
                    if (!(content_data.MetaData[i].Text.Trim().ToLower() == "no"))
                    {
                        m_bIsBlog = true;
                    }
                    blog_post_data.Pingback = Ektron.Cms.Common.EkFunctions.GetBoolFromYesNo((string)(content_data.MetaData[i].Text));
                }
                else if ((string)(content_data.MetaData[i].TypeName.ToLower()) == "blog tags")
                {
                    blog_post_data.Tags = (string)(content_data.MetaData[i].Text);
                }
                else if ((string)(content_data.MetaData[i].TypeName.ToLower()) == "blog trackback")
                {
                    blog_post_data.TrackBackURL = (string)(content_data.MetaData[i].Text);
                }
            }
        }

        //THE FOLLOWING LINES ADDED DUE TO TASK
        //:BEGIN / PROPOSED BY PAT
        //TODO: Need to recheck this part of the code e.r.
        if (content_data == null)
        {
            if (ContentLanguage != 0)
            {
                if (ContentLanguage.ToString() != (string)(Ektron.Cms.CommonApi.GetEcmCookie()["DefaultLanguage"]))
                {
                    Response.Redirect((string)(Request.ServerVariables["URL"] + "?" + Strings.Replace(Request.ServerVariables["Query_String"], (string)("LangType=" + ContentLanguage), (string)("LangType=" + m_refContentApi.DefaultContentLanguage), 1, -1, 0)), false);
                    return;
                }
            }
            else
            {
                if (ContentLanguage.ToString() != (string)(Ektron.Cms.CommonApi.GetEcmCookie()["DefaultLanguage"]))
                {
                    Response.Redirect((string)(Request.ServerVariables["URL"] + "?" + Request.ServerVariables["Query_String"] + "&LangType=" + m_refContentApi.DefaultContentLanguage), false);
                    return;
                }
            }
        }
        //:END
        if (m_intFolderId == -1)
        {
            m_intFolderId = content_data.FolderId;
        }
        HoldMomentMsg.Text = m_refMsg.GetMessage("one moment msg");

        if ((active_subscription_list == null) || (active_subscription_list.Length == 0))
        {
            phWebAlerts.Visible = false;
            phWebAlerts2.Visible = false;
        }
        content_state_data = m_refContentApi.GetContentState(m_intId);

        jsFolderId.Text = m_intFolderId.ToString ();
        jsIsForm.Text = content_data.Type.ToString ();
        jsBackStr.Text = "back_file=content.aspx";
        if (m_strPageAction.Length > 0)
        {
            jsBackStr.Text += "&back_action=" + m_strPageAction;
        }
        if (Convert.ToString(m_intFolderId).Length > 0)
        {
            jsBackStr.Text += "&back_folder_id=" + m_intFolderId;
        }
        if (Convert.ToString(m_intId).Length > 0)
        {
            jsBackStr.Text += "&back_id=" + m_intId;
        }
        if (Convert.ToString((short)ContentLanguage).Length > 0)
        {
            jsBackStr.Text += "&back_LangType=" + ContentLanguage;
        }
        jsToolId.Text = m_intId.ToString ();
        jsToolAction.Text = m_strPageAction;
        jsLangId.Text = m_refContentApi.ContentLanguage.ToString ();
        if (content_data.Type == 3333)
        {
            ViewCatalogToolBar();
        }
        else
        {
            ViewToolBar();
        }

        if (bCanAlias && content_data.SubType != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData) //And folder_data.FolderType <> 1 Don't Show alias tab for Blogs.
        {
            string m_strAliasPageName = "";

            d_alias = m_aliasname.GetDefaultAlias(content_data.Id);
            if (d_alias.QueryString != "")
            {
                m_strAliasPageName = d_alias.AliasName + d_alias.FileExtension + d_alias.QueryString; //content_data.ManualAlias
            }
            else
            {
                m_strAliasPageName = d_alias.AliasName + d_alias.FileExtension; //content_data.ManualAlias
            }

            if (m_strAliasPageName != "")
            {

                if (IsStagingServer && folder_data.DomainStaging != string.Empty)
                {
                    m_strAliasPageName = (string)("http://" + folder_data.DomainStaging + "/" + m_strAliasPageName);
                }
                else if (folder_data.IsDomainFolder)
                {
                    m_strAliasPageName = (string)("http://" + folder_data.DomainProduction + "/" + m_strAliasPageName);
                }
                else
                {
                    m_strAliasPageName = SitePath + m_strAliasPageName;
                }
                m_strAliasPageName = "<a href=\"" + m_strAliasPageName + "\" target=\"_blank\" >" + m_strAliasPageName + "</a>";
            }
            else
            {
                m_strAliasPageName = " [Not Defined]";
            }
            tdAliasPageName.InnerHtml = m_strAliasPageName;
        }
        else
        {
            phAliases.Visible = false;
            phAliases2.Visible = false;
        }
        auto_aliaslist = m_autoaliasApi.GetListForContent(content_data.Id);
        autoAliasList.InnerHtml = "<div class=\"ektronHeader\">" + m_refMsg.GetMessage("lbl automatic") + "</div>";
        autoAliasList.InnerHtml += "<div class=\"ektronBorder\">";
        autoAliasList.InnerHtml += "<table width=\"100%\">";
        autoAliasList.InnerHtml += "<tr class=\"title-header\">";
        autoAliasList.InnerHtml += "<th>" + m_refMsg.GetMessage("generic type") + "</th>";
        autoAliasList.InnerHtml += "<th>" + m_refMsg.GetMessage("lbl alias name") + "</th>";
        autoAliasList.InnerHtml += "</tr>";
        for (i = 0; i <= auto_aliaslist.Count() - 1; i++)
        {
            autoAliasList.InnerHtml += "<tr class=\"row\">";
            if (auto_aliaslist[i].AutoAliasType == Ektron.Cms.Common.EkEnumeration.AutoAliasType.Folder)
            {
                autoAliasList.InnerHtml += "<td><img src =\"" + m_refContentApi.AppPath + "images/UI/Icons/folder.png\"  alt=\"" + m_refContentApi.EkMsgRef.GetMessage("lbl folder") + "\" title=\"" + m_refContentApi.EkMsgRef.GetMessage("lbl folder") + "\"/ ></td>";
            }
            else
            {
                autoAliasList.InnerHtml += "<td><img src =\"" + m_refContentApi.AppPath + "images/UI/Icons/taxonomy.png\"  alt=\"" + m_refContentApi.EkMsgRef.GetMessage("generic taxonomy lbl") + "\" title=\"" + m_refContentApi.EkMsgRef.GetMessage("generic taxonomy lbl") + "\"/ ></td>";
            }

            if (IsStagingServer && folder_data.DomainStaging != string.Empty)
            {
                autoAliasList.InnerHtml = autoAliasList.InnerHtml + "<td> <a href = \"http://" + folder_data.DomainStaging + "/" + auto_aliaslist[i].AliasName + "\" target=\"_blank\" >" + auto_aliaslist[i].AliasName + " </a></td></tr>";
            }
            else if (folder_data.IsDomainFolder)
            {
                autoAliasList.InnerHtml += "<td> <a href = \"http://" + folder_data.DomainProduction + "/" + auto_aliaslist[i].AliasName + "\" target=\"_blank\" >" + auto_aliaslist[i].AliasName + " </a></td>";
            }
            else
            {
                autoAliasList.InnerHtml += "<td> <a href = \"" + SitePath + auto_aliaslist[i].AliasName + "\" target=\"_blank\" >" + auto_aliaslist[i].AliasName + " </a></td>";
            }
            autoAliasList.InnerHtml += "</tr>";
        }
        autoAliasList.InnerHtml += "</table>";
        autoAliasList.InnerHtml += "</div>";
        if (content_data == null)
        {
            content_data = m_refContentApi.GetContentById(m_intId, 0);
        }
        if (content_data.Type == 3333)
        {
            m_refCatalog = new CatalogEntry(m_refContentApi.RequestInformationRef);
            m_refCurrency = new Currency(m_refContentApi.RequestInformationRef);
            //m_refMedia = MediaData()
            entry_edit_data = m_refCatalog.GetItemEdit(m_intId, ContentLanguage, false);

            Ektron.Cms.Commerce.ProductType m_refProductType = new Ektron.Cms.Commerce.ProductType(m_refContentApi.RequestInformationRef);
            prod_type_data = m_refProductType.GetItem(entry_edit_data.ProductType.Id, true);

            if (prod_type_data.Attributes.Count == 0)
            {
                phAttributes.Visible = false;
                phAttributes2.Visible = false;
            }

            Display_PropertiesTab(content_data);
            Display_PricingTab();
            Display_ItemTab();
            Display_MetadataTab();
            Display_MediaTab();
        }
        else
        {
            ViewContentProperties(content_data);
            phCommerce.Visible = false;
            phCommerce2.Visible = false;
            phItems.Visible = false;
        }

        bool bPackageDisplayXSLT = false;
        string CurrentXslt = "";
        int XsltPntr;

        if ((!(content_data.XmlConfiguration == null)) && (content_data.Type == Ektron.Cms.Common.EkConstants.CMSContentType_CatalogEntry || content_data.Type == Ektron.Cms.Common.EkConstants.CMSContentType_Content || content_data.Type == Ektron.Cms.Common.EkConstants.CMSContentType_Forms))
        {
            if (!(content_data.XmlConfiguration == null))
            {
                if (content_data.XmlConfiguration.DefaultXslt.Length > 0)
                {
                    if (content_data.XmlConfiguration.DefaultXslt == "0")
                    {
                        bPackageDisplayXSLT = true;
                    }
                    else
                    {
                        bPackageDisplayXSLT = false;
                    }
                    if (!bPackageDisplayXSLT)
                    {
                        XsltPntr = int.Parse(content_data.XmlConfiguration.DefaultXslt);
                        if (XsltPntr > 0)
                        {
                            Collection tmpXsltColl = (Collection)content_data.XmlConfiguration.PhysPathComplete;
                            if (tmpXsltColl["Xslt" + XsltPntr] != null)
                            {
                                CurrentXslt = (string)(tmpXsltColl["Xslt" + XsltPntr]);
                            }
                            else
                            {
                                tmpXsltColl = (Collection)content_data.XmlConfiguration.LogicalPathComplete;
                                CurrentXslt = (string)(tmpXsltColl["Xslt" + XsltPntr]);
                            }
                        }
                    }
                }
                else
                {
                    bPackageDisplayXSLT = true;
                }
                //End If

                Ektron.Cms.Xslt.ArgumentList objXsltArgs = new Ektron.Cms.Xslt.ArgumentList();
                objXsltArgs.AddParam("mode", string.Empty, "preview");
                if (bPackageDisplayXSLT)
                {
                    divContentHtml.InnerHtml = m_refContentApi.XSLTransform(content_data.Html, content_data.XmlConfiguration.PackageDisplayXslt, false, false, objXsltArgs, true, true);
                }
                else
                {
                    // CurrentXslt is always obtained from the object in the database.
                    divContentHtml.InnerHtml = m_refContentApi.XSLTransform(content_data.Html, CurrentXslt, true, false, objXsltArgs, true, true);
                }
            }
            else
            {
                divContentHtml.InnerHtml = content_data.Html;
            }
        }
        else
        {
            if (content_data.Type == 104)
            {
                media_html.Value = content_data.MediaText;
                //Get Url from content
                string tPath = m_refContentApi.RequestInformationRef.AssetPath + m_refContentApi.EkContentRef.GetFolderParentFolderIdRecursive(content_data.FolderId).Replace(",", "/") + "/" + content_data.AssetData.Id + "." + content_data.AssetData.FileExtension;
                string mediaHTML = FixPath(content_data.Html, tPath);
                int scriptStartPtr = 0;
                int scriptEndPtr = 0;
                int len = 0;
                //Registering the javascript & CSS
                this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "linkReg", "<link href=\"" + m_refContentApi.ApplicationPath + "csslib/EktTabs.css\" rel=\"stylesheet\" type=\"text/css\" />", false);
                mediaHTML = mediaHTML.Replace("<link href=\"" + m_refContentApi.ApplicationPath + "csslib/EktTabs.css\" rel=\"stylesheet\" type=\"text/css\" />", "");
                while (1 == 1)
                {
                    scriptStartPtr = mediaHTML.IndexOf("<script", scriptStartPtr);
                    scriptEndPtr = mediaHTML.IndexOf("</script>", scriptEndPtr);
                    if (scriptStartPtr == -1 || scriptEndPtr == -1)
                    {
                        break;
                    }
                    len = scriptEndPtr - scriptStartPtr + 9;
                    this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), (string)("scriptreg" + scriptEndPtr), mediaHTML.Substring(scriptStartPtr, len), false);
                    mediaHTML = mediaHTML.Replace(mediaHTML.Substring(scriptStartPtr, len), "");
                    scriptStartPtr = 0;
                    scriptEndPtr = 0;
                }
                media_display_html.Value = mediaHTML;
                divContentHtml.InnerHtml = "<a href=\"#\" onclick=\"document.getElementById(\'" + divContentHtml.ClientID + "\').innerHTML = document.getElementById(\'" + media_display_html.ClientID + "\').value;return false;\" alt=\"" + m_refMsg.GetMessage("alt show media content") + "\" title=\"" + m_refMsg.GetMessage("alt show media content") + "\">" + m_refMsg.GetMessage("lbl show media content") + "<br/><img align=\"middle\" src=\"" + m_refContentApi.AppPath + "images/filmstrip_ph.jpg\" /></a>";
            }
            else
            {
                if (Ektron.Cms.Common.EkConstants.IsAssetContentType(content_data.Type, Convert .ToBoolean (-1)))
                {
                    string ver = "";
                    ver = (string)("&version=" + content_data.AssetData.Version);
                    if (IsImage(content_data.AssetData.Version))
                    {
                        divContentHtml.InnerHtml = "<img src=\"" + m_refContentApi.SitePath + "assetmanagement/DownloadAsset.aspx?ID=" + content_data.AssetData.Id + ver + "\" />";
                    }
                    else
                    {
                        divContentHtml.InnerHtml = "<div align=\"center\" style=\"padding:15px;\"><a style=\"text-decoration:none;\" href=\"#\" onclick=\"javascript:window.open(\'" + m_refContentApi.SitePath + "assetmanagement/DownloadAsset.aspx?ID=" + content_data.AssetData.Id + ver + "\',\'DownloadAsset\',\'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=1000,height=800\');return false;\"><img align=\"middle\" src=\"" + m_refContentApi.AppPath + "images/application/download.gif\" />" + m_refMsg.GetMessage("btn download") + " &quot;" + content_data.Title + "&quot;</a></div>";
                    }

                }
                else if (content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData)
                {
                    Ektron.Cms.API.UrlAliasing.UrlAliasCommon u = new Ektron.Cms.API.UrlAliasing.UrlAliasCommon();
                    FolderData fd = this.m_refContentApi.GetFolderById(content_data.FolderId);
                    string stralias = u.GetAliasForContent(content_data.Id);
                    if (stralias == string.Empty || fd.IsDomainFolder)
                    {
                        stralias = content_data.Quicklink;
                    }

                    string link = "";
                    if (content_data.ContType == (int)EkEnumeration.CMSContentType.Content || (content_data.ContType == (int)EkEnumeration.CMSContentType.Archive_Content && content_data.EndDateAction != 1))
                    {
                        string url = this.m_refContent.RequestInformation.SitePath + stralias;
                        if (url.Contains("?"))
                        {
                            url += "&";
                        }
                        else
                        {
                            url += "?";
                        }
                        if ("viewstaged" == m_strPageAction)
                        {
                            url += "view=staged";
                        }
                        else
                        {
                            url += "view=published";
                        }
                        url += (string)("&LangType=" + content_data.LanguageId.ToString());
                        link = "<a href=\"" + url + "\" onclick=\"window.open(this.href);return false;\">Click here to view the page</a><br/><br/>";
                    }
                    divContentHtml.InnerHtml = link + Ektron.Cms.PageBuilder.PageData.RendertoString(content_data.Html);
                }
                else
                {
                    if ((int)Ektron.Cms.Common.EkEnumeration.CMSContentType.Forms == content_data.Type || (int)Ektron.Cms.Common.EkEnumeration.CMSContentType.Archive_Forms == content_data.Type)
                    {
                        divContentHtml.InnerHtml = content_data.Html.Replace("[srcpath]", m_refContentApi.ApplicationPath + m_refContentApi.AppeWebPath);
                        divContentHtml.InnerHtml = divContentHtml.InnerHtml.Replace("[skinpath]", m_refContentApi.ApplicationPath + "csslib/ContentDesigner/");
                    }
                    else
                    {
                        divContentHtml.InnerHtml = content_data.Html;
                    }
                    if (m_bIsBlog)
                    {
                        Collection blogData = m_refContentApi.EkContentRef.GetBlogData(content_data.FolderId);
                        if (blogData != null)
                        {
                            if (blogData["enablecomments"].ToString() != string.Empty)
                            {
                                litBlogComment.Text = "<div class=\"ektronTopSpace\"></div><a class=\"button buttonInline greenHover buttonNoIcon\" href=\"" + m_refContentApi.AppPath + "content.aspx?id=" + content_data.FolderId + "&action=ViewContentByCategory&LangType=" + content_data.LanguageId + "&ContType=" + Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments + "&contentid=" + content_data.Id + "&viewin=" + content_data.LanguageId + "\" title=\"" + m_refMsg.GetMessage("alt view comments label") + "\">" + m_refMsg.GetMessage("view comments") + "</a>";
                                litBlogComment.Visible = true;
                            }
                        }
                    }
                }
            }
        }

        sSummaryText = new StringBuilder();
        if ((int)Ektron.Cms.Common.EkEnumeration.CMSContentType.Forms == content_data.Type || (int)Ektron.Cms.Common.EkEnumeration.CMSContentType.Archive_Forms == content_data.Type)
        {
            if (content_data.Teaser != null)
            {
                if (content_data.Teaser.IndexOf("<ektdesignpackage_design") > -1)
                {
                    string strDesign;
                    strDesign = m_refContentApi.XSLTransform(null, null, true, false, null, true);
                    tdsummarytext.InnerHtml = strDesign;
                }
                else
                {
                    tdsummarytext.InnerHtml = content_data.Teaser;
                }
            }
            else
            {
                tdsummarytext.InnerHtml = "";
            }
        }
        else
        {
            if (m_bIsBlog)
            {
                sSummaryText.AppendLine("<table class=\"ektronGrid\">");
                sSummaryText.AppendLine("	<tr>");
                sSummaryText.AppendLine("		<td valign=\"top\" class=\"label\">");
                sSummaryText.AppendLine("			" + m_refMsg.GetMessage("generic description") + "");
                sSummaryText.AppendLine("		</td>");
                sSummaryText.AppendLine("		<td valign=\"top\">");
            }
            sSummaryText.AppendLine(content_data.Teaser);
            if (m_bIsBlog)
            {
                sSummaryText.AppendLine("		</td>");
                sSummaryText.AppendLine("	</tr>");
                sSummaryText.AppendLine("	<tr>");
                sSummaryText.AppendLine("		<td valign=\"top\" class=\"label\">");
                sSummaryText.AppendLine("			" + m_refMsg.GetMessage("lbl blog cat") + "");
                sSummaryText.AppendLine("		</td>");
                sSummaryText.AppendLine("		<td>");
                if (!(blog_post_data.Categories == null))
                {
                    arrBlogPostCategories = blog_post_data.Categories;
                    if (arrBlogPostCategories.Length > 0)
                    {
                        Array.Sort(arrBlogPostCategories);
                    }
                }
                else
                {
                    arrBlogPostCategories = null;
                }
                if (blog_post_data.Categories.Length > 0)
                {
                    for (i = 0; i <= (blog_post_data.Categories.Length - 1); i++)
                    {
                        if (blog_post_data.Categories[i].ToString() != "")
                        {
                            sSummaryText.AppendLine("				<input type=\"checkbox\" name=\"blogcategories" + i.ToString() + "\" value=\"" + blog_post_data.Categories[i].ToString() + "\" checked=\"true\" disabled>&nbsp;" + Strings.Replace((string)(blog_post_data.Categories[i].ToString()), "~@~@~", ";", 1, -1, 0) + "<br />");
                        }
                    }
                }
                else
                {
                    sSummaryText.AppendLine("No categories defined.");
                }
                sSummaryText.AppendLine("		</td>");
                sSummaryText.AppendLine("	</tr>");
                sSummaryText.AppendLine("	<tr>");
                sSummaryText.AppendLine("		<td class=\"label\" valign=\"top\">");
                sSummaryText.AppendLine("			" + m_refMsg.GetMessage("lbl personal tags") + "");
                sSummaryText.AppendLine("		</td>");
                sSummaryText.AppendLine("		<td>");
                if (!(blog_post_data == null))
                {
                    sSummaryText.AppendLine(blog_post_data.Tags);
                }
                sSummaryText.AppendLine("		</td>");
                sSummaryText.AppendLine("	</tr>");
                sSummaryText.AppendLine("	<tr>");
                sSummaryText.AppendLine("	    <td class=\"label\">");
                if (!(blog_post_data == null))
                {
                    sSummaryText.AppendLine("   <input type=\"hidden\" name=\"blogposttrackbackid\" id=\"blogposttrackbackid\" value=\"" + blog_post_data.TrackBackURLID.ToString() + "\" />");
                    sSummaryText.AppendLine("   <input type=\"hidden\" id=\"isblogpost\" name=\"isblogpost\" value=\"true\"/>" + m_refMsg.GetMessage("lbl trackback url") + "");
                    sSummaryText.AppendLine("		</td>");
                    sSummaryText.AppendLine("		<td>");
                    sSummaryText.AppendLine("<input type=\"text\" size=\"75\" id=\"trackback\" name=\"trackback\" value=\"" + EkFunctions.HtmlEncode(blog_post_data.TrackBackURL) + "\" disabled/>");
                    sSummaryText.AppendLine("		</td>");
                    sSummaryText.AppendLine("	</tr>");
                    sSummaryText.AppendLine("	<tr>");
                    sSummaryText.AppendLine("		<td class=\"label\">");
                    if (blog_post_data.Pingback == true)
                    {
                        sSummaryText.AppendLine("" + m_refMsg.GetMessage("lbl blog ae ping") + "");
                        sSummaryText.AppendLine("		</td>");
                        sSummaryText.AppendLine("		<td>");
                        sSummaryText.AppendLine("           <input type=\"checkbox\" name=\"pingback\" id=\"pingback\" checked disabled/>");

                    }
                    else
                    {
                        sSummaryText.AppendLine("" + m_refMsg.GetMessage("lbl blog ae ping") + "");
                        sSummaryText.AppendLine("		</td>");
                        sSummaryText.AppendLine("		<td>");
                        sSummaryText.AppendLine("           <input type=\"checkbox\" name=\"pingback\" id=\"pingback\" disabled/>");
                    }
                }
                else
                {
                    sSummaryText.AppendLine("           <input type=\"hidden\" name=\"blogposttrackbackid\" id=\"blogposttrackbackid\" value=\"\" />");
                    sSummaryText.AppendLine("           <input type=\"hidden\" id=\"isblogpost\" name=\"isblogpost\" value=\"true\"/>" + m_refMsg.GetMessage("lbl trackback url") + "");
                    sSummaryText.AppendLine("<input type=\"text\" size=\"75\" id=\"trackback\" name=\"trackback\" value=\"\" disabled/>");
                    sSummaryText.AppendLine("		</td>");
                    sSummaryText.AppendLine("	</tr>");
                    sSummaryText.AppendLine("	<tr>");
                    sSummaryText.AppendLine("		<td class=\"label\">" + m_refMsg.GetMessage("lbl blog ae ping") + "");
                    sSummaryText.AppendLine("		</td>");
                    sSummaryText.AppendLine("		<td>");
                    sSummaryText.AppendLine("           <input type=\"checkbox\" name=\"pingback\" id=\"pingback\" disabled/>");
                }
                sSummaryText.AppendLine("		</td>");
                sSummaryText.AppendLine("	</tr>");
                sSummaryText.AppendLine("</table>");
            }
            tdsummarytext.InnerHtml = sSummaryText.ToString();
        }

        ViewMetaData(content_data);

        tdcommenttext.InnerHtml = content_data.Comment;
        AddTaskTypeDropDown();
        ViewTasks();
        ViewSubscriptions();
        Ektron.Cms.Content.EkContent cref;
        cref = m_refContentApi.EkContentRef;
        TaxonomyBaseData[] dat;
        dat = cref.GetAllFolderTaxonomy(folder_data.Id);
        if (dat == null || dat.Length == 0)
        {
            phCategories.Visible = false;
            phCategories2.Visible = false;
        }
        ViewAssignedTaxonomy();
        if ((content_data != null) && ((content_data.Type >= EkConstants.ManagedAsset_Min && content_data.Type <= EkConstants.ManagedAsset_Max && content_data.Type != 104) || (content_data.Type >= EkConstants.Archive_ManagedAsset_Min && content_data.Type <= EkConstants.Archive_ManagedAsset_Max && content_data.Type != 1104) || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData))
        {
            showAlert = false;
        }
        if (
            (Request.QueryString["menuItemType"] != null && Request.QueryString["menuItemType"].ToLower() == "viewproperties")
            ||
            (Request.QueryString["tab"] != null && Request.QueryString["tab"].ToLower() == "properties")
            )
        {
            DefaultTab.Value = "dvProperties";
            Util_ReloadTree(content_data.Path, content_data.FolderId);
        }
    }