Exemplo n.º 1
0
        /// <summary>
        /// Get BoxPackage Table information sorted by BOXNUM
        /// </summary>
        /// <param name="BoxNumber">String Box Nuber</param>
        /// <returns>BoxPackage Object </returns>
        public cstBoxPackage GetSelectedByBoxNumber(String BoxNumber)
        {
            cstBoxPackage _return = new cstBoxPackage();

            try
            {
                GetService.BoxPackageDTO _boxitem = Service.Get.BoxByBoxNumber(BoxNumber);
                cstBoxPackage            _box     = new cstBoxPackage();
                _box.BoxID              = Guid.NewGuid();
                _box.PackingID          = _boxitem.PackingID;
                _box.BoxType            = _boxitem.BoxType;
                _box.BoxWeight          = Convert.ToDouble(_boxitem.BoxWeight);
                _box.BoxLength          = Convert.ToDouble(_boxitem.BoxLength);
                _box.BoxHeight          = Convert.ToDouble(_boxitem.BoxHeight);
                _box.BoxWidth           = Convert.ToDouble(_boxitem.BoxWidth);
                _box.BoxCreatedTime     = Convert.ToDateTime(_boxitem.BoxCreatedTime);
                _box.BoxMeasurementTime = Convert.ToDateTime(_boxitem.BoxMeasurementTime);
                _box.ROWID              = _boxitem.ROWID;
                _box.BOXNUM             = _boxitem.BOXNUM;
                _return = _box;
            }
            catch (Exception)
            { }
            return(_return);
        }
