Ejemplo n.º 1
0
 /// <summary>
 /// Mark done with delivery date or parcel no.
 /// </summary>
 public void MarkDone(nisanOrder order, DateTime delivery, string remarks)
 {
     System.Diagnostics.Debug.WriteLine("Marking done");
     order.delivered = delivery.ToString("yyyy-MM-dd");
     order.OnPropertyChanged("hasDeliver");
     if (!string.IsNullOrEmpty(remarks))
         order.remarks += remarks;
 }
Ejemplo n.º 2
0
 public void RemoveOrder(nisanOrder order)
 {
     this.itemsField.Remove(order);
     this.Orders.Remove(order);
     this.NewItems.Remove(order);
 }
Ejemplo n.º 3
0
        public void GenerateSvg(nisanOrder order)
        {
            // check file exist if not only write
            string file = "Output" + System.IO.Path.DirectorySeparatorChar + order.name + ".svg";
            if (System.IO.File.Exists(file))
            {
                // Inkscape installed path not same at different computer.
                string filePath = @"C:\Program Files\Inkscape\inkscape.exe";
                if (System.IO.File.Exists(filePath))
                    filePath = "\"" + filePath + "\"";
                else
                {
                    filePath = filePath.Replace("Program Files", "Program Files (x86)");
                    if (System.IO.File.Exists(filePath))
                        filePath = "\"" + filePath + "\"";
                    else
                        return;
                }

                Process process = new Process();
                ProcessStartInfo startInfo = new ProcessStartInfo();
                //startInfo.WindowStyle = ProcessWindowStyle.Hidden;
                startInfo.FileName = filePath;
                startInfo.Arguments = "\"" + file + "\"";
                process.StartInfo = startInfo;
                process.Start();
                System.Diagnostics.Debug.WriteLine(filePath + " " + startInfo.Arguments);
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("Generating svg for " + order.name);
                string template = GetSvgTemplate(order.item);
                HLGranite.Jawi.nisanOrder jOrder = CloneOrder(order);
                SvgWriter writer = new SvgWriter(jOrder, template);
                writer.Write();
            }
        }
Ejemplo n.º 4
0
 public void CreateOrder()
 {
     // TODO: Use last nisanOrder stock object. Mostly new orders are in same stock bulk to a customer.
     nisanOrder order = new nisanOrder();
     order.soldto = "";
     order.item = "";
     order.date = DateTime.Today.ToString("yyyy-MM-dd");
     order.delivered = "";
     order.price = 0m;
     order.death = "";
     order.name = "";
     this.itemsField.Add(order);
     this.Orders.Add(order);
     this.NewItems.Add(order);
 }