Exemplo n.º 1
1
 private static System.Collections.Generic.IList<System.Reflection.Assembly> LoadAssemblies()
 {
     System.Collections.Generic.IList<System.Reflection.Assembly> assemblyList = new System.Collections.Generic.List<System.Reflection.Assembly>();
     assemblyList.Add(Load("Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a" +
                 "3a"));
     assemblyList.Add(Load("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364" +
                 "e35"));
     assemblyList.Add(Load("System.Activities.DurableInstancing, Version=4.0.0.0, Culture=neutral, PublicKeyT" +
                 "oken=31bf3856ad364e35"));
     assemblyList.Add(Load("System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11" +
                 "d50a3a"));
     assemblyList.Add(Load("System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e0" +
                 "89"));
     assemblyList.Add(Load("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Runtime.DurableInstancing, Version=4.0.0.0, Culture=neutral, PublicKeyToke" +
                 "n=31bf3856ad364e35"));
     assemblyList.Add(Load("System.ServiceModel.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" +
                 "31bf3856ad364e35"));
     assemblyList.Add(Load("System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c56193" +
                 "4e089"));
     assemblyList.Add(Load("System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08" +
                 "9"));
     assemblyList.Add(Load("YunShanOA.BusinessLogic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"));
     assemblyList.Add(Load("YunShanOA.DataAccess, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"));
     assemblyList.Add(Load("YunShanOA.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"));
     assemblyList.Add(System.Reflection.Assembly.GetExecutingAssembly());
     return assemblyList;
 }
Exemplo n.º 2
0
 private System.Collections.Generic.List<RuleEngine.Evidence.EvidenceSpecifier> CreateActionList()
 {
     System.Collections.Generic.List<RuleEngine.Evidence.EvidenceSpecifier> actionList = new System.Collections.Generic.List<RuleEngine.Evidence.EvidenceSpecifier>();
     actionList.Add(new RuleEngine.Evidence.EvidenceSpecifier(true, "a1"));
     actionList.Add(new RuleEngine.Evidence.EvidenceSpecifier(true, "a2"));
     return actionList;
 }
Exemplo n.º 3
0
Arquivo: Common.cs Projeto: JuRogn/OA
        public static IEnumerable<Type> GetKnownTypes(ICustomAttributeProvider provider)
        {
            System.Collections.Generic.List<System.Type> knownTypes =
                new System.Collections.Generic.List<System.Type>();
            //// Add any types to include here.

            //return knownTypes;
            Type[] types = Assembly.Load("SMT_FB_EFModel").GetTypes();

            for (int i = 0; i < types.Length; i++)
            {
                if ((types[i].BaseType == typeof(EntityObject)) || typeof(VisitUserBase).IsAssignableFrom(types[i]))
                {
                    knownTypes.Add(types[i]);
                }
            }
            //List<Type> typesO = knownTypes.ToList();
            //typesO.ForEach(item =>
            //{
            //    knownTypes.Add(typeof(List<>).MakeGenericType(new Type[] { item }));
            //});

            knownTypes.Add(typeof(AuditResult));
            knownTypes.Add(typeof(SaveResult));
            knownTypes.Add(typeof(VirtualAudit));
            knownTypes.Add(typeof(SMT.SaaS.BLLCommonServices.FlowWFService.SubmitData));

            return knownTypes;
        }
        public override void Test()
        {
            OpenDMS.Storage.Providers.EngineRequest request = new OpenDMS.Storage.Providers.EngineRequest();
            request.Engine = _engine;
            request.Database = _db;
            request.OnActionChanged += new EngineBase.ActionDelegate(EngineAction);
            request.OnProgress += new EngineBase.ProgressDelegate(Progress);
            request.OnComplete += new EngineBase.CompletionDelegate(Complete);
            request.OnTimeout += new EngineBase.TimeoutDelegate(Timeout);
            request.OnError += new EngineBase.ErrorDelegate(Error);
            request.AuthToken = _window.Session.AuthToken;
            request.RequestingPartyType = OpenDMS.Storage.Security.RequestingPartyType.User;

            Clear();

            WriteLine("Starting ModifyResourceUsageRightsTemplate test...");

            OpenDMS.Storage.Security.UsageRight ur1 = new OpenDMS.Storage.Security.UsageRight(new OpenDMS.Storage.Security.Group("administrators"), OpenDMS.Storage.Security.Authorization.ResourcePermissionType.All);
            OpenDMS.Storage.Security.UsageRight ur2 = new OpenDMS.Storage.Security.UsageRight(new OpenDMS.Storage.Security.Group("users"),
                OpenDMS.Storage.Security.Authorization.ResourcePermissionType.Checkout |
                OpenDMS.Storage.Security.Authorization.ResourcePermissionType.ReadOnly);
            System.Collections.Generic.List<OpenDMS.Storage.Security.UsageRight> list = new System.Collections.Generic.List<OpenDMS.Storage.Security.UsageRight>();
            list.Add(ur1);
            list.Add(ur2);

            _start = DateTime.Now;

            _engine.ModifyResourceUsageRightsTemplate(request, list);
        }
Exemplo n.º 5
0
		/// <exception cref="System.Exception"></exception>
		public virtual void TestReuse()
		{
			string baseName = GetBaseName();
			NeoDatis.Odb.ODB odb = Open(baseName);
			System.Collections.Generic.IList<NeoDatis.Odb.Test.VO.Login.Profile> profiles = new 
				System.Collections.Generic.List<NeoDatis.Odb.Test.VO.Login.Profile>();
			profiles.Add(new NeoDatis.Odb.Test.VO.Login.Profile("p1", new NeoDatis.Odb.Test.VO.Login.Function
				("f1")));
			profiles.Add(new NeoDatis.Odb.Test.VO.Login.Profile("p2", new NeoDatis.Odb.Test.VO.Login.Function
				("f2")));
			NeoDatis.Odb.Test.Query.Criteria.ClassB cb = new NeoDatis.Odb.Test.Query.Criteria.ClassB
				("name", profiles);
			odb.Store(cb);
			odb.Close();
			odb = Open(baseName);
			NeoDatis.Odb.Test.VO.Login.Profile p = (NeoDatis.Odb.Test.VO.Login.Profile)odb.GetObjects
				(typeof(NeoDatis.Odb.Test.VO.Login.Profile)).GetFirst();
			NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery query = odb.CriteriaQuery(typeof(
				NeoDatis.Odb.Test.Query.Criteria.ClassB), NeoDatis.Odb.Core.Query.Criteria.Where
				.Equal("profiles", p));
			NeoDatis.Odb.Impl.Core.Query.Criteria.EqualCriterion ec = (NeoDatis.Odb.Impl.Core.Query.Criteria.EqualCriterion
				)query.GetCriteria();
			try
			{
				NeoDatis.Odb.Objects<NeoDatis.Odb.Test.Query.Criteria.ClassB> l = odb.GetObjects(
					query);
			}
			catch (System.Exception e)
			{
				AssertTrue(NeoDatis.Tool.Wrappers.OdbString.ExceptionToString(e, true).IndexOf("1063"
					) != -1);
			}
			odb.Close();
		}
Exemplo n.º 6
0
 public static System.Collections.Generic.List<_Star_Double_Double> static_call(float a, float b, float c)
 {
     var _ret = new System.Collections.Generic.List<_Star_Double_Double>();
       {
     var tmp_0 = a * c;
     var tmp_1 = 4 * tmp_0;
     var tmp_2 = b * b;
     var d = tmp_2 - tmp_1;
     var tmp_3 = d > 0;
     if (tmp_3) {
       var tmp_4 = 0 - b;
       var tmp_5 = System.Math.Sqrt(d);
       var x = tmp_4 - tmp_5;
       var tmp_6 = b * x;
       var tmp_7 = x * x;
       var tmp_8 = a * tmp_7;
       var tmp_9 = tmp_6 + c;
       var y = tmp_8 + tmp_9;
       var tmp_10 = new _Star_Double_Double(x,y);
       _ret.Add(tmp_10);
     }
       }
       {
     var tmp_0 = a * c;
     var tmp_1 = 4 * tmp_0;
     var tmp_2 = b * b;
     var d = tmp_2 - tmp_1;
     var tmp_3 = d > 0;
     if (tmp_3) {
       var tmp_4 = 0 - b;
       var tmp_5 = System.Math.Sqrt(d);
       var x = tmp_4 + tmp_5;
       var tmp_6 = b * x;
       var tmp_7 = x * x;
       var tmp_8 = a * tmp_7;
       var tmp_9 = tmp_6 + c;
       var y = tmp_8 + tmp_9;
       var tmp_10 = new _Star_Double_Double(x, y);
       _ret.Add(tmp_10);
     }
       }
       {
     var tmp_0 = a * c;
     var tmp_1 = 4 * tmp_0;
     var tmp_2 = b * b;
     var d = tmp_2 - tmp_1;
     var tmp_3 = d == 0;
     if (tmp_3) {
       var x = 0 - b;
       var tmp_4 = b * x;
       var tmp_5 = x * x;
       var tmp_6 = a * tmp_5;
       var tmp_7 = tmp_4 + c;
       var y = tmp_6 + tmp_7;
       var tmp_8 = new _Star_Double_Double(x,y);
       _ret.Add(tmp_8);
     }
       }
       return _ret;
 }
Exemplo n.º 7
0
 private static System.Collections.Generic.IList<System.Reflection.Assembly> LoadAssemblies()
 {
     System.Collections.Generic.IList<System.Reflection.Assembly> assemblyList = new System.Collections.Generic.List<System.Reflection.Assembly>();
     assemblyList.Add(Load("Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a" +
                 "3a"));
     assemblyList.Add(Load("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364" +
                 "e35"));
     assemblyList.Add(Load("System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b" +
                 "77a5c561934e089"));
     assemblyList.Add(Load("System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" +
                 "a"));
     assemblyList.Add(Load("System.ServiceModel.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" +
                 "31bf3856ad364e35"));
     assemblyList.Add(Load("System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c56193" +
                 "4e089"));
     assemblyList.Add(Load("System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08" +
                 "9"));
     assemblyList.Add(Load("Discord.Net.Commands, Version=0.7.0.0, Culture=neutral, PublicKeyToken=null"));
     assemblyList.Add(Load("Discord.Net, Version=0.7.0.0, Culture=neutral, PublicKeyToken=null"));
     assemblyList.Add(Load("Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aee" +
                 "d"));
     assemblyList.Add(Load("RestSharp, Version=105.2.3.0, Culture=neutral, PublicKeyToken=null"));
     assemblyList.Add(System.Reflection.Assembly.GetExecutingAssembly());
     return assemblyList;
 }