Exemplo n.º 2
0
        //public void getSlipdata(string BoxNumber)
        //{
        //  List<cstSlipData> slp = new List<cstSlipData>();
        //    try
        //    {
        //        slp = slip.SlipData(BoxNumber);

        //        foreach (var item in slp)
        //        {
        //            txtponumber.Text = item.CustomerPO;
        //            txtaddress.Text = item.ToAddressLine1 + item.ToAddressLine2 + item.ToAddressLine3 + item.ToAddressCity + item.ToAddressState + item.ToAddressZipCode;
        //            txtUPC.Text = item.UPCCode;
        //            txtvendor.Text = item.VendorName;
        //        }


        //    }
        //    catch (Exception)
        //    {}

        //}

        private void Window_Loaded_1(object sender, RoutedEventArgs e)
        {
            //Box Information
            cstBoxPackage _boxInfo  = Global.controller.GetBoxPackageByBoxID(Global.PrintBoxID);
            String        BoxNumber = _boxInfo.BOXNUM;

            EBoxNumber = BoxNumber;

            //Package Information
            cstPackageTbl packing        = Global.controller.GetPackingList(_boxInfo.PackingID, true);
            String        ShippingNumber = packing.ShippingNum;

            //Shipping information
            cstShippingTbl           shippingTbl     = Global.controller.GetShippingTbl(ShippingNumber);
            List <cstPackageDetails> _packingDetails = Global.controller.GetPackingDetailTbl(packing.PackingId);

            //List<cstShippingTbl> ship = Global.controller.GetShippingInfoFromSage(ShippingNumber);

            cmdGetSlipData slip    = new cmdGetSlipData();
            List <string>  skulist = slip.getSKUfromBoxNumber(BoxNumber);

            foreach (var item in skulist)
            {
                String UPC_Code = _shipment.ShipmentDetailSage.FirstOrDefault(i => i.SKU == item).UPCCode;
                txtaddress.Text  = shippingTbl.ToAddressLine1 + " " + shippingTbl.ToAddressLine2 + " " + shippingTbl.ToAddressLine3 + " " + shippingTbl.ToAddressCity + " " + shippingTbl.ToAddressState + " " + shippingTbl.ToAddressCountry + " " + shippingTbl.ToAddressZipCode;
                txtponumber.Text = shippingTbl.CustomerPO;
                //txtvendor.Text = shippingTbl.VendorName;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Get all BoxPackage Table Information
        /// </summary>
        /// <returns>List<cstBoxPackage></returns>
        public List <cstBoxPackage> GetAll()
        {
            List <cstBoxPackage> lsreturn = new List <cstBoxPackage>();

            try
            {
                var allBoxInfo = from b in Service.Get.AllBox()
                                 select b;

                foreach (var _boxitem in allBoxInfo)
                {
                    cstBoxPackage _box = new cstBoxPackage();
                    _box.BoxID              = Guid.NewGuid();
                    _box.PackingID          = _boxitem.PackingID;
                    _box.BoxType            = _boxitem.BoxType;
                    _box.BoxWeight          = Convert.ToDouble(_boxitem.BoxWeight);
                    _box.BoxLength          = Convert.ToDouble(_boxitem.BoxLength);
                    _box.BoxHeight          = Convert.ToDouble(_boxitem.BoxHeight);
                    _box.BoxWidth           = Convert.ToDouble(_boxitem.BoxWidth);
                    _box.BoxCreatedTime     = Convert.ToDateTime(_boxitem.BoxCreatedTime);
                    _box.BoxMeasurementTime = Convert.ToDateTime(_boxitem.BoxMeasurementTime);
                    _box.ROWID              = _boxitem.ROWID;
                    _box.BOXNUM             = _boxitem.BOXNUM;
                    lsreturn.Add(_box);
                }
            }
            catch (Exception)
            {}
            return(lsreturn);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Selected single Row by filter Box id
        /// </summary>
        /// <param name="BoxID">Guid Box ID</param>
        /// <returns>cstBoxPackage Object</returns>
        public cstBoxPackage GetSelectedByBoxID(Guid BoxID)
        {
            cstBoxPackage _return = new cstBoxPackage();

            try
            {
                BoxPackage _boxitem = entx3v6.BoxPackages.SingleOrDefault(i => i.BoxID == BoxID);

                cstBoxPackage _box = new cstBoxPackage();
                _box.BoxID              = Guid.NewGuid();
                _box.PackingID          = _boxitem.PackingID;
                _box.BoxType            = _boxitem.BoxType;
                _box.BoxWeight          = Convert.ToDouble(_boxitem.BoxWeight);
                _box.BoxLength          = Convert.ToDouble(_boxitem.BoxLength);
                _box.BoxHeight          = Convert.ToDouble(_boxitem.BoxHeight);
                _box.BoxWidth           = Convert.ToDouble(_boxitem.BoxWidth);
                _box.BoxCreatedTime     = Convert.ToDateTime(_boxitem.BoxCreatedTime);
                _box.BoxMeasurementTime = Convert.ToDateTime(_boxitem.BoxMeasurementTime);
                _box.ROWID              = _boxitem.ROWID;
                _box.BOXNUM             = _boxitem.BOXNUM;
                _return = _box;
            }
            catch (Exception)
            { }
            return(_return);
        }
Exemplo n.º 5
0
        /// <summary>
        /// list of information by Packing ID
        /// </summary>
        /// <param name="PackingID">Guid Packing ID</param>
        /// <returns>List<cstBoxPackage> </returns>
        public List <cstBoxPackage> GetSelectedByPackingID(Guid PackingID)
        {
            List <cstBoxPackage> lsreturn = new List <cstBoxPackage>();

            try
            {
                var allBoxInfo = from b in entx3v6.BoxPackages
                                 where b.PackingID == PackingID
                                 select b;

                foreach (var _boxitem in allBoxInfo)
                {
                    cstBoxPackage _box = new cstBoxPackage();
                    _box.BoxID              = _boxitem.BoxID;
                    _box.PackingID          = _boxitem.PackingID;
                    _box.BoxType            = _boxitem.BoxType;
                    _box.BoxWeight          = Convert.ToDouble(_boxitem.BoxWeight);
                    _box.BoxLength          = Convert.ToDouble(_boxitem.BoxLength);
                    _box.BoxHeight          = Convert.ToDouble(_boxitem.BoxHeight);
                    _box.BoxWidth           = Convert.ToDouble(_boxitem.BoxWidth);
                    _box.BoxCreatedTime     = Convert.ToDateTime(_boxitem.BoxCreatedTime);
                    _box.BoxMeasurementTime = Convert.ToDateTime(_boxitem.BoxMeasurementTime);
                    _box.ROWID              = _boxitem.ROWID;
                    _box.BOXNUM             = _boxitem.BOXNUM;
                    lsreturn.Add(_box);
                }
            }
            catch (Exception)
            { }
            return(lsreturn);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Print packing slip of barcode that has packing number and its respective shipping number;
        /// </summary>
        public void PrintPckingSlip(Guid BoxID)
        {
            try
            {
                cstBoxPackage _boxInfo = Global.controller.GetBoxPackageByBoxID(BoxID);
                BoxNumber = _boxInfo.BOXNUM;
                cstPackageTbl packing = Global.controller.GetPackingTbl().SingleOrDefault(i => i.PackingId == _boxInfo.PackingID);
                ShippingNumber = packing.ShippingNum;

                BarcodeLib.Barcode b = new BarcodeLib.Barcode();

                PackingNumber = packing.PCKROWID;

                try
                {
                    imgPackingNumber  = b.Encode(BarcodeLib.TYPE.CODE128, packing.PCKROWID, System.Drawing.Color.Black, System.Drawing.Color.White, 300, 60);
                    imgShippingNumber = b.Encode(BarcodeLib.TYPE.CODE128, ShippingNumber, System.Drawing.Color.Black, System.Drawing.Color.White, 300, 60);
                    imgBoxNumber      = b.Encode(BarcodeLib.TYPE.CODE128, BoxNumber, System.Drawing.Color.Black, System.Drawing.Color.White, 300, 60);
                }
                catch (Exception Ex)
                {
                    //Log the Error to the Error Log table
                    ErrorLoger.save("wndShipmentDetailPage - PrintPckingSlip_sub1", "[" + DateTime.UtcNow.ToString() + "]" + Ex.ToString(), DateTime.UtcNow, Global.LoggedUserId);
                }
                PrintDocument pd = new PrintDocument();
                pd.DefaultPageSettings.Margins   = new Margins(0, 0, 0, 0);
                pd.OriginAtMargins               = false;
                pd.DefaultPageSettings.Landscape = true;

                //Business card paper size
                pd.DefaultPageSettings.PaperSize = new PaperSize("BC", 330, 220);
                pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
                pd.Print();
            }
            catch (Exception Ex)
            {
                //Log the Error to the Error Log table
                ErrorLoger.save("wndShipmentDetailPage - PrintPckingSlip", "[" + DateTime.UtcNow.ToString() + "]" + Ex.ToString(), DateTime.UtcNow, Global.LoggedUserId);
            }
        }
Exemplo n.º 7
0
        private void Window_Loaded_1(object sender, RoutedEventArgs e)
        {
            cstBoxPackage _boxInfo  = Global.controller.GetBoxPackageByBoxID(Global.PrintBoxID);
            String        BoxNumber = _boxInfo.BOXNUM;

            EBoxNumber = BoxNumber;

            BarcodeLib.Barcode b = new BarcodeLib.Barcode();

            //Barcode for each label
            var sBoxNumber = b.Encode(BarcodeLib.TYPE.CODE128, BoxNumber, System.Drawing.Color.Black, System.Drawing.Color.Transparent, 400, 160);

            var bitmapBox = new System.Drawing.Bitmap(sBoxNumber);

            var bBoxSource = Imaging.CreateBitmapSourceFromHBitmap(bitmapBox.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());

            bitmapBox.Dispose();

            imgBoxNumber.Source  = bBoxSource;
            lblBoxNumber.Content = BoxNumber;
            imgBoxNumber.Stretch = Stretch.Fill;
        }
Exemplo n.º 8
0
        /// <summary>
        /// Export all data to excel file.
        /// </summary>
        /// <param name="ds">Dataset table to be export</param>
        /// <param name="filename"> File name of excel.</param>
        public static void Excel(List <String> lsPCKROWID, string filename)
        {
            List <string> Boxnumbers = new List <string>();

            foreach (var item in lsPCKROWID)
            {
                List <cstBoxPackage> lsBoxInfo = Obj.call.GetBoxPackageByPackingID(Obj.call.GetPackageIDFromROWID(item));
                foreach (cstBoxPackage boxitem in lsBoxInfo)
                {
                    Boxnumbers.Add(boxitem.BOXNUM);
                }
            }


            //Find Box information from the Box Numbers
            List <BoxManifist> _lsBoxManifist = new List <BoxManifist>();

            foreach (string item in Boxnumbers)
            {
                //Box Information
                cstBoxPackage _boxInfo = Obj.call.GetBoxPackageByBoxNumber(item);

                //Package Information
                cstPackageTbl packing = Obj.call.GetPackingList(_boxInfo.PackingID, true);

                BoxManifist manifist = new BoxManifist();
                manifist.BoxNumber      = _boxInfo.BOXNUM;
                manifist.PackingNumber  = packing.PCKROWID;
                manifist.ShippingNumber = packing.ShippingNum;
                try
                {
                    manifist.TrackingNumber = Obj.call.GetTrackingTbl(item).FirstOrDefault().TrackingNum.ToString();
                }
                catch (Exception)
                {
                    manifist.TrackingNumber = "N/A";
                }

                manifist.Location = packing.ShipmentLocation;
                manifist.Weight   = _boxInfo.BoxWeight.ToString();
                manifist.Width    = _boxInfo.BoxWidth.ToString();
                manifist.Lenght   = _boxInfo.BoxHeight.ToString();
                manifist.Height   = _boxInfo.BoxHeight.ToString();
                manifist.UserName = Obj.call.GetSelcetedUserMaster(packing.UserID).FirstOrDefault().UserFullName;

                //Convet UTC time to EST Time.
                TimeZoneInfo EstTime = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
                manifist.PackedDate = TimeZoneInfo.ConvertTimeFromUtc(packing.EndTime, EstTime).ToString("MMM dd, yyyy hh:mm:ss tt");

                _lsBoxManifist.Add(manifist);
            }



            HttpResponse response = HttpContext.Current.Response;

            // first let's clean up the response.object
            response.Clear();
            response.Charset = "";

            // set the response mime type for excel
            response.ContentType = "application/vnd.MS-Excel";
            response.AddHeader("Content-Disposition", "attachment;filename=\"" + filename + ".xls\"");

            // create a string writer
            using (StringWriter sw = new StringWriter())
            {
                using (HtmlTextWriter htw = new HtmlTextWriter(sw))
                {
                    // instantiate a datagrid
                    DataGrid dg = new DataGrid();
                    dg.DataSource = _lsBoxManifist;
                    dg.DataBind();
                    dg.RenderControl(htw);
                    response.Write(sw.ToString());
                    response.End();
                }
            }
        }
Exemplo n.º 9
0
        private void BoxSlip_Loaded(object sender, RoutedEventArgs e)
        {
            //Box Information
            cstBoxPackage _boxInfo  = Global.controller.GetBoxPackageByBoxID(Global.PrintBoxID);
            String        BoxNumber = _boxInfo.BOXNUM;

            EBoxNumber = BoxNumber;

            //Package Information
            cstPackageTbl packing        = Global.controller.GetPackingList(_boxInfo.PackingID, true);
            String        ShippingNumber = packing.ShippingNum;

            //Shipping information
            cstShippingTbl           shippingTbl     = Global.controller.GetShippingTbl(ShippingNumber);
            List <cstPackageDetails> _packingDetails = Global.controller.GetPackingDetailTbl(packing.PackingId);

            //Sku Quantity.
            var SKUQty = from ls in _packingDetails
                         where ls.BoxNumber == BoxNumber
                         select new
            {
                SkuCount = ls.SKUQuantity
            };

            int SkuQuantity = SKUQty.Sum(i => i.SkuCount);
            //User Packing Shippment
            String Username = Global.controller.GetSelcetedUserMaster(packing.UserID)[0].UserName.ToString();

            //Grid Fill with SKU Name and Product Name
            var _packDetail = from ls in _packingDetails
                              where ls.BoxNumber == BoxNumber
                              select new
            {
                SKUNumber   = ls.SKUNumber + " -" + ls.ProductName,
                SKUQuantity = ls.SKUQuantity
            };

            //var _packDetail = (from ls in _packingDetails
            //                   where ls.BoxNumber == BoxNumber &&
            //                    ls.SKUNumber == Global.skuNamefor
            //                   orderby ls.SKUQuantity descending //&& Max ls.SKUQuantity

            //                   select new
            //                   {
            //                       SKUNumber = ls.SKUNumber + " -" + ls.ProductName,
            //                       SKUQuantity = ls.SKUQuantity
            //                   }).Take(1).ToList();

            //var pack=_packDetail.Max(

            Global.skuNamefor = "";
            //Box Number(package Box Packing)
            int BoxCount = (from pd in _packingDetails
                            group pd by pd.BoxNumber into Gpd
                            select Gpd).Count();


            //Barcode Liabrary
            BarcodeLib.Barcode b = new BarcodeLib.Barcode();

            //Barcode for each label
            var sBoxNumber      = b.Encode(BarcodeLib.TYPE.CODE128, BoxNumber, System.Drawing.Color.Black, System.Drawing.Color.Transparent, 400, 160);
            var sBoxTopNumber   = b.Encode(BarcodeLib.TYPE.CODE128, BoxNumber, System.Drawing.Color.Black, System.Drawing.Color.Transparent, 380, 50);
            var sSOoNumber      = b.Encode(BarcodeLib.TYPE.CODE128, shippingTbl.OrderID, System.Drawing.Color.Black, System.Drawing.Color.Transparent, 380, 50);
            var sPCKNumber      = b.Encode(BarcodeLib.TYPE.CODE128, packing.PCKROWID, System.Drawing.Color.Black, System.Drawing.Color.Transparent, 380, 50);
            var sShippingNumber = b.Encode(BarcodeLib.TYPE.CODE128, shippingTbl.ShippingNum, System.Drawing.Color.Black, System.Drawing.Color.Transparent, 380, 50);


            //Image Conversion
            var bitmapBox      = new System.Drawing.Bitmap(sBoxNumber);
            var bitmapBoxTop   = new System.Drawing.Bitmap(sBoxTopNumber);
            var bitmapShipping = new System.Drawing.Bitmap(sShippingNumber);
            var bitmapSO       = new System.Drawing.Bitmap(sSOoNumber);
            var bitmapPCK      = new System.Drawing.Bitmap(sPCKNumber);



            var bBoxSource      = Imaging.CreateBitmapSourceFromHBitmap(bitmapBox.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
            var bBoxTopSource   = Imaging.CreateBitmapSourceFromHBitmap(bitmapBoxTop.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
            var bShippingSource = Imaging.CreateBitmapSourceFromHBitmap(bitmapShipping.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
            var bShOSource      = Imaging.CreateBitmapSourceFromHBitmap(bitmapSO.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
            var bSPCKSource     = Imaging.CreateBitmapSourceFromHBitmap(bitmapPCK.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());

            bitmapBox.Dispose();
            bitmapBoxTop.Dispose();
            bitmapShipping.Dispose();
            bitmapSO.Dispose();
            bitmapPCK.Dispose();

            //assign source to images
            imgBoxNumber.Source  = bBoxSource;
            lblBoxNumber.Content = BoxNumber;
            imgBoxNumber.Stretch = Stretch.Fill;


            imgBOxNumTop.Source     = bBoxTopSource;
            lblBoxTupNumber.Content = BoxNumber;

            imgShipping.Source  = bShippingSource;
            lblShipment.Content = ShippingNumber;

            imgSO.Source        = bShOSource;
            lblSoNumber.Content = shippingTbl.OrderID;

            imgPackNum.Source = bSPCKSource;
            lblPckNum.Content = packing.PCKROWID;


            //packing Detal Info
            tbPackageBox.Text     = BoxCount.ToString() + " [SKU QTY: " + SkuQuantity + "]";
            tbCarrier.Text        = shippingTbl.Carrier + " / " + shippingTbl.MDL_0;
            tbPoNum.Text          = shippingTbl.CustomerPO.ToString();
            tbDealer.Text         = shippingTbl.VendorName.ToString();
            tbWarehouse.Text      = Global.controller.ApplicationLocation();
            tbUserName.Text       = Username;
            dgSKUinfo.ItemsSource = _packDetail.ToList();
            tbPackingTime.Text    = packing.EndTime.ToString("MMM dd, yyyy hh:mm tt");
            lblBDate.Content      = DateTime.UtcNow.ToString("dd MMM, yyyy hh:mm tt").TrimStart('0').ToString();
        }