public Int32 PartialInsert(string OrderNumber, string Payee, string DeliveryAddress, string Country, int? CompanyID, int? ContactID, DateTime? CargoReady , string Fao)
        {
            PublishipAdvanceOrderTable item = new PublishipAdvanceOrderTable();

            item.OrderNumber = OrderNumber != null? OrderNumber: "[new order]";

            item.DateOrderReceived = DateTime.Now; //DateTime.Now.ToString("yyyy-MM-dd"); //to avoid Conversion failed when converting date and/or time from character string.

            item.Payee = Payee;

            item.DeliveryAddress = DeliveryAddress;

            item.DestinationCountry = Country;

            item.CompanyID = CompanyID;

            item.ContactID = ContactID;

            //if (!string.IsNullOrEmpty(CargoReady))
            //{
                //DateTime _dt = new DateTime();
                //_dt = DateTime.ParseExact(CargoReady, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat); 
            item.CargoReadyDate = CargoReady; //Convert.ToDateTime(CargoReady).ToString("yyyy-MM-dd");
            //}

            item.Fao = Fao;
            
            item.Save(UserName);

            Int32 _returnId = (Int32)item.GetPrimaryKeyValue();
            return _returnId;
        }
    //end append order
    /// <summary>
    /// update if we have an order id
    /// </summary>
    /// <param name="orderid"></param>
    protected void update_order(Int32 orderid)
    {
        //string _addr = this.dxmemaddress.Text.Length > 200 ? this.dxmemaddress.Text.Substring(0, 200).ToString() : this.dxmemaddress.Text.ToString();
        int    _len  = this.dxmemaddress.Text.Length > 200 ? 200 : this.dxmemaddress.Text.Length;
        string _addr = wwi_func.no_sql(this.dxmemaddress.Text.ToString().Substring(0, _len));
        string _dest = this.dxcbocountry.Text != null?this.dxcbocountry.Text.ToString() : "";

        DateTime _cargo = wwi_func.vdatetime(this.dxdtcargoready.Text);

        PublishipAdvanceOrderTable _o = new PublishipAdvanceOrderTable(orderid);

        _o.Payee              = this.dxtxtpayee.Text.ToString();
        _o.DeliveryAddress    = _addr;
        _o.DestinationCountry = _dest;
        _o.CargoReadyDate     = _cargo;
        _o.Fao = this.dxtxtfao.Text.ToString();
        _o.Save();

        //PublishipAdvanceOrderTableCollection _o = new PublishipAdvanceOrderTableCollection().Where("OrderID", SubSonic.Comparison.Equals, orderid).Load();
        //_o[0].Payee = this.dxtxtpayee.Text.ToString();
        //_o[0].DeliveryAddress = this.dxmemaddress.Text.ToString();
        //_o[0].Fao  = this.dxtxtfao.Text.ToString();
        //_o[0].Cartons = this.dxhforder.Contains("cartons") ? wwi_func.vint(this.dxhforder.Get("cartons").ToString()) : 0;
        //_o[0].Save();
    }
        public Int32 PartialInsert(string OrderNumber, string Payee, string DeliveryAddress, string Country, int?CompanyID, int?ContactID, DateTime?CargoReady, string Fao)
        {
            PublishipAdvanceOrderTable item = new PublishipAdvanceOrderTable();

            item.OrderNumber = OrderNumber != null? OrderNumber: "[new order]";

            item.DateOrderReceived = DateTime.Now; //DateTime.Now.ToString("yyyy-MM-dd"); //to avoid Conversion failed when converting date and/or time from character string.

            item.Payee = Payee;

            item.DeliveryAddress = DeliveryAddress;

            item.DestinationCountry = Country;

            item.CompanyID = CompanyID;

            item.ContactID = ContactID;

            //if (!string.IsNullOrEmpty(CargoReady))
            //{
            //DateTime _dt = new DateTime();
            //_dt = DateTime.ParseExact(CargoReady, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat);
            item.CargoReadyDate = CargoReady; //Convert.ToDateTime(CargoReady).ToString("yyyy-MM-dd");
            //}

            item.Fao = Fao;

            item.Save(UserName);

            Int32 _returnId = (Int32)item.GetPrimaryKeyValue();

            return(_returnId);
        }
        public void PartialUpdate(int OrderID, string OrderNumber, string Payee, string DeliveryAddress, string Country, int?CompanyID, int?ContactID, DateTime?CargoReady, string Fao)
        {
            PublishipAdvanceOrderTable item = new PublishipAdvanceOrderTable();

            item.MarkOld();
            item.IsLoaded = true;

            item.OrderID = OrderID;

            item.OrderNumber = OrderNumber;

            item.Payee = Payee;

            item.DeliveryAddress = DeliveryAddress;

            item.DestinationCountry = Country;

            item.CompanyID = CompanyID;

            item.ContactID = ContactID;

            //if (!string.IsNullOrEmpty(CargoReady))
            //{
            //    item.CargoReadyDate = Convert.ToDateTime(CargoReady).ToString("yyyy-MM-dd");
            //}
            item.CargoReadyDate = CargoReady;

            item.Fao = Fao;

            item.Save(UserName);
        }
    protected void order_DataBind(Int32 orderid, string sender, string printerid)
    {
        PublishipAdvanceOrderTable _o = new PublishipAdvanceOrderTable(orderid);

        if (_o != null)
        {
            this.dxlblorderno2.Text = _o.OrderID.ToString();
            this.dxmemaddress.Text  = _o.DeliveryAddress.ToString();
            this.dxtxtfao.Text      = _o.Fao.ToString();
            this.dxlblsender2.Text  = sender;
            this.dxlblprinter2.Text = printerid;
        }
    }
        public void UpdateCartonCount(int OrderID, int newValue)
        {
            PublishipAdvanceOrderTable item = new PublishipAdvanceOrderTable();

            item.MarkOld();
            item.IsLoaded = true;

            item.OrderID = OrderID;
            int _v = item.Cartons ?? 0;

            item.Cartons = _v + newValue >= 0 ? _v + newValue : 0;

            item.Save(UserName);
        }
    //end save cartons

    /// <summary>
    /// return tallies for titles and cartons for current order and update order table
    /// </summary>
    /// <param name="orderid"></param>
    protected void set_tallies(Int32 orderid)
    {
        if (orderid > 0)
        {
            int _titles  = get_tally_title(orderid);
            int _cartons = get_tally_cartons(orderid);

            //update order table
            PublishipAdvanceOrderTable _o = new PublishipAdvanceOrderTable(orderid);
            _o.Cartons = _cartons;
            _o.Titles  = _titles;
            _o.Save();

            this.dxlbltitles1.Text  = _titles.ToString();
            this.dxlblcartons1.Text = _cartons.ToString();
        }
    }
        public void UpdateCartonCount(int OrderID, int newValue)
        {
            PublishipAdvanceOrderTable item = new PublishipAdvanceOrderTable();
            item.MarkOld();
            item.IsLoaded = true;

            item.OrderID = OrderID;
            int _v = item.Cartons ?? 0;
            item.Cartons = _v + newValue >= 0 ? _v + newValue : 0;

            item.Save(UserName);
        }
        public void PartialUpdate(int OrderID, string OrderNumber, string Payee, string DeliveryAddress, string Country, int? CompanyID, int? ContactID, DateTime? CargoReady, string Fao)
        {
            PublishipAdvanceOrderTable item = new PublishipAdvanceOrderTable();
            item.MarkOld();
            item.IsLoaded = true;

            item.OrderID = OrderID;

            item.OrderNumber = OrderNumber;

            item.Payee = Payee;

            item.DeliveryAddress = DeliveryAddress;

            item.DestinationCountry = Country;

            item.CompanyID = CompanyID;

            item.ContactID = ContactID;

            //if (!string.IsNullOrEmpty(CargoReady))
            //{
            //    item.CargoReadyDate = Convert.ToDateTime(CargoReady).ToString("yyyy-MM-dd");
            //}
            item.CargoReadyDate = CargoReady;

            item.Fao = Fao;

            item.Save(UserName);
        }
    //end append order
    /// <summary>
    /// update if we have an order id
    /// </summary>
    /// <param name="orderid"></param>
    protected void update_order(Int32 orderid)
    {
        //string _addr = this.dxmemaddress.Text.Length > 200 ? this.dxmemaddress.Text.Substring(0, 200).ToString() : this.dxmemaddress.Text.ToString();
        int _len = this.dxmemaddress.Text.Length > 200 ? 200 : this.dxmemaddress.Text.Length;
        string _addr = wwi_func.no_sql(this.dxmemaddress.Text.ToString().Substring(0, _len));  
        string _dest = this.dxcbocountry.Text != null ? this.dxcbocountry.Text.ToString() : "";
        DateTime _cargo = wwi_func.vdatetime(this.dxdtcargoready.Text);

        PublishipAdvanceOrderTable _o = new PublishipAdvanceOrderTable(orderid);
        _o.Payee = this.dxtxtpayee.Text.ToString();
        _o.DeliveryAddress = _addr;
        _o.DestinationCountry = _dest;
        _o.CargoReadyDate = _cargo;
        _o.Fao  = this.dxtxtfao.Text.ToString();
        _o.Save(); 
  
        //PublishipAdvanceOrderTableCollection _o = new PublishipAdvanceOrderTableCollection().Where("OrderID", SubSonic.Comparison.Equals, orderid).Load();
        //_o[0].Payee = this.dxtxtpayee.Text.ToString();
        //_o[0].DeliveryAddress = this.dxmemaddress.Text.ToString();
        //_o[0].Fao  = this.dxtxtfao.Text.ToString();
        //_o[0].Cartons = this.dxhforder.Contains("cartons") ? wwi_func.vint(this.dxhforder.Get("cartons").ToString()) : 0;  
        //_o[0].Save(); 
  
    }
 protected void order_DataBind(Int32 orderid, string sender, string printerid)
 {
     PublishipAdvanceOrderTable _o = new PublishipAdvanceOrderTable(orderid);
     if (_o != null)
     {
         this.dxlblorderno2.Text = _o.OrderID.ToString();
         this.dxmemaddress.Text = _o.DeliveryAddress.ToString();
         this.dxtxtfao.Text = _o.Fao.ToString();
         this.dxlblsender2.Text = sender;
         this.dxlblprinter2.Text = printerid; 
     }
 }
    //end save cartons

    /// <summary>
    /// return tallies for titles and cartons for current order and update order table
    /// </summary>
    /// <param name="orderid"></param>
    protected void set_tallies(Int32 orderid)
    {
        
        if(orderid > 0)
        {
            int _titles = get_tally_title(orderid);
            int _cartons = get_tally_cartons(orderid); 

            //update order table
            PublishipAdvanceOrderTable _o = new PublishipAdvanceOrderTable(orderid);
            _o.Cartons = _cartons;
            _o.Titles = _titles; 
            _o.Save();

            this.dxlbltitles1.Text = _titles.ToString();
            this.dxlblcartons1.Text = _cartons.ToString(); 

        }
    }
	    public void Insert(string OrderNumber,DateTime? DateOrderReceived,string Payee,string DeliveryAddress,string DestinationCountry,int? CompanyID,int? ConsigneeID,int? PrinterID,string CustomerRef,string PrintersRef,int? ContactID,DateTime? CargoReadyDate,DateTime? CargoReceivedDate,int? OriginID,int? DestID,int? FinalDestID,int? DeliveryAddressID,int? AttentionOfID,int? FlightID,DateTime? Etd,DateTime? Eta,string HAWBno,bool? HAWBAdded,bool? ShippedonBoard,int? Titles,int? Cartons,decimal? ActualWeight,decimal? ActualVolume,string RemarkstoAgent,string RemarkstoCust,bool? JobClosed,string JobClosureDate,string CompositeInvRef,decimal? InsuranceValue,DateTime? CancelRequestRcd,int? CancelRequestByID,bool? OrderCancelled,DateTime? CancelDate,int? CancelledByID,string Fao,byte[] Ts)
	    {
		    PublishipAdvanceOrderTable item = new PublishipAdvanceOrderTable();
		    
            item.OrderNumber = OrderNumber;
            
            item.DateOrderReceived = DateOrderReceived;
            
            item.Payee = Payee;
            
            item.DeliveryAddress = DeliveryAddress;
            
            item.DestinationCountry = DestinationCountry;
            
            item.CompanyID = CompanyID;
            
            item.ConsigneeID = ConsigneeID;
            
            item.PrinterID = PrinterID;
            
            item.CustomerRef = CustomerRef;
            
            item.PrintersRef = PrintersRef;
            
            item.ContactID = ContactID;
            
            item.CargoReadyDate = CargoReadyDate;
            
            item.CargoReceivedDate = CargoReceivedDate;
            
            item.OriginID = OriginID;
            
            item.DestID = DestID;
            
            item.FinalDestID = FinalDestID;
            
            item.DeliveryAddressID = DeliveryAddressID;
            
            item.AttentionOfID = AttentionOfID;
            
            item.FlightID = FlightID;
            
            item.Etd = Etd;
            
            item.Eta = Eta;
            
            item.HAWBno = HAWBno;
            
            item.HAWBAdded = HAWBAdded;
            
            item.ShippedonBoard = ShippedonBoard;
            
            item.Titles = Titles;
            
            item.Cartons = Cartons;
            
            item.ActualWeight = ActualWeight;
            
            item.ActualVolume = ActualVolume;
            
            item.RemarkstoAgent = RemarkstoAgent;
            
            item.RemarkstoCust = RemarkstoCust;
            
            item.JobClosed = JobClosed;
            
            item.JobClosureDate = JobClosureDate;
            
            item.CompositeInvRef = CompositeInvRef;
            
            item.InsuranceValue = InsuranceValue;
            
            item.CancelRequestRcd = CancelRequestRcd;
            
            item.CancelRequestByID = CancelRequestByID;
            
            item.OrderCancelled = OrderCancelled;
            
            item.CancelDate = CancelDate;
            
            item.CancelledByID = CancelledByID;
            
            item.Fao = Fao;
            
            item.Ts = Ts;
            
	    
		    item.Save(UserName);
	    }