Exemplo n.º 8
0
        public static System.Collections.Generic.List<string> getPermutation(string str, int index = 0, System.Collections.Generic.List<string> sets = null)
        {
            if (index == str.Length)
            {
                return sets;
            }
            System.Collections.Generic.List<string> current_result = new System.Collections.Generic.List<string>();
            string c = str.Substring(index, 1);

            if (sets == null)
            {
                current_result.Add(c);
            }else if (sets != null)
            {
                foreach (string item in sets)
                {
                    for (int i = 0; i <= item.Length; i++)
                    {
                        current_result.Add(insertStr(item, i, c));
                    }
                }
            }

            return getPermutation(str, index + 1, current_result);
        }
Exemplo n.º 9
0
		/// <exception cref="System.Exception"></exception>
		public virtual void Test1()
		{
			string baseName = GetBaseName();
			NeoDatis.Odb.ODB odb = Open(baseName);
			System.Collections.Generic.IList<NeoDatis.Odb.Test.VO.Login.Profile> profiles = new 
				System.Collections.Generic.List<NeoDatis.Odb.Test.VO.Login.Profile>();
			profiles.Add(new NeoDatis.Odb.Test.VO.Login.Profile("p1", new NeoDatis.Odb.Test.VO.Login.Function
				("f1")));
			profiles.Add(new NeoDatis.Odb.Test.VO.Login.Profile("p2", new NeoDatis.Odb.Test.VO.Login.Function
				("f2")));
			NeoDatis.Odb.Test.Query.Criteria.ClassB cb = new NeoDatis.Odb.Test.Query.Criteria.ClassB
				("name", profiles);
			odb.Store(cb);
			odb.Close();
			odb = Open(baseName);
			// this object is not known y NeoDatis so the query will not return anything
			NeoDatis.Odb.Test.VO.Login.Profile p = new NeoDatis.Odb.Test.VO.Login.Profile("p1"
				, (System.Collections.IList)null);
			NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery query = odb.CriteriaQuery(typeof(
				NeoDatis.Odb.Test.Query.Criteria.ClassB), NeoDatis.Odb.Core.Query.Criteria.Where
				.Contain("profiles", p));
			NeoDatis.Odb.Objects<NeoDatis.Odb.Test.Query.Criteria.ClassB> l = odb.GetObjects(
				query);
			odb.Close();
			AssertEquals(0, l.Count);
		}
Exemplo n.º 10
0
 private static System.String[] buildPhoneNumbers(System.String number1, System.String number2, System.String number3)
 {
     // System.Collections.ArrayList numbers = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(3)); // commented by .net follower (http://dotnetfollower.com)
     System.Collections.Generic.List<Object> numbers = new System.Collections.Generic.List<Object>(3); // added by .net follower (http://dotnetfollower.com)
     if (number1 != null)
     {
         numbers.Add(number1);
     }
     if (number2 != null)
     {
         numbers.Add(number2);
     }
     if (number3 != null)
     {
         numbers.Add(number3);
     }
     int size = numbers.Count;
     if (size == 0)
     {
         return null;
     }
     System.String[] result = new System.String[size];
     for (int i = 0; i < size; i++)
     {
         result[i] = ((System.String) numbers[i]);
     }
     return result;
 }
Exemplo n.º 11
0
 private static System.Collections.Generic.IList<System.Reflection.Assembly> LoadAssemblies()
 {
     System.Collections.Generic.IList<System.Reflection.Assembly> assemblyList = new System.Collections.Generic.List<System.Reflection.Assembly>();
     assemblyList.Add(Load("Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a" +
                 "3a"));
     assemblyList.Add(Load("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b" +
                 "77a5c561934e089"));
     assemblyList.Add(Load("System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Deployment, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50" +
                 "a3a"));
     assemblyList.Add(Load("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +
                 ""));
     assemblyList.Add(Load("System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" +
                 "a"));
     assemblyList.Add(Load("System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c5619" +
                 "34e089"));
     assemblyList.Add(Load("System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08" +
                 "9"));
     assemblyList.Add(System.Reflection.Assembly.GetExecutingAssembly());
     return assemblyList;
 }
Exemplo n.º 12
0
 private static System.Collections.Generic.IList<System.Reflection.Assembly> LoadAssemblies()
 {
     System.Collections.Generic.IList<System.Reflection.Assembly> assemblyList = new System.Collections.Generic.List<System.Reflection.Assembly>();
     assemblyList.Add(Load("Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a" +
                 "3a"));
     assemblyList.Add(Load("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKe" +
                 "yToken=31bf3856ad364e35"));
     assemblyList.Add(Load("System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11" +
                 "d50a3a"));
     assemblyList.Add(Load("System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b" +
                 "77a5c561934e089"));
     assemblyList.Add(Load("System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08" +
                 "9"));
     assemblyList.Add(Load("EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08" +
                 "9"));
     assemblyList.Add(Load("EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5" +
                 "c561934e089"));
     assemblyList.Add(Load("Nancy, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null"));
     assemblyList.Add(Load("Nancy.Hosting.Self, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null"));
     assemblyList.Add(Load("Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aee" +
                 "d"));
     assemblyList.Add(System.Reflection.Assembly.GetExecutingAssembly());
     return assemblyList;
 }
Exemplo n.º 13
0
 public void CompletarPermisos(FeaEntidades.InterFacturas.lote_comprobantes lc)
 {
     //Permisos de exportación
     permisos = new System.Collections.Generic.List<FeaEntidades.InterFacturas.permisos>();
     if (lc.comprobante[0].cabecera.informacion_comprobante.informacion_exportacion != null && lc.comprobante[0].cabecera.informacion_comprobante.informacion_exportacion.permisos != null)
     {
         foreach (FeaEntidades.InterFacturas.permisos r in lc.comprobante[0].cabecera.informacion_comprobante.informacion_exportacion.permisos)
         {
             //descripcioncodigo_de_permiso ( XmlIgnoreAttribute )
             //Se busca la descripción a través del código.
             try
             {
                 if (r != null)
                 {
                     //string descrcodigo = ((DropDownList)permisosGridView.FooterRow.FindControl("ddlcodigo_de_permiso")).SelectedItem.Text;
                     //((DropDownList)permisosGridView.FooterRow.FindControl("ddlcodigo_de_permiso")).SelectedValue = r.destino_mercaderia.ToString();
                     //descrcodigo = ((DropDownList)permisosGridView.FooterRow.FindControl("ddlcodigo_de_permiso")).SelectedItem.Text;
                     //r.descripcion_destino_mercaderia = descrcodigo;
                     permisos.Add(r);
                 }
             }
             catch
             //Referencia no valida
             {
             }
         }
     }
     if (permisos.Count.Equals(0))
     {
         permisos.Add(new FeaEntidades.InterFacturas.permisos());
     }
     permisosGridView.DataSource = permisos;
     permisosGridView.DataBind();
     ViewState["permisos"] = permisos;
 }
        public static void Run()
        {
            // ExStart:1
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

            // ****** Program ******

            // Initialize WorkbookDesigner object
            WorkbookDesigner designer = new WorkbookDesigner();
            // Load the template file
            designer.Workbook = new Workbook(dataDir + "SM_NestedObjects.xlsx");
            // Instantiate the List based on the class
            System.Collections.Generic.ICollection<Individual> list = new System.Collections.Generic.List<Individual>();
            // Create an object for the Individual class
            Individual p1 = new Individual("Damian", 30);
            // Create the relevant Wife class for the Individual
            p1.Wife = new Wife("Dalya", 28);
            // Create another object for the Individual class
            Individual p2 = new Individual("Mack", 31);
            // Create the relevant Wife class for the Individual
            p2.Wife = new Wife("Maaria", 29);
            // Add the objects to the list
            list.Add(p1);
            list.Add(p2);
            // Specify the DataSource
            designer.SetDataSource("Individual", list);
            // Process the markers
            designer.Process(false);
            // Save the Excel file.
            designer.Workbook.Save(dataDir+ "output.xlsx");

        }
Exemplo n.º 15
0
        public static System.Collections.Generic.Dictionary<System.Int16, System.Collections.Generic.List<BinaryTreeNode>> getLevelLinkedList(BinaryTreeNode head)
        {
            System.Collections.Generic.Dictionary<System.Int16, System.Collections.Generic.List<BinaryTreeNode>> result
                = new System.Collections.Generic.Dictionary<System.Int16, System.Collections.Generic.List<BinaryTreeNode>>();
            short level = 0;
            System.Collections.Generic.List<BinaryTreeNode> list = new System.Collections.Generic.List<BinaryTreeNode>();
            list.Add(head);
            result.Add(level, list);

            while (true)
            {
                System.Collections.Generic.List<BinaryTreeNode> list_loop = result[level];
                list = new System.Collections.Generic.List<BinaryTreeNode>();
                result.Add(++level, list);
                foreach (BinaryTreeNode btn in list_loop)
                {
                    if (btn.LeftNode != null)
                    {
                        list.Add(btn.LeftNode);
                    }
                    if (btn.RightNode != null)
                    {
                        list.Add(btn.RightNode);
                    }
                }
                if (list.Count == 0)
                {
                    break;
                }
            }
            return result;
        }
 private static System.Collections.Generic.IList<System.Reflection.Assembly> LoadAssemblies()
 {
     System.Collections.Generic.IList<System.Reflection.Assembly> assemblyList = new System.Collections.Generic.List<System.Reflection.Assembly>();
     assemblyList.Add(Load("HRApplicationServices.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken" +
                 "=null"));
     assemblyList.Add(Load("HRApplicationServices.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" +
                 ""));
     assemblyList.Add(Load("Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a" +
                 "3a"));
     assemblyList.Add(Load("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364" +
                 "e35"));
     assemblyList.Add(Load("System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934" +
                 "e089"));
     assemblyList.Add(Load("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b7" +
                 "7a5c561934e089"));
     assemblyList.Add(Load("System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" +
                 "a"));
     assemblyList.Add(Load("System.ServiceModel.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" +
                 "31bf3856ad364e35"));
     assemblyList.Add(Load("System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c56193" +
                 "4e089"));
     assemblyList.Add(Load("System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"));
     assemblyList.Add(Load("System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08" +
                 "9"));
     assemblyList.Add(System.Reflection.Assembly.GetExecutingAssembly());
     return assemblyList;
 }
