Пример #1
0
    protected void bind_company(string mode)
    {
        //SubSonic.Query _q = new SubSonic.Query(Tables.NameAndAddressBook, "WWIProv").WHERE("CompanyID", Comparison.Equals, _pid);
        DAL.Logistics.NameAndAddressBookCollection _tbc = new DAL.Logistics.NameAndAddressBookCollection();

        if (mode != "Insert")
        {
            int _pid = wwi_func.vint(wwi_security.DecryptString(get_token("pid").ToString(), "publiship"));
            //int _pid = wwi_func.vint(get_token("pid"));


            DAL.Logistics.NameAndAddressBook _tbl = new DAL.Logistics.NameAndAddressBook(_pid);
            _tbc.Add(_tbl);
        }
        else
        {
            DAL.Logistics.NameAndAddressBook _tbl = new DAL.Logistics.NameAndAddressBook();
            _tbc.Add(_tbl);
        }

        string[] _keys = { "CompanyID" };
        //IDataReader _dr = _q.ExecuteReader(); 
        this.fmvAddressBook.DataSource = _tbc; //_dr;
        this.fmvAddressBook.DataKeyNames = _keys;
        this.fmvAddressBook.DataBind();
        //_dr.Close(); 


    }
Пример #2
0
    protected void bind_company(string mode)
    {
        //SubSonic.Query _q = new SubSonic.Query(Tables.NameAndAddressBook, "WWIProv").WHERE("CompanyID", Comparison.Equals, _pid);
        DAL.Logistics.NameAndAddressBookCollection _tbc = new DAL.Logistics.NameAndAddressBookCollection();

        if (mode != "Insert")
        {
            int _pid = wwi_func.vint(wwi_security.DecryptString(get_token("pid").ToString(), "publiship"));
            //int _pid = wwi_func.vint(get_token("pid"));


            DAL.Logistics.NameAndAddressBook _tbl = new DAL.Logistics.NameAndAddressBook(_pid);
            _tbc.Add(_tbl);
        }
        else
        {
            DAL.Logistics.NameAndAddressBook _tbl = new DAL.Logistics.NameAndAddressBook();
            _tbc.Add(_tbl);
        }

        string[] _keys = { "CompanyID" };
        //IDataReader _dr = _q.ExecuteReader();
        this.fmvAddressBook.DataSource   = _tbc; //_dr;
        this.fmvAddressBook.DataKeyNames = _keys;
        this.fmvAddressBook.DataBind();
        //_dr.Close();
    }
        public void Insert(string CompanyName, bool?Customer, string Address1, string Address2, string Address3, string PostCode, int?CountryID, string TelNo, string FaxNo, string MainEmail, int?TypeID, bool?Consignee, bool?Insurance, bool?SalesModule, bool?Exporter, string VATNumber, string DefermentNumber, DateTime?DateRecordAdded, int?RecordAddedBY, int?SalesBy, string PalletDims, int?MaxPalletWeight, int?MaxPalletHeight, string SpecialDeliveryInstructions, int?PricerGroup, byte[] Ts)
        {
            NameAndAddressBook item = new NameAndAddressBook();

            item.CompanyName = CompanyName;

            item.Customer = Customer;

            item.Address1 = Address1;

            item.Address2 = Address2;

            item.Address3 = Address3;

            item.PostCode = PostCode;

            item.CountryID = CountryID;

            item.TelNo = TelNo;

            item.FaxNo = FaxNo;

            item.MainEmail = MainEmail;

            item.TypeID = TypeID;

            item.Consignee = Consignee;

            item.Insurance = Insurance;

            item.SalesModule = SalesModule;

            item.Exporter = Exporter;

            item.VATNumber = VATNumber;

            item.DefermentNumber = DefermentNumber;

            item.DateRecordAdded = DateRecordAdded;

            item.RecordAddedBY = RecordAddedBY;

            item.SalesBy = SalesBy;

            item.PalletDims = PalletDims;

            item.MaxPalletWeight = MaxPalletWeight;

            item.MaxPalletHeight = MaxPalletHeight;

            item.SpecialDeliveryInstructions = SpecialDeliveryInstructions;

            item.PricerGroup = PricerGroup;

            item.Ts = Ts;


            item.Save(UserName);
        }
 public bool Destroy(object CompanyID)
 {
     return(NameAndAddressBook.Destroy(CompanyID) == 1);
 }