Ejemplo n.º 14
0
        public void Insert(string OrderNumber, DateTime?DateOrderReceived, string Payee, string DeliveryAddress, string DestinationCountry, int?CompanyID, int?ConsigneeID, int?PrinterID, string CustomerRef, string PrintersRef, int?ContactID, DateTime?CargoReadyDate, DateTime?CargoReceivedDate, int?OriginID, int?DestID, int?FinalDestID, int?DeliveryAddressID, int?AttentionOfID, int?FlightID, DateTime?Etd, DateTime?Eta, string HAWBno, bool?HAWBAdded, bool?ShippedonBoard, int?Titles, int?Cartons, decimal?ActualWeight, decimal?ActualVolume, string RemarkstoAgent, string RemarkstoCust, bool?JobClosed, string JobClosureDate, string CompositeInvRef, decimal?InsuranceValue, DateTime?CancelRequestRcd, int?CancelRequestByID, bool?OrderCancelled, DateTime?CancelDate, int?CancelledByID, string Fao, byte[] Ts)
        {
            PublishipAdvanceOrderTable item = new PublishipAdvanceOrderTable();

            item.OrderNumber = OrderNumber;

            item.DateOrderReceived = DateOrderReceived;

            item.Payee = Payee;

            item.DeliveryAddress = DeliveryAddress;

            item.DestinationCountry = DestinationCountry;

            item.CompanyID = CompanyID;

            item.ConsigneeID = ConsigneeID;

            item.PrinterID = PrinterID;

            item.CustomerRef = CustomerRef;

            item.PrintersRef = PrintersRef;

            item.ContactID = ContactID;

            item.CargoReadyDate = CargoReadyDate;

            item.CargoReceivedDate = CargoReceivedDate;

            item.OriginID = OriginID;

            item.DestID = DestID;

            item.FinalDestID = FinalDestID;

            item.DeliveryAddressID = DeliveryAddressID;

            item.AttentionOfID = AttentionOfID;

            item.FlightID = FlightID;

            item.Etd = Etd;

            item.Eta = Eta;

            item.HAWBno = HAWBno;

            item.HAWBAdded = HAWBAdded;

            item.ShippedonBoard = ShippedonBoard;

            item.Titles = Titles;

            item.Cartons = Cartons;

            item.ActualWeight = ActualWeight;

            item.ActualVolume = ActualVolume;

            item.RemarkstoAgent = RemarkstoAgent;

            item.RemarkstoCust = RemarkstoCust;

            item.JobClosed = JobClosed;

            item.JobClosureDate = JobClosureDate;

            item.CompositeInvRef = CompositeInvRef;

            item.InsuranceValue = InsuranceValue;

            item.CancelRequestRcd = CancelRequestRcd;

            item.CancelRequestByID = CancelRequestByID;

            item.OrderCancelled = OrderCancelled;

            item.CancelDate = CancelDate;

            item.CancelledByID = CancelledByID;

            item.Fao = Fao;

            item.Ts = Ts;


            item.Save(UserName);
        }
Ejemplo n.º 15
0
 public bool Destroy(object OrderID)
 {
     return(PublishipAdvanceOrderTable.Destroy(OrderID) == 1);
 }
 public bool DeleteByOrderID(object OrderID)
 {
     return(PublishipAdvanceOrderTable.Delete(OrderID) == 1);
 }