Exemplo n.º 17
0
 private static System.Collections.Generic.IList<System.Reflection.Assembly> LoadAssemblies()
 {
     System.Collections.Generic.IList<System.Reflection.Assembly> assemblyList = new System.Collections.Generic.List<System.Reflection.Assembly>();
     assemblyList.Add(Load("Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a" +
                 "3a"));
     assemblyList.Add(Load("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856a" +
                 "d364e35"));
     assemblyList.Add(Load("System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364" +
                 "e35"));
     assemblyList.Add(Load("System.Activities.Presentation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" +
                 "31bf3856ad364e35"));
     assemblyList.Add(Load("System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +
                 ""));
     assemblyList.Add(Load("System.ServiceModel.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" +
                 "31bf3856ad364e35"));
     assemblyList.Add(Load("System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c56193" +
                 "4e089"));
     assemblyList.Add(Load("System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08" +
                 "9"));
     assemblyList.Add(Load("WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"));
     assemblyList.Add(Load("Microsoft.TeamFoundation.Build.Workflow, Version=12.0.0.0, Culture=neutral, Publi" +
                 "cKeyToken=b03f5f7f11d50a3a"));
     assemblyList.Add(Load("Microsoft.TeamFoundation.TestImpact.Client, Version=12.0.0.0, Culture=neutral, Pu" +
                 "blicKeyToken=b03f5f7f11d50a3a"));
     assemblyList.Add(System.Reflection.Assembly.GetExecutingAssembly());
     return assemblyList;
 }
Exemplo n.º 18
0
        public void Dictionary_thread_test()
        {
            string path = AppDomain.CurrentDomain.BaseDirectory;
            Dictionary<int, int> testDictionary = new Dictionary<int, int>(path);
            try
            {
                _error = false;

                System.Collections.Generic.List<Thread> tList = new System.Collections.Generic.List<Thread>(100);
                for (int i = 0; i < 20; i++)
                {
                    Thread t = new Thread(DoWriteTest3);
                    tList.Add(t);
                    t.Start(testDictionary);
                }

                for (int i = 0; i < 20; i++)
                {
                    Thread t = new Thread(DoReadTest3);
                    tList.Add(t);
                    t.Start(testDictionary);
                }

                foreach (Thread t in tList)
                {
                    t.Join();
                }
                Assert.IsFalse(_error);
            }
            finally
            {
                testDictionary.Dispose();
            }
        }
 public void FirefoxProfile_add_five_extensions()
 {
     string[] expected = { "SePSX.dll", "SePSX.dll", "SePSX.dll", "SePSX.dll", "SePSX.dll" };
     AddSeFirefoxExtensionCommand cmdlet =
         WebDriverFactory.Container.Resolve<AddSeFirefoxExtensionCommand>();
     //AddSeFirefoxExtensionCommand.UnitTestMode = true;
     cmdlet.InputObject =
         //WebDriverFactory.GetFirefoxProfile();
         // resolve FirefoxProfile
         WebDriverFactory.Container.Resolve<FirefoxProfile>();
     cmdlet.ExtensionList =
         expected;
     SeAddFirefoxExtensionCommand command =
         new SeAddFirefoxExtensionCommand(cmdlet);
     command.Execute();
     System.Collections.Generic.List<string> listOfArguments =
         new System.Collections.Generic.List<string>();
     listOfArguments.Add(expected[0]);
     listOfArguments.Add(expected[1]);
     listOfArguments.Add(expected[2]);
     listOfArguments.Add(expected[3]);
     listOfArguments.Add(expected[4]);
     ReadOnlyCollection<string> expectedList =
         new ReadOnlyCollection<string>(listOfArguments);
     //Assert.AreEqual(expectedList, (SePSX.CommonCmdletBase.UnitTestOutput[0] as FirefoxProfile)); // ??
 }
Exemplo n.º 20
0
 //Idea of Recursive
 public static System.Collections.Generic.List<string> getPermutationV5(string str)
 {
     if (str == null)
     {
         return null;
     }
     System.Collections.Generic.List<string> solutions = new System.Collections.Generic.List<string>();
     if (str.Length == 0)
     {
         solutions.Add("");
         return solutions;
     }
     //solutions.Add(str[0].ToString());
     string remaining = str.Substring(1);
     System.Collections.Generic.List<string> current_solutions = getPermutationV5(remaining);
     foreach (string item in current_solutions)
     {
         for (int i = 0; i <= item.Length; i++)
         {
             string new_item =  insertStr(item, i, str[0].ToString());
             solutions.Add(new_item);
         }
     }
     return solutions;
 }
 private static System.Collections.Generic.IList<System.Reflection.Assembly> LoadAssemblies()
 {
     System.Collections.Generic.IList<System.Reflection.Assembly> assemblyList = new System.Collections.Generic.List<System.Reflection.Assembly>();
     assemblyList.Add(Load("Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a" +
                 "3a"));
     assemblyList.Add(Load("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364" +
                 "e35"));
     assemblyList.Add(Load("System.Activities.DurableInstancing, Version=4.0.0.0, Culture=neutral, PublicKeyT" +
                 "oken=31bf3856ad364e35"));
     assemblyList.Add(Load("System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +
                 ""));
     assemblyList.Add(Load("System.Runtime.DurableInstancing, Version=4.0.0.0, Culture=neutral, PublicKeyToke" +
                 "n=31bf3856ad364e35"));
     assemblyList.Add(Load("System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b7" +
                 "7a5c561934e089"));
     assemblyList.Add(Load("System.ServiceModel.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" +
                 "31bf3856ad364e35"));
     assemblyList.Add(Load("System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c56193" +
                 "4e089"));
     assemblyList.Add(Load("System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c5619" +
                 "34e089"));
     assemblyList.Add(Load("System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08" +
                 "9"));
     assemblyList.Add(System.Reflection.Assembly.GetExecutingAssembly());
     return assemblyList;
 }
        public void GetTLProject_Id_ThreeProjects()
        {
            string[] ids = new string[]{ "prj1", "prj2", "prj3" };

            System.Collections.Generic.List<TestProject> list =
                new System.Collections.Generic.List<TestProject>();
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project1",
                    "prj1",
                    string.Empty));
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project2",
                    "prj2",
                    string.Empty));
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project3",
                    "prj3",
                    string.Empty));

            System.Collections.Generic.List<TestProject> resultList =
                getProjectCollection(list, null, ids, false);

            Assert.AreEqual(
                list,
                PSTestLib.UnitTestOutput.LastOutput.AsList<Meyn.TestLink.TestProject>());
        }
Exemplo n.º 23
0
		public void Ctor_02()
		{
			// arrange:
			System.Collections.Generic.List<object> mocks = new System.Collections.Generic.List<object>();
			TrackingId id = new TrackingId("CLAIM");
			IItinerary itinerary = MockRepository.GenerateStrictMock<IItinerary>();
			itinerary.Expect(i => i.FinalArrivalDate).Return(DateTime.UtcNow).Repeat.AtLeastOnce();
			mocks.Add(itinerary);
			IRouteSpecification specification = MockRepository.GenerateStrictMock<IRouteSpecification>();
			specification.Expect(s => s.IsSatisfiedBy(itinerary)).Return(true).Repeat.Any();
			mocks.Add(specification);
			IRouteSpecification specification2 = MockRepository.GenerateStrictMock<IRouteSpecification>();
			specification2.Expect(s => s.IsSatisfiedBy(itinerary)).Return(false).Repeat.Any();
			mocks.Add(specification2);
			CargoState previousState = MockRepository.GenerateStrictMock<CargoState>(id, specification);
			mocks.Add(previousState);
			previousState = MockRepository.GenerateStrictMock<CargoState>(previousState, itinerary);
			mocks.Add(previousState);
			previousState = MockRepository.GenerateStrictMock<CargoState>(previousState, specification2);
			mocks.Add(previousState);
			DateTime claimDate = DateTime.UtcNow;
			
		
			// act:
			Assert.Throws<ArgumentException>(delegate { new ClaimedCargo(previousState, claimDate); });
		
			// assert:
			foreach(object mock in mocks)
			{
				mock.VerifyAllExpectations();
			}
		}
 private static System.Collections.Generic.IList<System.Reflection.Assembly> LoadAssemblies()
 {
     System.Collections.Generic.IList<System.Reflection.Assembly> assemblyList = new System.Collections.Generic.List<System.Reflection.Assembly>();
     assemblyList.Add(Load("Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a" +
                 "3a"));
     assemblyList.Add(Load("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b" +
                 "77a5c561934e089"));
     assemblyList.Add(Load("System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Deployment, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50" +
                 "a3a"));
     assemblyList.Add(Load("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +
                 ""));
     assemblyList.Add(Load("System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c5619" +
                 "34e089"));
     assemblyList.Add(Load("System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08" +
                 "9"));
     assemblyList.Add(Load("BapFormulariosNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"));
     assemblyList.Add(Load("bapFunciones, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"));
     assemblyList.Add(Load("LayerBusinessEntities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"));
     assemblyList.Add(Load("LayerBusinessLogic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"));
     assemblyList.Add(Load("Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken" +
                 "=71e9bce111e9429c"));
     assemblyList.Add(System.Reflection.Assembly.GetExecutingAssembly());
     return assemblyList;
 }
Exemplo n.º 25
0
		/// <exception cref="System.Exception"></exception>
		public virtual void Test2()
		{
			string baseName = GetBaseName();
			NeoDatis.Odb.ODB odb = Open(baseName);
			System.Collections.Generic.IList<NeoDatis.Odb.Test.VO.Login.Profile> profiles = new 
				System.Collections.Generic.List<NeoDatis.Odb.Test.VO.Login.Profile>();
			profiles.Add(new NeoDatis.Odb.Test.VO.Login.Profile("p1", new NeoDatis.Odb.Test.VO.Login.Function
				("f1")));
			profiles.Add(new NeoDatis.Odb.Test.VO.Login.Profile("p2", new NeoDatis.Odb.Test.VO.Login.Function
				("f2")));
			NeoDatis.Odb.Test.Query.Criteria.ClassB cb = new NeoDatis.Odb.Test.Query.Criteria.ClassB
				("name", profiles);
			odb.Store(cb);
			odb.Close();
			odb = Open(baseName);
			NeoDatis.Odb.Test.VO.Login.Profile p = (NeoDatis.Odb.Test.VO.Login.Profile)odb.GetObjects
				(typeof(NeoDatis.Odb.Test.VO.Login.Profile)).GetFirst();
			NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery query = odb.CriteriaQuery(typeof(
				NeoDatis.Odb.Test.Query.Criteria.ClassB), NeoDatis.Odb.Core.Query.Criteria.Where
				.Contain("profiles", p));
			NeoDatis.Odb.Objects<NeoDatis.Odb.Test.Query.Criteria.ClassB> l = odb.GetObjects(
				query);
			odb.Close();
			AssertEquals(1, l.Count);
		}
    protected void btnBus_Click(object sender, EventArgs e)
    {
        int intAnio = 0;
        int intMes = 0;

        if (!int.TryParse(cmbAnio.SelectedValue, out intAnio) || !int.TryParse(cmbMes.SelectedValue, out intMes))
        {
            lblErr.Text = "El año y mes seleccionado es incorrecto";
            return;
        }

        System.Collections.Generic.List<ReportParameter> _parameters = new System.Collections.Generic.List<ReportParameter>();

        _parameters.Add(new ReportParameter("Tipo", this.cmbTip.SelectedIndex == 0 ? " " : this.cmbTip.Text));
        _parameters.Add(new ReportParameter("Grupo", this.cmbGru.SelectedIndex == 0 ? " " : this.cmbGru.Text));
        _parameters.Add(new ReportParameter("Area", this.cmbAre.SelectedIndex == 0 ? " " : this.cmbAre.Text));
        _parameters.Add(new ReportParameter("fechaIni", UtilFechas.getFechaIni(intAnio,intMes).ToString("yyyyMMdd")));
        _parameters.Add(new ReportParameter("fechaFin", UtilFechas.getFechaFin(intAnio, intMes).ToString("yyyyMMdd")));

        try
        {
            this.rpvData.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
            this.rpvData.ShowParameterPrompts = false;
            this.rpvData.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportServerUrl"]);
            this.rpvData.ServerReport.ReportPath = "/rptTablero/rptAnalisisSLA";
            this.rpvData.ServerReport.SetParameters(_parameters);
            this.rpvData.ServerReport.Refresh();
            this.rpvData.Visible = true;
        }
        catch (Exception ex)
        {
            this.rpvData.Visible = false;
            this.lblErr.Text = ex.Message + "<br/>" + ex.StackTrace;
        }
    }
Exemplo n.º 27
0
        public void Array_thread_test()
        {
            _error = false;
            string path = AppDomain.CurrentDomain.BaseDirectory;
            using (Array<int> testList = new Array<int>(10, path))
            {
                testList.AutoGrow = true;
                System.Collections.Generic.List<Thread> tList = new System.Collections.Generic.List<Thread>(100);
                for (int i = 0; i < 100; i++)
                {
                    Thread t = new Thread(DoWriteTest1);
                    tList.Add(t);
                    t.Start(testList);
                }

                for (int i = 0; i < 100; i++)
                {
                    Thread t = new Thread(DoReadTest1);
                    tList.Add(t);
                    t.Start(testList);
                }

                foreach (Thread t in tList)
                {
                    t.Join();
                }
                Assert.IsFalse(_error);
            }
        }
 private static System.Collections.Generic.IList<System.Reflection.Assembly> LoadAssemblies()
 {
     System.Collections.Generic.IList<System.Reflection.Assembly> assemblyList = new System.Collections.Generic.List<System.Reflection.Assembly>();
     assemblyList.Add(Load("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856a" +
                 "d364e35"));
     assemblyList.Add(Load("System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364" +
                 "e35"));
     assemblyList.Add(Load("System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b7" +
                 "7a5c561934e089"));
     assemblyList.Add(Load("System.ServiceModel.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" +
                 "31bf3856ad364e35"));
     assemblyList.Add(Load("System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
     assemblyList.Add(Load("System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08" +
                 "9"));
     assemblyList.Add(Load("Microsoft.Activities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad" +
                 "364e35"));
     assemblyList.Add(Load("Microsoft.SharePoint.DesignTime.Activities.16.0.Design, Version=12.0.0.0, Culture" +
                 "=neutral, PublicKeyToken=b03f5f7f11d50a3a"));
     assemblyList.Add(Load("Microsoft.SharePoint.DesignTime.Activities.16.0, Version=12.0.0.0, Culture=neutra" +
                 "l, PublicKeyToken=b03f5f7f11d50a3a"));
     assemblyList.Add(System.Reflection.Assembly.GetExecutingAssembly());
     return assemblyList;
 }
        public void GetTLProject_broken_connection()
        {
            System.Collections.Generic.List<TestProject> list =
                new System.Collections.Generic.List<TestProject>();
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project1",
                    "prj1",
                    string.Empty));
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project2",
                    "prj2",
                    string.Empty));
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project3",
                    "prj3",
                    string.Empty));
//cmdlet.WriteTrace(cmdlet, "GetTLProject_broken_connection: 001");
            System.Collections.Generic.List<TestProject> resultList =
                getProjectCollection(list, true);
//cmdlet.WriteTrace(cmdlet, "GetTLProject_broken_connection: 002");
            Assert.AreEqual<System.Collections.Generic.List<TestProject>>(
                (new System.Collections.Generic.List<TestProject>()),
                resultList);
        }
 public static System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Buckets> ErrorRateToBucket(DSS1_RetailerDriverStockOptimisation.ExternalStructs.Elasticsearch.ErrorFilterAggResponse error)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("Convertor", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "ErrorRateToBucket")) {
         DSS1_RetailerDriverStockOptimisation.BO.Buckets fail = new DSS1_RetailerDriverStockOptimisation.BO.Buckets();
         fail.key    = "Failure"; fail.doc_count = error.Buckets.Failure.doc_count; DSS1_RetailerDriverStockOptimisation.BO.Buckets success = new DSS1_RetailerDriverStockOptimisation.BO.Buckets();
         success.key = "Success"; success.doc_count = error.Buckets.Success.doc_count; System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Buckets> buckets = new System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Buckets>();
         buckets?.Add(fail);
         buckets?.Add(success);
         return(buckets);
     }
 }
Exemplo n.º 31
0
 public static System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.DashboardStatistics> CalculatePoDStats()
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("DashboardStatistics", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "CalculatePoDStats")) {
         System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.DashboardStatistics> wow = new System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.DashboardStatistics>();
         DSS3_LogisticsPoolingForUrbanDistribution.BO.DashboardStatistics stats = new DSS3_LogisticsPoolingForUrbanDistribution.BO.DashboardStatistics();
         stats.InFull = 0; stats.AsOrdered = 0; stats.OnTime = 0; System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.ProofOfDelivery> deliveries = new DSS3_LogisticsPoolingForUrbanDistribution.DAL.Repository().GetAll <DSS3_LogisticsPoolingForUrbanDistribution.BO.ProofOfDelivery>();
         foreach (var delivery in deliveries ?? Enumerable.Empty <DSS3_LogisticsPoolingForUrbanDistribution.BO.ProofOfDelivery>())
         {
             stats.Supplier = (delivery?.OrderWMS?.OrdDepositorFullName ?? ""); if ((delivery?.QuantityStatus == "In Full"))
             {
                 stats.InFull = (stats?.InFull ?? 0) + 1;
             }
             if ((delivery?.QualityStatus == "As Ordered"))
             {
                 stats.AsOrdered = (stats?.AsOrdered ?? 0) + 1;
             }
             if ((delivery?.DeliveryStatus == "On Time"))
             {
                 stats.OnTime = (stats?.OnTime ?? 0) + 1;
             }
         }
         stats.TotalDelivered = (deliveries?.Count() ?? 0); wow?.Add(stats);
         return(wow);
     }
 }
Exemplo n.º 32
0
 public static System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.VolumePerShipper> GetVolumePerLSPImplementation(string Name)
 {
     System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.VolumePerShipper> ChartElement = new System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.VolumePerShipper>();
     foreach (var i in new DSS3_LogisticsPoolingForUrbanDistribution.DAL.Repository().Get <DSS3_LogisticsPoolingForUrbanDistribution.BO.ShippingOrder>((a) => a.Shipper == Name) ?? Enumerable.Empty <DSS3_LogisticsPoolingForUrbanDistribution.BO.ShippingOrder>())
     {
         zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Error, "API", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, i?.Carrier != "");
         if ((i?.Carrier != ""))
         {
             decimal?OrderVolume = (i?.Get_AggregateVolume() ?? 0);
             var     _var0       = i?.Carrier;
             if ((ChartElement?.Any((a) => a.Description == _var0) ?? false))
             {
                 var _var1 = i?.Carrier;
                 ChartElement.FirstOrDefault((a) => a.Description == i.Carrier).Volume = (ChartElement?.FirstOrDefault((a) => a.Description == _var1)?.Volume ?? 0) + OrderVolume.GetValueOrDefault(0);
             }
             else
             {
                 DSS3_LogisticsPoolingForUrbanDistribution.BO.VolumePerShipper GraphElement = new DSS3_LogisticsPoolingForUrbanDistribution.BO.VolumePerShipper();
                 GraphElement.Description = (i?.Carrier ?? "");
                 GraphElement.Volume      = OrderVolume;
                 ChartElement?.Add(GraphElement);
             }
         }
     }
     return(ChartElement);
 }
Exemplo n.º 33
0
 public static System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Platform> CalculatePlatform()
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("Platform", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "CalculatePlatform")) {
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Platform> leadTimes = new System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Platform>();
         foreach (var item in new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetAsQueryable <DSS1_RetailerDriverStockOptimisation.BO.Item>()?.Take(15).ToList() ?? Enumerable.Empty <DSS1_RetailerDriverStockOptimisation.BO.Item>())
         {
             DSS1_RetailerDriverStockOptimisation.BO.Platform leadTime = new DSS1_RetailerDriverStockOptimisation.BO.Platform();
             leadTime.RealOrderedQuantities = (decimal)((new Random((int)(((item?.AvgDailyDemand ?? 0) + (item?.AvgDailyDemand ?? 0) + (item?.AvgDailyDemand ?? 0))))).Next(100, 2000)); leadTime.ForecastOrders = (decimal)((new Random(Math.Abs((int)(((item?.AvgDailyDemand ?? 0) + (item?.AvgDailyDemand ?? 0) - (item?.AvgDailyDemand ?? 0)))))).Next(100, 2000)); leadTime.Item = item; leadTime.percentage = Math.Abs(((leadTime?.ForecastOrders ?? 0)) / (leadTime?.RealOrderedQuantities ?? 0)) * 100; leadTime.ItemDescription = (item?.Description?.Substring(0, 15) ?? ""); if (((leadTime?.percentage ?? 0) > 0.5m))
             {
                 decimal?perc = (new Random((int)(((item?.AvgDailyDemand ?? 0) + (item?.AvgDailyDemand ?? 0))))).Next(1, 3);
                 leadTime.percentage = ((perc.GetValueOrDefault(0) * (item?.AvgDailyDemand ?? 0)) / 100) + (leadTime?.percentage ?? 0) - 100;
             }
             if (((leadTime?.percentage ?? 0) > 15))
             {
                 leadTime.percentage = (leadTime?.percentage ?? 0) - 20;
             }
             if (((leadTime?.percentage ?? 0) < 0))
             {
                 leadTime.percentage = (leadTime?.percentage ?? 0) + 10;
             }
             leadTimes?.Add(leadTime);
             new DSS1_RetailerDriverStockOptimisation.DAL.Repository().Save <DSS1_RetailerDriverStockOptimisation.BO.Platform>(leadTime);
         }
         return(leadTimes);
     }
 }
Exemplo n.º 34
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.º 35
0
 public static System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.CO2PerCarrier> CO2PerCarrierImplementation(string Name)
 {
     System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.CO2PerCarrier> ChartElement = new System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.CO2PerCarrier>();
     foreach (var i in new DSS3_LogisticsPoolingForUrbanDistribution.DAL.Repository().Get <DSS3_LogisticsPoolingForUrbanDistribution.BO.ShippingOrder>((a) => a.Shipper == Name) ?? Enumerable.Empty <DSS3_LogisticsPoolingForUrbanDistribution.BO.ShippingOrder>())
     {
         if ((i?.Carrier != ""))
         {
             decimal?OrderVolume = (i?.Get_AggregateVolume() ?? 0);
             var     _var4       = i?.Carrier;
             if ((ChartElement?.Any((a) => a.Description == _var4) ?? false))
             {
                 var _var5 = i?.Carrier;
                 ChartElement.FirstOrDefault((a) => a.Description == i.Carrier).KgCO2 = (ChartElement?.FirstOrDefault((a) => a.Description == _var5)?.KgCO2 ?? 0) + OrderVolume.GetValueOrDefault(0);
             }
             else
             {
                 DSS3_LogisticsPoolingForUrbanDistribution.BO.CO2PerCarrier GraphElement = new DSS3_LogisticsPoolingForUrbanDistribution.BO.CO2PerCarrier();
                 GraphElement.Description = (i?.Carrier ?? "");
                 GraphElement.KgCO2       = OrderVolume.GetValueOrDefault(0) * 5.8m;
                 ChartElement?.Add(GraphElement);
             }
         }
     }
     return(ChartElement);
 }
Exemplo n.º 36
0
 public static System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.VolumePerShipper> GetVolumePerUnitImplementation(string Name)
 {
     System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.VolumePerShipper> VolumeSpreadChart = new System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.VolumePerShipper>();
     foreach (var i in new DSS3_LogisticsPoolingForUrbanDistribution.DAL.Repository().Get <DSS3_LogisticsPoolingForUrbanDistribution.BO.ShippingOrder>((a) => a.Shipper == Name) ?? Enumerable.Empty <DSS3_LogisticsPoolingForUrbanDistribution.BO.ShippingOrder>())
     {
         foreach (var j in i?.PlannedVolume ?? Enumerable.Empty <DSS3_LogisticsPoolingForUrbanDistribution.BO.CustomVolume>())
         {
             foreach (var k in j?.VolumeComposition ?? Enumerable.Empty <DSS3_LogisticsPoolingForUrbanDistribution.BO.VolumeComposition>())
             {
                 var _var2 = k?.VolumeComponent?.Name;
                 if ((VolumeSpreadChart?.Any((a) => a.Description == _var2) ?? false))
                 {
                     var _var3 = k?.VolumeComponent?.Name;
                     VolumeSpreadChart.FirstOrDefault((a) => a.Description == k.VolumeComponent.Name).Volume = (VolumeSpreadChart?.FirstOrDefault((a) => a.Description == _var3)?.Volume ?? 0) + 1;
                 }
                 else
                 {
                     DSS3_LogisticsPoolingForUrbanDistribution.BO.VolumePerShipper GraphElement = new DSS3_LogisticsPoolingForUrbanDistribution.BO.VolumePerShipper();
                     GraphElement.Description = (k?.VolumeComponent?.Name ?? "");
                     GraphElement.Volume      = 1;
                     VolumeSpreadChart?.Add(GraphElement);
                 }
             }
         }
     }
     return(VolumeSpreadChart);
 }
 public static System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.HIstogramBucket> ToHistBucket(System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.ExternalStructs.Elasticsearch.HistogramBucket> items)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("Convertor", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "ToHistBucket")) {
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.HIstogramBucket> buckets = new System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.HIstogramBucket>();
         foreach (var bucket in items ?? Enumerable.Empty <DSS1_RetailerDriverStockOptimisation.ExternalStructs.Elasticsearch.HistogramBucket>())
         {
             buckets?.Add((new DSS1_RetailerDriverStockOptimisation.BO.ElasticsearchDataTransformation.Transformer()).HistogramBucket_To_HIstogramBucket_2(bucket));
         }
         return(buckets);
     }
 }
 public static System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.RequestLog> ToRequestLog(DSS1_RetailerDriverStockOptimisation.ExternalStructs.Elasticsearch.SearchResponse queryResponse)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("Convertor", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "ToRequestLog")) {
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.RequestLog> logs = new System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.RequestLog>();
         foreach (var hit in queryResponse.HitResponce.Hits ?? Enumerable.Empty <DSS1_RetailerDriverStockOptimisation.ExternalStructs.Elasticsearch.HitRoot>())
         {
             logs?.Add((new DSS1_RetailerDriverStockOptimisation.BO.ElasticsearchDataTransformation.Transformer()).Hit_To_RequestLog(hit.Source));
         }
         return(logs);
     }
 }
 public static System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage> InitPubMessage(System.Object obj)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("Utils", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "InitPubMessage")) {
         System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage> messages = new System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage>();
         System.Type type = obj.GetType();
         System.Collections.Generic.List <zAppDev.DotNet.Framework.Utilities.MambaRuntimeType> properties = zAppDev.DotNet.Framework.Utilities.MambaRuntimeType.FromPropertiesList(type.GetProperties());
         foreach (var property in properties ?? Enumerable.Empty <zAppDev.DotNet.Framework.Utilities.MambaRuntimeType>())
         {
             System.Object value    = property.GetValue(obj, new object[] {});
             string        name     = property.Name;
             string        datatype = zAppDev.DotNet.Framework.Utilities.Common.GetTypeName(property.PropertyType, false);
             zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "Utils", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, "property value " + value + " property Name " + name + " property type " + datatype);
             if ((value == null))
             {
                 value = "";
             }
             DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage message = new DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage();
             if ((datatype == "Guid"))
             {
                 continue;
             }
             string valueString = value.ToString();
             if (((valueString?.ToLower().Contains("Sarmed".ToLower()) ?? false)))
             {
                 continue;
             }
             if (((datatype?.Contains("Date") ?? false)))
             {
                 message.type = "DateTime"; message.key = name; DateTime?time = zAppDev.DotNet.Framework.Utilities.Common.SafeCast <DateTime?>(value);
                 message.val  = (time?.ToString("yyyy-MM-ddThh-mm-ss") ?? "");
             }
             if ((datatype == "Int64"))
             {
                 message.type = "long"; message.key = name; message.val = value.ToString();
             }
             if ((datatype == "Int32"))
             {
                 message.type = "int"; message.key = name; message.val = value.ToString();
             }
             if ((datatype == "Single"))
             {
                 message.type = "double"; message.key = name; message.val = value.ToString();
             }
             if ((datatype == "String"))
             {
                 message.type = "string"; message.key = name; message.val = zAppDev.DotNet.Framework.Utilities.Common.SafeCast <string>(value);
             }
             messages?.Add(message);
         }
         return(messages);
     }
 }
 public static void Publish(this BO.GPSLocation @this)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("GPSLocation", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "Publish")) {
         zAppDev.DotNet.Framework.Utilities.Serializer <DSS3_LogisticsPoolingForUrbanDistribution.BO.GPSLocation> gps = new zAppDev.DotNet.Framework.Utilities.Serializer <DSS3_LogisticsPoolingForUrbanDistribution.BO.GPSLocation>();
         string gpsjson   = gps.ToJson(@this, false);
         string base64gps = zAppDev.DotNet.Framework.Utilities.Common.Base64Encode(gpsjson);
         System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage> message = new System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage>();
         DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage mes1 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage();
         DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage mes2 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage();
         DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage mes3 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage();
         mes1.type = "string"; mes1.val = "truck_location"; mes1.key = "topic"; mes2.type = "string"; mes2.val = (@this?.truck_license_plate ?? ""); mes2.key = "truck_location"; mes3.type = "string"; mes3.val = base64gps; mes3.key = "payload"; message?.Add(mes1);
         message?.Add(mes2);
         message?.Add(mes3);
         DSS3_LogisticsPoolingForUrbanDistribution.ExternalStructs.LocalPubSub.Publication publication = new DSS3_LogisticsPoolingForUrbanDistribution.ExternalStructs.LocalPubSub.Publication();
         System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.ExternalStructs.LocalPubSub.PubMessage> apisPubMessage = new System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.ExternalStructs.LocalPubSub.PubMessage>();
         foreach (var pubs in message ?? Enumerable.Empty <DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage>())
         {
             DSS3_LogisticsPoolingForUrbanDistribution.ExternalStructs.LocalPubSub.PubMessage pubMessage = (new DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessageDataTransformation.Transformer()).PubMessage_To_PubMessage(pubs);
             apisPubMessage.Add(pubMessage);
         }
         publication.publication = apisPubMessage.ToArray(); DSS3_LogisticsPoolingForUrbanDistribution.BLL.ExternalRestServices.LocalPubSubRestService.Publish(publication);
     }
 }
Exemplo n.º 41
0
 public static System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.ImportedBuyer> FindSupplierBuyers()
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("CommercialAgreement", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "FindSupplierBuyers")) {
         string supUsername = "";
         System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement> supplierAgreements = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Get <DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement>((a) => a.Supplier.UserName == zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentApplicationUser().UserName);
         System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.ImportedBuyer>       foundBuyers        = new System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.ImportedBuyer>();
         foreach (var supAgreement in supplierAgreements ?? Enumerable.Empty <DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement>())
         {
             zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "CommercialAgreement", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "buyer: " + (supAgreement?.ImportedBuyer?.Code ?? "") + "c.a. " + (supAgreement?.Id?.ToString() ?? ""));
             foundBuyers?.Add(supAgreement?.ImportedBuyer);
         }
         return(foundBuyers?.Distinct().ToList());
     }
 }
Exemplo n.º 42
0
 public static void Publish(this BO.OrderWMS @this)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("OrderWMS", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "Publish")) {
         zAppDev.DotNet.Framework.Utilities.Serializer <DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderDTO> ord = new zAppDev.DotNet.Framework.Utilities.Serializer <DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderDTO>();
         DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderDTO ordDTO = (new DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderTransformationDataTransformation.Transformer()).OrderWMS_To_OrderDTO(@this);
         string order    = ord.ToJson(ordDTO);
         string encorder = zAppDev.DotNet.Framework.Utilities.Common.Base64Encode(order);
         System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage> message = new System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage>();
         DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage mes1 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage();
         DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage mes2 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage();
         DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage mes3 = new DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage();
         mes1.type = "string"; mes1.val = "sarmed_order"; mes1.key = "topic"; mes2.type = "int"; mes2.val = "1"; mes2.key = "sarmed_order"; mes3.type = "string"; mes3.val = encorder; mes3.key = "payload"; message?.Add(mes1);
         message?.Add(mes2);
         message?.Add(mes3);
         DSS3_LogisticsPoolingForUrbanDistribution.ExternalStructs.LocalPubSub.Publication publication = new DSS3_LogisticsPoolingForUrbanDistribution.ExternalStructs.LocalPubSub.Publication();
         System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.ExternalStructs.LocalPubSub.PubMessage> apisPubMessage = new System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.ExternalStructs.LocalPubSub.PubMessage>();
         foreach (var pubs in message ?? Enumerable.Empty <DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage>())
         {
             DSS3_LogisticsPoolingForUrbanDistribution.ExternalStructs.LocalPubSub.PubMessage pubMessage = (new DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessageDataTransformation.Transformer()).PubMessage_To_PubMessage(pubs);
             apisPubMessage.Add(pubMessage);
         }
         publication.publication = apisPubMessage.ToArray(); DSS3_LogisticsPoolingForUrbanDistribution.BLL.ExternalRestServices.LocalPubSubRestService.Publish(publication);
     }
 }
 public static System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.Order> FindAgreement()
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("Order", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "FindAgreement")) {
         string userName = "";
         System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.Agreement> agreements  = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Get <DSS5_SupplyChainFinancialsOptimisation.BO.Agreement>((a) => a.Investor.UserName == zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentApplicationUser().UserName);
         System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.Order>     foundOrders = new System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.Order>();
         foreach (var agr in agreements ?? Enumerable.Empty <DSS5_SupplyChainFinancialsOptimisation.BO.Agreement>())
         {
             userName = (agr?.Supplier?.UserName ?? ""); foreach (var order in new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Get <DSS5_SupplyChainFinancialsOptimisation.BO.Order>((o) => o.Transaction.Supplier.UserName == userName) ?? Enumerable.Empty <DSS5_SupplyChainFinancialsOptimisation.BO.Order>())
             {
                 foundOrders?.Add(order);
             }
         }
         return(foundOrders?.Distinct().ToList());
     }
 }
        /*<ControllerActionImplementation:PayRestAmount:1/>*/
        public ActionResult ExecutePayRestAmount()
        {
            ActionResult _result = null;
            int?         i       = 0;

            while (@model.PaymentAmount > 0)
            {
                DSS5_SupplyChainFinancialsOptimisation.BO.Transaction tr = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromList(@model.FundedPaidTransactions, i.GetValueOrDefault(0));
                if ((@model.PaymentAmount >= (tr?.RestPaymentAmount ?? 0) && (tr?.PaidByBuyer ?? false)))
                {
                    @model.PaymentAmount = @model.PaymentAmount.GetValueOrDefault(0) - (tr?.RestPaymentAmount ?? 0);
                    tr.RestPaymentAmount = 0;
                    tr.PaymentStatus     = "Fully Paid";
                }
                else
                {
                    if (((tr?.PaidByBuyer ?? false)))
                    {
                        tr.RestPaymentAmount = (tr?.RestPaymentAmount ?? 0) - @model.PaymentAmount.GetValueOrDefault(0);
                        @model.PaymentAmount = 0;
                        tr.PaymentStatus     = "Partially Funded Paid";
                    }
                }
                tr.PaymentDate = @model.PaymentDate;
                i = i.GetValueOrDefault(0) + 1;
                if ((i == @model.FundedPaidTransactions?.Count()))
                {
                    break;
                }
            }
            System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction> copyFundedPaidTransactions = new System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction>();
            foreach (var tr in @model.FundedPaidTransactions ?? Enumerable.Empty <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction>())
            {
                copyFundedPaidTransactions?.Add(tr);
            }
            foreach (var tr in copyFundedPaidTransactions?.Where((t) => t.PaymentStatus == "Fully Paid").ToList() ?? Enumerable.Empty <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction>())
            {
                @model.FundedPaidTransactions?.Remove(tr);
            }
            DSS5_SupplyChainFinancialsOptimisation.BO.TransactionPayment payment = new DSS5_SupplyChainFinancialsOptimisation.BO.TransactionPayment();
            payment.PaymentAmount = @model.PaymentAmount;
            payment.PaymentDate   = @model.PaymentDate;
            payment.Agreement     = @model.Agreement;
            payment?.AddTransactions(@model.FundedPaidTransactions?.Where((t) => t.PaymentStatus == "Fully Paid").ToList());
            new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Save <DSS5_SupplyChainFinancialsOptimisation.BO.TransactionPayment>(payment);
            return(_result);
        }
 public static System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.ProofOfDelivery> FindAgreement()
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("ProofOfDelivery", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "FindAgreement")) {
         string userName = "";
         System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.Agreement>       agreements = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Get <DSS5_SupplyChainFinancialsOptimisation.BO.Agreement>((a) => a.Investor.UserName == zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentApplicationUser().UserName);
         System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.ProofOfDelivery> foundPODs  = new System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.ProofOfDelivery>();
         foreach (var agr in agreements ?? Enumerable.Empty <DSS5_SupplyChainFinancialsOptimisation.BO.Agreement>())
         {
             userName = (agr?.Supplier?.UserName ?? ""); foreach (var pod in new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Get <DSS5_SupplyChainFinancialsOptimisation.BO.ProofOfDelivery>((o) => o.Transaction.Supplier.UserName == userName) ?? Enumerable.Empty <DSS5_SupplyChainFinancialsOptimisation.BO.ProofOfDelivery>())
             {
                 foundPODs?.Add(pod);
                 zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "ProofOfDelivery", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "length foundOrders: " + (foundPODs?.Count().ToString() ?? ""));
             }
         }
         return(foundPODs);
     }
 }
 public static System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Item> ItemsInSelectedForecast(DSS1_RetailerDriverStockOptimisation.BO.OrderForecast selectedOrderForecast)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("Item", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "ItemsInSelectedForecast")) {
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Item> items = new System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Item>();
         if ((selectedOrderForecast == null))
         {
             return(items);
         }
         zAppDev.DotNet.Framework.Data.MiniSessionManager.Instance.Session.Refresh(selectedOrderForecast);
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.ItemParameter> itemParams = selectedOrderForecast?.ItemParameters;
         foreach (var i in itemParams ?? Enumerable.Empty <DSS1_RetailerDriverStockOptimisation.BO.ItemParameter>())
         {
             items?.Add(i?.Item);
         }
         return(items);
     }
 }
 public static System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.UnitsKPI> UnitsKPIWithCriteria(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("UnitsKPI", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "UnitsKPIWithCriteria")) {
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.UnitsKPI> kpis = new System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.UnitsKPI>();
         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?.Date ?? System.Data.SqlTypes.SqlDateTime.MinValue.Value); var _var1 = (toDate?.Date ?? System.Data.SqlTypes.SqlDateTime.MinValue.Value); System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.StockOnHand> filteredStockOnHand = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().Get <DSS1_RetailerDriverStockOptimisation.BO.StockOnHand>((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.StockOnHandDate.GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value).Date >= _var0) && (toDate == null || a.StockOnHandDate.GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value).Date <= _var1));
         System.Collections.Generic.List <DateTime?> uniqueDates = filteredStockOnHand?.Select((a) => a.StockOnHandDate.GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value).Date).Select(_n => _n as DateTime?).ToList().Distinct().ToList().OrderBy((a) => a).ToList();
         foreach (var dt in uniqueDates ?? Enumerable.Empty <DateTime?>())
         {
             DSS1_RetailerDriverStockOptimisation.BO.UnitsKPI kpi = new DSS1_RetailerDriverStockOptimisation.BO.UnitsKPI();
             kpi.SalesForecastDate = dt; kpi.SalesForecastDateFormatted = (dt?.ToString("dd/MM") ?? ""); int?totalStockForDay = (filteredStockOnHand?.Where((a) => a.StockOnHandDate.GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value).Date == dt).Sum((a) => a.Units) ?? 0);
             kpi.Units             = totalStockForDay; kpis?.Add(kpi);
         }
         return(kpis);
     }
 }
 public static System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.HIstogramBucket> ToDateHistBucket(System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.ExternalStructs.Elasticsearch.HistogramBucket> items)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("Convertor", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "ToDateHistBucket")) {
         DSS1_RetailerDriverStockOptimisation.BO.HIstogramBucket tmp = new DSS1_RetailerDriverStockOptimisation.BO.HIstogramBucket();
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.HIstogramBucket> buckets = new System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.HIstogramBucket>();
         foreach (var bucket in items ?? Enumerable.Empty <DSS1_RetailerDriverStockOptimisation.ExternalStructs.Elasticsearch.HistogramBucket>())
         {
             tmp = (new DSS1_RetailerDriverStockOptimisation.BO.ElasticsearchDataTransformation.Transformer()).HistogramBucket_To_HIstogramBucket(bucket); tmp.max = bucket.Statistics.max; tmp.min = bucket.Statistics.min; tmp.avg = bucket.Statistics.avg; tmp.sum = bucket.Statistics.sum; tmp.failure = bucket.Errors.Buckets.Failure.doc_count; tmp.success = bucket.Errors.Buckets.Success.doc_count; if ((tmp?.doc_count == 0))
             {
                 tmp.error_rate = zAppDev.DotNet.Framework.Utilities.Common.SafeCast <float?>((0));
             }
             else
             {
                 tmp.error_rate = (zAppDev.DotNet.Framework.Utilities.Common.SafeCast <float?>((tmp?.failure ?? 0))) / (zAppDev.DotNet.Framework.Utilities.Common.SafeCast <float?>((tmp?.doc_count ?? 0))) * 100;
             }
             buckets?.Add(tmp);
         }
         return(buckets);
     }
 }
        /*<ControllerActionImplementation:FindAgreement:1/>*/
        public ActionResult ExecuteFindAgreement()
        {
            ActionResult _result  = null;
            string       userName = "";

            System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.Agreement> agreements  = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Get <DSS5_SupplyChainFinancialsOptimisation.BO.Agreement>((a) => a.Investor.UserName == zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentApplicationUser().UserName);
            System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.Order>     foundOrders = new System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.Order>();
            foreach (var agr in agreements ?? Enumerable.Empty <DSS5_SupplyChainFinancialsOptimisation.BO.Agreement>())
            {
                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "InvestorOrdersList", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "-------2-------");
                userName = (agr?.Supplier?.UserName ?? "");
                foreach (var order in new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAll <DSS5_SupplyChainFinancialsOptimisation.BO.Order>() ?? Enumerable.Empty <DSS5_SupplyChainFinancialsOptimisation.BO.Order>())
                {
                    if (order?.Transaction?.Supplier?.UserName == userName)
                    {
                        foundOrders?.Add(order);
                        zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "InvestorOrdersList", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "length foundOrders: " + (foundOrders?.Count().ToString() ?? ""));
                    }
                }
            }
            return(_result);
        }
 public static System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Stats> itemSLALeadTime(string sku)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("Stats", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "itemSLALeadTime")) {
         decimal?result = new decimal?();
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Stats> stats = new System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Stats>();
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Item>  items = new System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Item>();
         DSS1_RetailerDriverStockOptimisation.BO.Item foundItem = new DSS1_RetailerDriverStockOptimisation.BO.Item();
         if ((sku == null || sku == ""))
         {
         }
         else
         {
             try {
                 foundItem = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetById <DSS1_RetailerDriverStockOptimisation.BO.Item>(sku);
             }
             catch (System.Exception x) {
             }
             if (foundItem != null)
             {
             }
         }
         foreach (var slaLead in foundItem?.SLALeadTimes?.Take(10).ToList() ?? Enumerable.Empty <DSS1_RetailerDriverStockOptimisation.BO.SLALeadTime>())
         {
             DSS1_RetailerDriverStockOptimisation.BO.Stats stat = new DSS1_RetailerDriverStockOptimisation.BO.Stats();
             stat.Item = foundItem; stat.Percentage = (slaLead?.Percentage ?? 0); stat.DateFormatted = (slaLead?.SLALeadDate?.ToString("MMMM dd, yyyy") ?? ""); stat.Threshold = (slaLead?.Threshold ?? 0); stat.Date = (slaLead?.SLALeadDate ?? System.Data.SqlTypes.SqlDateTime.MinValue.Value); stats?.Add(stat);
         }
         stats = stats?.OrderBy((a) => a.Date).ToList().ToList(); return(stats);
     }
 }
 public static System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Stats> ItemWaste(string sku)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("Stats", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "ItemWaste")) {
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Stats> stats = new System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Stats>();
         decimal?result = new decimal?();
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Item> items = new System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Item>();
         DSS1_RetailerDriverStockOptimisation.BO.Item foundItem = new DSS1_RetailerDriverStockOptimisation.BO.Item();
         if ((sku == null || sku == ""))
         {
         }
         else
         {
             try {
                 foundItem = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetById <DSS1_RetailerDriverStockOptimisation.BO.Item>(sku);
             }
             catch (System.Exception x) {
             }
             if (foundItem != null)
             {
             }
         }
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.WasteOld> wastes = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().Get <DSS1_RetailerDriverStockOptimisation.BO.WasteOld>((a) => a.Item.SKU == foundItem.SKU);
         foreach (var waste in wastes ?? Enumerable.Empty <DSS1_RetailerDriverStockOptimisation.BO.WasteOld>())
         {
             DSS1_RetailerDriverStockOptimisation.BO.Stats stat = new DSS1_RetailerDriverStockOptimisation.BO.Stats();
             stat.Item = foundItem; stat.Percentage = (waste?.WastePercentage ?? 0); stat.DateFormatted = (waste?.DateFormatted ?? ""); stats?.Add(stat);
         }
         stats = stats?.OrderBy((a) => a.Date).ToList().ToList(); return(stats);
     }
 }
        /*<ControllerActionImplementation:ImportLekosCSV:1/>*/
        public ActionResult ExecuteImportLekosCSV()
        {
            ActionResult _result = null;
            string       pathCSV = zAppDev.DotNet.Framework.Utilities.Web.MapPath(System.IO.Path.Combine("~/App_Data/Uploads", @model.LekosPath));

            if ((pathCSV?.Contains("LEKOS") ?? false))
            {
                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "LEKOS File Import");
                int?     rowCount       = 0;
                string[] entries        = null;
                string[] productEntries = null;
                int?     test           = 0;
                DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement commercialAgreement = new DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement();
                DSS5_SupplyChainFinancialsOptimisation.BO.Order newOrder = new DSS5_SupplyChainFinancialsOptimisation.BO.Order();
                System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.OrderProduct> products = new System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.OrderProduct>();
                commercialAgreement.Supplier = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Supplier>((a) => a.UserName == "Supplier25")?.FirstOrDefault();
                System.Collections.Generic.List <string> delim = new System.Collections.Generic.List <string>();
                delim.Add("\r");
                delim.Add("\n");
                foreach (var row in System.IO.File.ReadAllText(pathCSV).SplitExtended(delim.ToArray(), true) ?? Enumerable.Empty <string>())
                {
                    if (((((row == null || row == "")) == false) && (((row == null || row.Trim() == "")) == false)))
                    {
                        entries = row?.SplitExtended(';', false);
                        if ((entries.Length > 0))
                        {
                            if (zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0).StartsWith("Α-ΔΑ"))
                            {
                                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Found Delivery Note");
                                newOrder.PaymentTerms = "";
                                DSS5_SupplyChainFinancialsOptimisation.BO.DeliveryNote newDeliveryNote = new DSS5_SupplyChainFinancialsOptimisation.BO.DeliveryNote();
                                newDeliveryNote.DeliveryNoteNumber = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0);
                                newDeliveryNote.Description        = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 1);
                                newDeliveryNote.DateIssued         = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 2), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                                newDeliveryNote.Amount             = zAppDev.DotNet.Framework.Utilities.Common.ConvertToDecimal(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 14));
                                newOrder?.AddDeliveryNotes(newDeliveryNote);
                                commercialAgreement?.AddOrders(newOrder);
                            }
                            else if (zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0).StartsWith("Α-ΠΑ"))
                            {
                                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Found Order");
                                newOrder.OrderNumber  = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0);
                                newOrder.DateOfOrder  = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 2), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                                newOrder.PaymentTerms = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 10);
                                commercialAgreement?.AddOrders(newOrder);
                            }
                            else if (zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0).StartsWith("Α-ΤΔ"))
                            {
                                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Found Delivery Note & Invoice");
                                newOrder.PaymentTerms = "";
                                DSS5_SupplyChainFinancialsOptimisation.BO.DeliveryNote newDeliveryNote = new DSS5_SupplyChainFinancialsOptimisation.BO.DeliveryNote();
                                newDeliveryNote.DeliveryNoteNumber = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0);
                                newDeliveryNote.Description        = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 1);
                                newDeliveryNote.DateIssued         = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 2), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                                newDeliveryNote.Amount             = zAppDev.DotNet.Framework.Utilities.Common.ConvertToDecimal(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 14));
                                newOrder?.AddDeliveryNotes(newDeliveryNote);
                                DSS5_SupplyChainFinancialsOptimisation.BO.Invoice newInvoice = new DSS5_SupplyChainFinancialsOptimisation.BO.Invoice();
                                newInvoice.InvoiceNumber = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0);
                                newInvoice.Description   = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 1);
                                newInvoice.DateIssued    = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 2), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                                newInvoice.Amount        = zAppDev.DotNet.Framework.Utilities.Common.ConvertToDecimal(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 14));
                                newOrder?.AddInvoices(newInvoice);
                                commercialAgreement?.AddOrders(newOrder);
                            }
                            else if (zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0).StartsWith("Α-ΤΠ"))
                            {
                                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Found Invoice");
                                newOrder.PaymentTerms = "";
                                DSS5_SupplyChainFinancialsOptimisation.BO.Invoice newInvoice = new DSS5_SupplyChainFinancialsOptimisation.BO.Invoice();
                                newInvoice.InvoiceNumber = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0);
                                newInvoice.Description   = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 1);
                                newInvoice.DateIssued    = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 2), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                                newInvoice.Amount        = zAppDev.DotNet.Framework.Utilities.Common.ConvertToDecimal(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 14));
                                newOrder?.AddInvoices(newInvoice);
                                commercialAgreement?.AddOrders(newOrder);
                            }
                            else if (zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0).StartsWith("Χ-Α"))
                            {
                                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Found Cancelled Order");
                                newOrder.PaymentTerms = "";
                                DSS5_SupplyChainFinancialsOptimisation.BO.CreditNote crNote = new DSS5_SupplyChainFinancialsOptimisation.BO.CreditNote();
                                crNote.CreditNoteNumber = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0);
                                crNote.Description      = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 1);
                                crNote.DateIssued       = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 2), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                                crNote.TotalPrice       = zAppDev.DotNet.Framework.Utilities.Common.ConvertToDecimal(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 14));
                                newOrder?.AddCreditNotes(crNote);
                                commercialAgreement?.AddOrders(newOrder);
                            }
                            else if (zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0).StartsWith("Ε-ΤΠ"))
                            {
                                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Found EU Invoice");
                                newOrder.PaymentTerms = "";
                                DSS5_SupplyChainFinancialsOptimisation.BO.Invoice newInvoice = new DSS5_SupplyChainFinancialsOptimisation.BO.Invoice();
                                newInvoice.InvoiceNumber = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0);
                                newInvoice.Description   = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 1);
                                newInvoice.DateIssued    = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 2), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                                newInvoice.Amount        = zAppDev.DotNet.Framework.Utilities.Common.ConvertToDecimal(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 14));
                                newInvoice.CustomerType  = "EU Customer";
                                newOrder?.AddInvoices(newInvoice);
                                commercialAgreement?.AddOrders(newOrder);
                            }
                        }
                        else
                        {
                            zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Row: " + (rowCount?.ToString() ?? "") + "does not have 2 entries.");
                        }
                    }
                    else
                    {
                        zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Row " + (rowCount?.ToString() ?? "") + " did not have value.");
                    }
                    if (rowCount > 0)
                    {
                        zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "product----> " + row);
                        productEntries = row?.SplitExtended(';', false);
                        DSS5_SupplyChainFinancialsOptimisation.BO.OrderProduct product = new DSS5_SupplyChainFinancialsOptimisation.BO.OrderProduct();
                        product.Code            = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(productEntries, 0);
                        product.Description     = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(productEntries, 1);
                        product.MeasurementUnit = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(productEntries, 2);
                        products?.Add(product);
                        product.Quantity = zAppDev.DotNet.Framework.Utilities.Common.ConvertToDecimal(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(productEntries, 3));
                    }
                    rowCount = rowCount.GetValueOrDefault(0) + 1;
                    commercialAgreement?.AddOrders(newOrder);
                    new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Save <DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement>(commercialAgreement);
                }
                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Rowcount " + (rowCount?.ToString() ?? ""));
            }
            return(_result);
        }
 public static System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.InventoryDaysKPI> InventoryDaysKPI(string sku, int?warehouseId, DateTime?fromDate, DateTime?toDate)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("InventoryDaysKPI", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "InventoryDaysKPI")) {
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.InventoryDaysKPI> kpis = new System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.InventoryDaysKPI>();
         DSS1_RetailerDriverStockOptimisation.BO.Item item = new DSS1_RetailerDriverStockOptimisation.BO.Item();
         try {
             item = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetById <DSS1_RetailerDriverStockOptimisation.BO.Item>(sku);
         }
         catch (System.Exception x) {
         }
         if ((item == null))
         {
             return(kpis);
         }
         DSS1_RetailerDriverStockOptimisation.BO.Warehouse            warehouse = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetAsQueryable <DSS1_RetailerDriverStockOptimisation.BO.Warehouse>((a) => a.Id == warehouseId)?.FirstOrDefault();
         DSS1_RetailerDriverStockOptimisation.BO.SalesForecastDetails sale      = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetAsQueryable <DSS1_RetailerDriverStockOptimisation.BO.SalesForecastDetails>((s) => s.Item.SKU == item.SKU && s.Warehouse.Id == warehouse.Id)?.FirstOrDefault();
         decimal?inventoryDays = 0;
         var     _var4 = (fromDate?.Date ?? System.Data.SqlTypes.SqlDateTime.MinValue.Value); var _var5 = (toDate?.Date ?? System.Data.SqlTypes.SqlDateTime.MinValue.Value); foreach (var stock in item?.StocksOnHand?.Where((s) => s.StockOnHandDate.GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value).Date >= _var4 && s.StockOnHandDate.GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value).Date <= _var5 && s.Warehouse == warehouse).ToList() ?? Enumerable.Empty <DSS1_RetailerDriverStockOptimisation.BO.StockOnHand>())
         {
             DSS1_RetailerDriverStockOptimisation.BO.InventoryDaysKPI kpi = new DSS1_RetailerDriverStockOptimisation.BO.InventoryDaysKPI();
             kpi.SalesForecastDate = (stock?.StockOnHandDate ?? System.Data.SqlTypes.SqlDateTime.MinValue.Value); kpi.SalesForecastDateFormatted = (stock?.StockOnHandDate?.ToString("yyyy/MM/dd") ?? ""); if (sale == null)
             {
                 kpi.InventoryDays = 0;
             }
             else
             {
                 kpi.InventoryDays = (stock?.Units ?? 0) / (sale?.AvgDailyDemandForecast ?? 0);
             }
             kpi.ItemDescription = (item?.Description?.Substring(0, 15) ?? ""); kpis?.Add(kpi);
         }
         kpis = kpis?.OrderBy((a) => a.SalesForecastDate).ToList().ToList(); zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "InventoryDaysKPI", DSS1_RetailerDriverStockOptimisation.Hubs.EventsHub.RaiseDebugMessage, "stats length: " + (kpis?.Count() ?? 0));
         return(kpis);
     }
 }
Exemplo n.º 54
0
 public static System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.OrderForecastStatistic> ShowOrderForecastStats()
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("OrderForecastStatistic", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "ShowOrderForecastStats")) {
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.OrderForecastStatistic> orderFStatistics = new System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.OrderForecastStatistic>();
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.OrderForecastDetails>   orderProposals   = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetAsQueryable <DSS1_RetailerDriverStockOptimisation.BO.OrderForecastDetails>()?.Take(10).ToList();
         foreach (var orderProposal in orderProposals ?? Enumerable.Empty <DSS1_RetailerDriverStockOptimisation.BO.OrderForecastDetails>())
         {
             zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "OrderForecastStatistic", DSS1_RetailerDriverStockOptimisation.Hubs.EventsHub.RaiseDebugMessage, "------ " + (orderProposal?.Id?.ToString() ?? ""), true);
             DSS1_RetailerDriverStockOptimisation.BO.OrderForecastStatistic orderFStat = new DSS1_RetailerDriverStockOptimisation.BO.OrderForecastStatistic();
             orderFStat.Quantity = (orderProposal?.Quantity ?? 0); orderFStat.RoundQuantity = (orderProposal?.RoundQuantity ?? 0); orderFStat.OrderDate = (orderProposal?.RecommendedOrderDate?.Date ?? System.Data.SqlTypes.SqlDateTime.MinValue.Value); orderFStat.OrderDateFormatted = (orderProposal?.RecommendedOrderDate?.ToString("MMMM dd, yyyy") ?? ""); orderFStat.Item = orderProposal?.Item; orderFStat.Warehouse = orderProposal?.Warehouse; orderFStatistics?.Add(orderFStat);
         }
         return(orderFStatistics);
     }
 }
Exemplo n.º 55
0
 public static System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.OrderForecastStatistic> OrderForecastForSKU(DSS1_RetailerDriverStockOptimisation.BO.Item item)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("OrderForecastStatistic", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "OrderForecastForSKU")) {
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.OrderForecastStatistic> orderStats     = new System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.OrderForecastStatistic>();
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.OrderForecastDetails>   orderProposals = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().Get <DSS1_RetailerDriverStockOptimisation.BO.OrderForecastDetails>((a) => a.Item.SKU == item.SKU);
         if ((orderProposals?.Count() ?? 0) >= 10)
         {
         }
         foreach (var orderProposal in orderProposals ?? Enumerable.Empty <DSS1_RetailerDriverStockOptimisation.BO.OrderForecastDetails>())
         {
             DSS1_RetailerDriverStockOptimisation.BO.OrderForecastStatistic stat = new DSS1_RetailerDriverStockOptimisation.BO.OrderForecastStatistic();
             stat.Quantity = (orderProposal?.Quantity ?? 0); stat.RoundQuantity = (orderProposal?.RoundQuantity ?? 0); stat.OrderDate = (orderProposal?.RecommendedOrderDate ?? System.Data.SqlTypes.SqlDateTime.MinValue.Value); stat.OrderDateFormatted = (orderProposal?.RecommendedOrderDate?.ToString("MMMM dd, yyyy") ?? ""); stat.Item = item; stat.Warehouse = orderProposal?.Warehouse; orderStats?.Add(stat);
         }
         return(orderStats);
     }
 }
 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);
     }
 }
 public static System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.InventoryDaysKPI> InventoryDaysKPIWithCriteria(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("InventoryDaysKPI", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "InventoryDaysKPIWithCriteria")) {
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.InventoryDaysKPI> kpis = new System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.InventoryDaysKPI>();
         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?.Date ?? System.Data.SqlTypes.SqlDateTime.MinValue.Value); var _var1 = (toDate?.Date ?? System.Data.SqlTypes.SqlDateTime.MinValue.Value); System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.StockOnHand> filteredStockOnHand = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().Get <DSS1_RetailerDriverStockOptimisation.BO.StockOnHand>((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.StockOnHandDate.GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value).Date >= _var0) && (toDate == null || a.StockOnHandDate.GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value).Date <= _var1));
         var _var2 = (fromDate?.Date ?? System.Data.SqlTypes.SqlDateTime.MinValue.Value); var _var3 = (toDate?.Date.AddDays(30) ?? System.Data.SqlTypes.SqlDateTime.MinValue.Value); System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.SalesForecastDetails> filteredSales = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().Get <DSS1_RetailerDriverStockOptimisation.BO.SalesForecastDetails>((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.ForecastDate.GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value).Date >= _var2) && (toDate == null || a.ForecastDate.GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value).Date <= _var3));
         System.Collections.Generic.List <DateTime?> uniqueDates = filteredStockOnHand?.Select((a) => a.StockOnHandDate.GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value).Date).Select(_n => _n as DateTime?).ToList().Distinct().ToList().OrderBy((a) => a).ToList();
         System.Collections.Generic.List <string>    uniqueItemSKUs = filteredStockOnHand?.Select((a) => a.Item.SKU).ToList().Distinct().ToList();
         zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "InventoryDaysKPI", DSS1_RetailerDriverStockOptimisation.Hubs.EventsHub.RaiseDebugMessage, "uniqueItemSKUs: " + uniqueItemSKUs.Count());
         foreach (var dt in uniqueDates ?? Enumerable.Empty <DateTime?>())
         {
             DSS1_RetailerDriverStockOptimisation.BO.InventoryDaysKPI kpi = new DSS1_RetailerDriverStockOptimisation.BO.InventoryDaysKPI();
             kpi.SalesForecastDate = dt; kpi.SalesForecastDateFormatted = (dt?.ToString("dd/MM") ?? ""); int?totalStockForDay = (filteredStockOnHand?.Where((a) => a.StockOnHandDate.GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value).Date == dt).Sum((a) => a.Units) ?? 0);
             System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.SalesForecastDetails>  salesAfterToday = filteredSales?.Where((a) => a.ForecastDate.GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value).Date >= dt).ToList();
             int?runningTotalSales = 0;
             int?inventoryDays     = 0;
             foreach (var sale in salesAfterToday ?? Enumerable.Empty <DSS1_RetailerDriverStockOptimisation.BO.SalesForecastDetails>())
             {
                 runningTotalSales = runningTotalSales.GetValueOrDefault(0) + (sale?.Units ?? 0); if ((runningTotalSales > totalStockForDay))
                 {
                     break;
                 }
                 inventoryDays = inventoryDays.GetValueOrDefault(0) + 1;
             }
             kpi.InventoryDays = inventoryDays; if ((uniqueItemSKUs.Count() > 1))
             {
                 int?calcInvDays = (int)((inventoryDays.GetValueOrDefault(0) / uniqueItemSKUs.Count()));
                 if ((calcInvDays == 0))
                 {
                     calcInvDays = 1;
                 }
                 kpi.InventoryDays = calcInvDays;
             }
             kpis?.Add(kpi);
         }
         return(kpis);
     }
 }
Exemplo n.º 58
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);
     }
 }
 public static System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.XPackLog> Transform(System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.ExternalStructs.XPackML.XPackMLRoot> logs)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("XPackLog", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "Transform")) {
         System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.XPackLog> buckets = new System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.XPackLog>();
         foreach (var bucket in logs ?? Enumerable.Empty <DSS1_RetailerDriverStockOptimisation.ExternalStructs.XPackML.XPackMLRoot>())
         {
             DSS1_RetailerDriverStockOptimisation.BO.XPackLog log = new DSS1_RetailerDriverStockOptimisation.BO.XPackLog();
             log.InitialRecordScore = bucket.source.initial_record_score; log.Actual = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(bucket.source.actual, 0); log.PartitionFieldValue = bucket.source.partition_field_value; log.Probability = bucket.source.probability; log.RecordScore = bucket.source.record_score; log.Timestamp = bucket.source.timestamp; log.Typical = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(bucket.source.typical, 0); buckets?.Add(log);
         }
         return(buckets);
     }
 }
Exemplo n.º 60
-1
 static void Main(string[] args)
 {
     string MyDir = @"Files\";
     //Initialize WorkbookDesigner object
     WorkbookDesigner designer = new WorkbookDesigner();
     //Load the template file
     designer.Workbook = new Workbook(MyDir+"SM_NestedObjects.xlsx");
     //Instantiate the List based on the class
     System.Collections.Generic.ICollection<Individual> list = new System.Collections.Generic.List<Individual>();
     //Create an object for the Individual class
     Individual p1 = new Individual("Damian", 30);
     //Create the relevant Wife class for the Individual
     p1.Wife = new Wife("Dalya", 28);
     //Create another object for the Individual class
     Individual p2 = new Individual("Mack", 31);
     //Create the relevant Wife class for the Individual
     p2.Wife = new Wife("Maaria", 29);
     //Add the objects to the list
     list.Add(p1);
     list.Add(p2);
     //Specify the DataSource
     designer.SetDataSource("Individual", list);
     //Process the markers
     designer.Process(false);
     //Save the Excel file.
     designer.Workbook.Save(MyDir+"out_SM_NestedObjects.xlsx");
 }