Beispiel #1
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                ICashierShift cashierShiftsCasted = item.As <ICashierShift>();

                if ((cashierShiftsCasted != null))
                {
                    this._parent.CashierShifts.Add(cashierShiftsCasted);
                }
                if ((this._parent.ElectronicAddress == null))
                {
                    IElectronicAddress electronicAddressCasted = item.As <IElectronicAddress>();
                    if ((electronicAddressCasted != null))
                    {
                        this._parent.ElectronicAddress = electronicAddressCasted;
                        return;
                    }
                }
                if ((this._parent.Vendor == null))
                {
                    IVendor vendorCasted = item.As <IVendor>();
                    if ((vendorCasted != null))
                    {
                        this._parent.Vendor = vendorCasted;
                        return;
                    }
                }
            }
        public IEnumerable<VendorFileRawEntry> ReadEntries(File file, IVendor vendor)
        {
            int entryNumber = 0;
            var entires = new List<VendorFileRawEntry>();

            file.ReadTextFrom(reader =>
            {
                while (true)
                {
                    var line = reader.ReadLine();

                    if (line == null) break;

                    entryNumber++;

                    var entry = new VendorFileRawEntry
                    {
                        EntryNumber = entryNumber,
                        File = file,
                        RawData = line,
                        Vendor = vendor,
                        EffectiveDate = DateTime.Today
                    };

                    entires.Add(entry);
                }
            }, true);

            return entires;
        }
 public WebmoneyAccount(string login, string id, string pass, IVendor vend)
 {
     Login    = login;
     Id       = id;
     Password = pass;
     Vendor   = vend;
 }
Beispiel #4
0
    public static void BuyItem(ShellCore core, int index, IVendor vendor)
    {
        if (core.unitsCommanding.Count >= core.GetTotalCommandLimit())
        {
            return;
        }
        GameObject creation = new GameObject();

        creation.transform.position = vendor.GetPosition();
        var blueprint = vendor.GetVendingBlueprint();

        switch (blueprint.items[index].entityBlueprint.intendedType)
        {
        case EntityBlueprint.IntendedType.Turret:
            Turret tur = creation.AddComponent <Turret>();
            tur.blueprint = blueprint.items[index].entityBlueprint;
            core.SetTractorTarget(creation.GetComponent <Draggable>());
            tur.SetOwner(core);
            break;

        case EntityBlueprint.IntendedType.Tank:
            Tank tank = creation.AddComponent <Tank>();
            tank.blueprint = blueprint.items[index].entityBlueprint;
            tank.SetOwner(core);
            break;

        default:
            break;
        }
        creation.GetComponent <Entity>().spawnPoint = vendor.GetPosition();
        creation.GetComponent <Entity>().faction    = core.faction;
        creation.name = blueprint.items[index].entityBlueprint.name;
        core.sectorMngr.InsertPersistentObject(blueprint.items[index].entityBlueprint.name, creation);
        core.AddPower(-blueprint.items[index].cost);
    }
Beispiel #5
0
 /// <summary>
 /// Adds the given element to the collection
 /// </summary>
 /// <param name="item">The item to add</param>
 public override void Add(IModelElement item)
 {
     if ((this._parent.BankAccount == null))
     {
         IBankAccount bankAccountCasted = item.As <IBankAccount>();
         if ((bankAccountCasted != null))
         {
             this._parent.BankAccount = bankAccountCasted;
             return;
         }
     }
     if ((this._parent.MerchantAccount == null))
     {
         IMerchantAccount merchantAccountCasted = item.As <IMerchantAccount>();
         if ((merchantAccountCasted != null))
         {
             this._parent.MerchantAccount = merchantAccountCasted;
             return;
         }
     }
     if ((this._parent.Vendor == null))
     {
         IVendor vendorCasted = item.As <IVendor>();
         if ((vendorCasted != null))
         {
             this._parent.Vendor = vendorCasted;
             return;
         }
     }
 }
Beispiel #6
0
        public void Setup()
        {
            _vendorCollection = new Collection <IVendorProduct <IItemInstance> >(10);
            _vendorCurrencies = new CurrencyCollection();

            _gold = new Currency(Guid.NewGuid(), "Gold", "GOLD", 2, 999f);

            _vendor             = new Vendor <IItemInstance>(new VendorConfig(), _vendorCollection, _vendorCurrencies);
            _customerCollection = new Collection <IItemInstance>(10);
            _customerCurrencies = new CurrencyCollection();
            _customer           = new Customer <IItemInstance>(Guid.NewGuid(), null, new CollectionGroup <IItemInstance>(new []
            {
                new CollectionGroup <IItemInstance> .Slot(_customerCollection),
            }), new CurrencyCollectionGroup <ICurrency>(_customerCurrencies));

            _item1 = new ItemInstance(Guid.NewGuid(), new ItemDefinition(Guid.NewGuid())
            {
                maxStackSize = 5, buyPrice = new[] { new CurrencyDecorator <double>(_gold, 1d) }, sellPrice = new[] { new CurrencyDecorator <double>(_gold, 0.6d) }
            });
            _item2 = new ItemInstance(Guid.NewGuid(), new ItemDefinition(Guid.NewGuid())
            {
                maxStackSize = 5, buyPrice = new[] { new CurrencyDecorator <double>(_gold, 2d) }, sellPrice = new[] { new CurrencyDecorator <double>(_gold, 1.6d) }
            });

            _product1 = new VendorProduct <IItemInstance>(_item1, _item1.itemDefinition.buyPrice, _item1.itemDefinition.sellPrice);
            _product2 = new VendorProduct <IItemInstance>(_item2, _item2.itemDefinition.buyPrice, _item2.itemDefinition.sellPrice);
        }
Beispiel #7
0
        /// <summary>
        /// given a schemaLoaderType and dbConnType
        /// (e.g. DbLinq.Oracle.OracleSchemaLoader and System.Data.OracleClient.OracleConnection),
        /// return an instance of the OracleSchemaLoader.
        /// </summary>
        public ISchemaLoader Load(Parameters parameters, Type dbLinqSchemaLoaderType, Type databaseConnectionType, Type sqlDialectType)
        {
            if (dbLinqSchemaLoaderType == null)
            {
                throw new ArgumentNullException("dbLinqSchemaLoaderType");
            }
            if (databaseConnectionType == null)
            {
                throw new ArgumentNullException("databaseConnectionType");
            }

            string errorMsg = "";

            try
            {
                errorMsg = "Failed on Activator.CreateInstance(" + dbLinqSchemaLoaderType.Name + ")";
                var loader = (ISchemaLoader)Activator.CreateInstance(dbLinqSchemaLoaderType);
                // set log output
                loader.Log = Log;

                errorMsg = "Failed on Activator.CreateInstance(" + databaseConnectionType.Name + ")";
                var connection = (IDbConnection)Activator.CreateInstance(databaseConnectionType);

                IVendor vendor = null;
                if (sqlDialectType != null)
                {
                    errorMsg      = "Failed on Activator.CreateInstance(" + sqlDialectType.Name + ")";
                    vendor        = (IVendor)Activator.CreateInstance(sqlDialectType);
                    loader.Vendor = vendor;
                }

                if (parameters != null)
                {
                    string connectionString = parameters.Conn;
                    if (string.IsNullOrEmpty(connectionString))
                    {
                        connectionString = loader.Vendor.BuildConnectionString(parameters.Server, parameters.Database,
                                                                               parameters.User, parameters.Password);
                    }
                    errorMsg = "Failed on setting ConnectionString=" + connectionString;
                    connection.ConnectionString = connectionString;
                }

                errorMsg          = "";
                loader.Connection = connection;
                return(loader);
            }
            catch (Exception ex)
            {
                //see Pascal's comment on this failure:
                //http://groups.google.com/group/dblinq/browse_thread/thread/b7a29138435b0678
                Output.WriteErrorLine(Log, "LoaderFactory.Load(schemaType=" + dbLinqSchemaLoaderType.Name + ", dbConnType=" + databaseConnectionType.Name + ")");
                if (errorMsg != "")
                {
                    Output.WriteErrorLine(Log, errorMsg);
                }
                Output.WriteErrorLine(Log, "LoaderFactory.Load() failed: " + ex.Message);
                throw;
            }
        }
Beispiel #8
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IReceipt receiptsCasted = item.As <IReceipt>();

                if ((receiptsCasted != null))
                {
                    this._parent.Receipts.Add(receiptsCasted);
                }
                if ((this._parent.Vendor == null))
                {
                    IVendor vendorCasted = item.As <IVendor>();
                    if ((vendorCasted != null))
                    {
                        this._parent.Vendor = vendorCasted;
                        return;
                    }
                }
                ITransaction transactionsCasted = item.As <ITransaction>();

                if ((transactionsCasted != null))
                {
                    this._parent.Transactions.Add(transactionsCasted);
                }
                if ((this._parent.MerchantAccount == null))
                {
                    IMerchantAccount merchantAccountCasted = item.As <IMerchantAccount>();
                    if ((merchantAccountCasted != null))
                    {
                        this._parent.MerchantAccount = merchantAccountCasted;
                        return;
                    }
                }
            }
 public WebmoneyInstrument(string instrumentId, IVendor vendor, string currency1, string currency2, string instrumentName)
 {
     InstrumentId   = instrumentId;
     Vendor         = vendor;
     Currency1      = currency1;
     Currency2      = currency2;
     InstrumentName = instrumentName;
 }
Beispiel #10
0
        public void LoadFrom(IVendor p)
        {
            Category   = p.Category;
            CategoryId = p.CategoryId;
            Discounts  = (ICollection <IDiscount>)p.Discounts;

            base.LoadFrom(p as PlayerAbstract);
        }
Beispiel #11
0
        public static int DeletingVendor(IVendor vendor, string connectionName = connName)
        {
            DynamicParameters param = new DynamicParameters();

            param.Add("@VendorId", vendor.VendorId);

            return(CmdExecute("uspDeleteVendor", param, connectionName));
        }
 public WebmoneyInstrument(string instrId, string instrName, string curr1, string curr2, BankRate bRate, IVendor vend)
 {
     InstrumentId   = instrId;
     InstrumentName = instrName;
     Currency1      = curr1;
     Currency2      = curr2;
     BankRate       = bRate;
     Vendor         = vend;
 }
Beispiel #13
0
        public static int InsertVendor(IVendor vendor, string connectionName = connName)
        {
            DynamicParameters param = new DynamicParameters();

            param.Add("@FirstName", vendor.FirstName);
            param.Add("@LastName", vendor.LastName);
            param.Add("@Comission", vendor.Comission);
            return(CmdExecute("uspInsertVendor", param, connectionName));
        }
        /// <summary>
        /// Registers a sensor.
        /// </summary>
        public void AddSensor(IVendor vendor, string id, SensorType type, string uri)
        {
            var sensorConfiguration = new SensorConfiguration(id, type, uri);

            if (vendor.Validate(sensorConfiguration))
            {
                _sensors.Add(new Sensor(vendor, sensorConfiguration));
            }
        }
Beispiel #15
0
        /// <summary>
        ///
        /// </summary>
        private void Init(IConfig conf)
        {
            if (conf == null)
            {
                conf = new Config();
            }

            vend = conf.getVendor();
        }
Beispiel #16
0
 public void ProcessRestock()
 {
     while (m_RestockQueue.Count > 0)
     {
         IVendor vendor = m_RestockQueue.Dequeue();
         vendor.Restock();
         vendor.LastRestock = DateTime.Now;
     }
 }
Beispiel #17
0
 public VendorController(
     IVendor repVendor,
     IAnnualBudget repAnnualBudget,
     IPurchaseAsset repPurchaseAsset
     )
 {
     _repVendor        = repVendor;
     _repAnnualBudget  = repAnnualBudget;
     _repPurchaseAsset = repPurchaseAsset;
 }
        public BusinessLogic_Documents()
        {
            container = DI_Container.Config();

            receiptProcessor = container.Resolve <IReceiptProcessor>();
            invoiceProcessor = container.Resolve <IInvoiceProcessor>();
            vendor           = container.Resolve <IVendor>();
            buyer            = container.Resolve <IBuyer>();
            invoice          = container.Resolve <IInvoice>();
        }
Beispiel #19
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="employeeRepository"></param>
 #endregion
 public VendorDashboardController(ILookupDetails lookupDetailsRepository, ICommon CommonRepository, IConfiguration ConfigurationRepository, IAnchorCompany anchorCompanyRepository, ICompany CompanyRepository, IInvoice invoiceRepository, IVendor VendorRepository)
 {
     _lookUpRepository        = lookupDetailsRepository;
     _CommonRepository        = CommonRepository;
     _configuration           = ConfigurationRepository;
     _AnchorCompanyRepository = anchorCompanyRepository;
     _companyRepository       = CompanyRepository;
     _invoiceRepository       = invoiceRepository;
     _VendorRepository        = VendorRepository;
 }
        private IVendor CreateVendor(VendorType type)
        {
            IVendor vendor = VendorBase.GetVendorFromType(type);

            vendor.Name     = "AAA";
            vendor.Username = "******";
            vendor.Password = "******";
            vendor.Contact.Clone(CreateContact());
            return(vendor);
        }
        private void CheckWindSpeedSensor(IVendor vendor, string uri, IDictionary <string, double?> values)
        {
            _weatherStationSensorsVendor.AddSensor(vendor, "id", SensorType.WIND_SPEED, uri);

            values[uri] = 27.3;
            CheckSingleValue(_weatherStationSensorsVendor.ReadSensorValues(), "id", 27.3, true, "km/h");

            values[uri] = -double.Epsilon;
            CheckSingleValue(_weatherStationSensorsVendor.ReadSensorValues(), "id", -double.Epsilon, false, "km/h");
        }
Beispiel #22
0
 public static string GetManufacturerName(IVendor vendor)
 {
     if (!string.IsNullOrEmpty(vendor.VendorCompanyName))
     {
         return vendor.VendorCompanyName;
     }
     else
     {
         return vendor.Member.Name;
     }
 }
        /// <summary>
        /// this method gives vendor based on vendorId
        /// </summary>
        /// <param name="VendorId"></param>
        public IVendor GetVendorByVendorId(int VendorId)
        {
            SqlConnection objSQLConn    = null;
            SqlCommand    objSQLCommand = null;

            IVendor objVendors = VendorBOFactory.CreateVendorObject();

            try
            {
                objSQLConn = new SqlConnection(strConnectionString);
                objSQLConn.Open();

                objSQLCommand             = new SqlCommand("usp_GetVendorByVendorId", objSQLConn);
                objSQLCommand.CommandType = System.Data.CommandType.StoredProcedure;
                objSQLCommand.Parameters.AddWithValue("@VendorID", VendorId);
                objSQLCommand.Parameters["@VendorID"].Direction = System.Data.ParameterDirection.Input;

                SqlDataReader objSQLReader = objSQLCommand.ExecuteReader();

                while (objSQLReader.Read())
                {
                    /*IEmployee objEmployee = EmployeeBOFactory.CreateEmployeeObject();*/
                    objVendors.VendorId            = Convert.ToInt32(objSQLReader["VendorID"]);
                    objVendors.NameOfOrganisation  = Convert.ToString(objSQLReader["NameOfOrganization"]);
                    objVendors.NameOfContactPerson = Convert.ToString(objSQLReader["NameOfContactPerson"]);
                    objVendors.Address             = Convert.ToString(objSQLReader["VendorAddress"]);
                    objVendors.City          = Convert.ToString(objSQLReader["City"]);
                    objVendors.State         = Convert.ToString(objSQLReader["State"]);
                    objVendors.ContactNumber = Convert.ToInt32(objSQLReader["ContactNumber"]);
                    objVendors.VendorType    = Convert.ToString(objSQLReader["VendorType"]);
                    objVendors.EmailId       = Convert.ToString(objSQLReader["EmailID"]);

                    /*objEmployee.Address = Convert.ToString(objSQLReader["Address"]);
                     * objEmployee.City = Convert.ToString(objSQLReader["State"]);
                     * objEmployee.State = Convert.ToString(objSQLReader["City"]);
                     * objEmployee.MobileNumber = Convert.ToInt64(objSQLReader["ContactNumber"]);*/
                }

                objSQLReader.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (objSQLConn != null && objSQLConn.State != System.Data.ConnectionState.Closed)
                {
                    objSQLConn.Close();
                }
            }
            return(objVendors);
        }
Beispiel #24
0
        private static IInstrument CreateInstrument(string instr, IVendor vendor)
        {
            int    pos       = instr.IndexOf(instrPointSeparator);
            var    tempLines = instr.Substring(0, pos).Trim().Split(instrNameSeparator);
            string currency1 = tempLines[0];
            string currency2 = tempLines[1];
            string instrName = currency1 + "/" + currency2;

            string instrId = instr.Split(exchTypeSeparators, StringSplitOptions.RemoveEmptyEntries)[1].Replace("\"", String.Empty);

            return(new WebmoneyInstrument(instrId, vendor, currency1, currency2, instrName));
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="employeeRepository"></param>
 public AccountController(IBank companyRepository, IVendor venderRepository, IUser userRepository, IFinoCartMaster superadminRepository, IAdmin adminRepository, ICommon commonRepository, ILookupDetails lookUpRepository, IConfiguration configurationRepository, ICompany company)
 {
     _companyRepository    = companyRepository;
     _venderRepository     = venderRepository;
     _userRepository       = userRepository;
     _adminRepository      = adminRepository;
     _SuperAdminRepository = superadminRepository;
     _CommonRepository     = commonRepository;
     _lookUpRepository     = lookUpRepository;
     _configuration        = configurationRepository;
     _company = company;
 }
        private void CheckHumiditySensor(IVendor vendor, string uri, IDictionary <string, double?> values)
        {
            _weatherStationSensorsVendor.AddSensor(vendor, "id", SensorType.HUMIDITY, uri);

            values[uri] = 45.0;
            CheckSingleValue(_weatherStationSensorsVendor.ReadSensorValues(), "id", 45.0, true, "%");

            values[uri] = 100.1;
            CheckSingleValue(_weatherStationSensorsVendor.ReadSensorValues(), "id", 100.1, false, "%");

            values[uri] = -0.1;
            CheckSingleValue(_weatherStationSensorsVendor.ReadSensorValues(), "id", -0.1, false, "%");
        }
Beispiel #27
0
        public static bool IsStoreManager(this PurchaseOrderItem item)
        {
            if (item == null)
            {
                return(false);
            }
            IVendor vendor = ServiceProvider.Current.Ordering.Vendor.GetVendor(item.VendorID);

            if (vendor == null)
            {
                return(false);
            }
            return(vendor.ClientID == 0);
        }
        public void InvoiceListNew(List <ISaleItem> list, IBuyer buyer, IVendor vendor, IInvoice invoice)
        {
            InvoiceDocument i = new InvoiceDocument();

            //i.InvoiceOrder(invoice); // wyjście do numeracji, po odczycie z bazy danych

            i.InvoiceVendor(vendor);

            i.InvoiceBuyer(buyer);

            i.InvoiceListData(list);

            i.Show();
        }
/// <summary>
/// View Vendor Details
/// </summary>
/// <returns>List of Vendors</returns>
        public List <IVendor> GetVendorDetails()
        {
            SqlConnection  objSQLConn    = null;
            SqlCommand     objSQLCommand = null;
            List <IVendor> vendorList    = new List <IVendor>();

            try
            {
                objSQLConn = new SqlConnection(strConnectionString);
                objSQLConn.Open();

                objSQLCommand             = new SqlCommand("usp_ViewVendorDetails_group1", objSQLConn);
                objSQLCommand.CommandType = System.Data.CommandType.StoredProcedure;

                SqlDataReader objSQLReader = objSQLCommand.ExecuteReader();

                while (objSQLReader.Read())
                {
                    IVendor objVendorDetails = VendorBOFactory.CreateVendorObject();
                    objVendorDetails.VendorId           = Convert.ToInt32(objSQLReader["VendorID"]);
                    objVendorDetails.NameOfOrganisation = objSQLReader["NameOfOrganization"].ToString();

                    objVendorDetails.NameOfContactPerson = objSQLReader["NameOfContactPerson"].ToString();
                    objVendorDetails.Address             = objSQLReader["VendorAddress"].ToString();
                    objVendorDetails.City  = objSQLReader["City"].ToString();
                    objVendorDetails.State = objSQLReader["State"].ToString();

                    objVendorDetails.ContactNumber = Convert.ToInt64(objSQLReader["ContactNumber"]);
                    objVendorDetails.VendorType    = objSQLReader["VendorType"].ToString();
                    objVendorDetails.EmailId       = objSQLReader["EmailID"].ToString();

                    vendorList.Add(objVendorDetails);
                }

                objSQLReader.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (objSQLConn != null && objSQLConn.State != System.Data.ConnectionState.Closed)
                {
                    objSQLConn.Close();
                }
            }
            return(vendorList);
        }
Beispiel #30
0
    public static Entity BuyItem(ShellCore core, int index, IVendor vendor)
    {
        if (core.unitsCommanding.Count >= core.GetTotalCommandLimit())
        {
            return(null);
        }

        GameObject creation = new GameObject();

        creation.transform.position = vendor.GetPosition();
        var blueprint = vendor.GetVendingBlueprint();

        switch (blueprint.items[index].entityBlueprint.intendedType)
        {
        case EntityBlueprint.IntendedType.Turret:
            Turret tur = creation.AddComponent <Turret>();
            tur.blueprint = blueprint.items[index].entityBlueprint;
            core.SetTractorTarget(creation.GetComponent <Draggable>());
            tur.SetOwner(core);

            if (SectorManager.instance && SectorManager.instance.GetComponentInChildren <BattleZoneManager>())
            {
                var stats = SectorManager.instance.GetComponentInChildren <BattleZoneManager>().stats.Find(s => s.faction == core.faction);
                if (stats == null)
                {
                    stats = new BattleZoneManager.Stats(core.faction);
                    SectorManager.instance.GetComponentInChildren <BattleZoneManager>().stats.Add(stats);
                }
                stats.turretSpawns++;
            }
            break;

        case EntityBlueprint.IntendedType.Tank:
            Tank tank = creation.AddComponent <Tank>();
            tank.blueprint = blueprint.items[index].entityBlueprint;
            tank.SetOwner(core);
            break;

        default:
            break;
        }

        creation.GetComponent <Entity>().spawnPoint = vendor.GetPosition();
        creation.GetComponent <Entity>().faction    = core.faction;
        creation.name = blueprint.items[index].entityBlueprint.name;
        core.sectorMngr.InsertPersistentObject(blueprint.items[index].entityBlueprint.name, creation);
        core.AddPower(-blueprint.items[index].cost);
        return(creation.GetComponent <Entity>());
    }
        private void CheckTemperatureSensor(IVendor vendor, string uri, IDictionary <string, double?> values)
        {
            _weatherStationSensorsVendor.AddSensor(vendor, "id", SensorType.TEMPERATURE, uri);

            CheckSingleValue(_weatherStationSensorsVendor.ReadSensorValues(), "id", null, false, "°C");

            values[uri] = 27.3;
            CheckSingleValue(_weatherStationSensorsVendor.ReadSensorValues(), "id", 27.3, true, "°C");

            values[uri] = -274.0;
            CheckSingleValue(_weatherStationSensorsVendor.ReadSensorValues(), "id", -274.0, false, "°C");

            values[uri] = 200.2;
            CheckSingleValue(_weatherStationSensorsVendor.ReadSensorValues(), "id", 200.2, false, "°C");
        }
Beispiel #32
0
 public static IVendor CopyData(int toClientId, IVendor fromVendor)
 {
     return(ServiceProvider.Current.Ordering.Vendor.AddVendor(
                clientId: toClientId,
                vendorName: fromVendor.VendorName,
                address1: fromVendor.Address1,
                address2: fromVendor.Address2,
                address3: fromVendor.Address3,
                contact: fromVendor.Contact,
                phone: fromVendor.Phone,
                fax: fromVendor.Fax,
                url: fromVendor.URL,
                email: fromVendor.Email
                ));
 }
 public Northwind(IDbConnection connection, IVendor vendor)
     : base(connection, vendor)
 {
 }
Beispiel #34
0
	public CpRogramFilesFirebirdFirebird21ExamplesNwindNorthwindfdb(IDbConnection connection, IVendor vendor)
	: base(connection, vendor)
	{
	}
Beispiel #35
0
		public ZTST(IDbConnection connection, IVendor vendor)
		: base(connection, vendor)
		{
		}
 public bool UpdateVendorDetails(IVendor objVendor,int vendorId)
 {
     IInventoryManagerDAL objDAL = InventoryManagerDALFactory.CreateInventoryManagerDALObject();
     return objDAL.UpdateVendorDetails(objVendor,vendorId);
 }
        /// <summary>
        /// this method updates vendor details
        /// </summary>
        /// <param name="objVendor"></param>
        /// <param name="vendorId"></param>
        public bool UpdateVendorDetails(IVendor objVendor,int vendorId)
        {
            bool isUpdated = false;
            SqlConnection objSQLConn = null;
            SqlCommand objSQLCommand = null;
            SqlTransaction objTran = null;
           
            

               
           try
           {
               objSQLConn = new SqlConnection(strConnectionString);

               objSQLCommand = new SqlCommand("usp_updateVendorDetails", objSQLConn);
               objSQLCommand.CommandType = System.Data.CommandType.StoredProcedure;
               objSQLCommand.Parameters.AddWithValue("@vendorId", vendorId);
               objSQLCommand.Parameters.AddWithValue("@nameOfOrganization", objVendor.NameOfOrganisation);

               objSQLCommand.Parameters.AddWithValue("@nameOfContactPerson", objVendor.NameOfContactPerson);
               objSQLCommand.Parameters.AddWithValue("@vendorAddress", objVendor.Address);
               objSQLCommand.Parameters.AddWithValue("@city", objVendor.City);
               objSQLCommand.Parameters.AddWithValue("@state", objVendor.State);
               objSQLCommand.Parameters.AddWithValue("@contactNumber", objVendor.ContactNumber);
               objSQLCommand.Parameters.AddWithValue("@vendorType", objVendor.VendorType);
               objSQLCommand.Parameters.AddWithValue("@emailId", objVendor.EmailId);
               //objSQLCommand.Parameters.AddWithValue("@categoryId ", objVendor.CategoryId);

               
               objSQLConn.Open();
               objTran = objSQLConn.BeginTransaction();
               objSQLCommand.Transaction = objTran;

               int noOfRowsAffected = objSQLCommand.ExecuteNonQuery();
               if (noOfRowsAffected > 0)
               {

                   //loop thru vendor's cateogry list
                   foreach (int category in objVendor.CategoryList)
                   {
                       objSQLCommand = new SqlCommand("usp_AddVendorItemCategory_group1", objSQLConn);
                       objSQLCommand.CommandType = System.Data.CommandType.StoredProcedure;
                       objSQLCommand.Parameters.AddWithValue("@VendorID ", vendorId);
                       objSQLCommand.Parameters.AddWithValue("@CategoryID ", category);
                       objSQLCommand.Transaction = objTran;
                       noOfRowsAffected = objSQLCommand.ExecuteNonQuery();

                       if (noOfRowsAffected == 0)
                       {
                           objTran.Rollback();
                           break;
                       }
                   }
               }

               objTran.Commit();
               isUpdated = true;
           }
           catch (Exception ex)
           {
               throw ex;
           }
           finally
           {
               if (objSQLConn != null && objSQLConn.State != System.Data.ConnectionState.Closed)
                   objSQLConn.Close();

           }
          return isUpdated;
       }
Beispiel #38
0
        protected override void OnInit(EventArgs e)
        {
            InitializeComponent();
            base.OnInit(e);

            _vendor = ((IVendorProvider)MarketplaceProviderManager.Providers["VendorProvider"]).GetVendorById(Member.GetCurrentMember().Id);

            if (_projectId != null)
            {
                _project = ((IListingProvider)MarketplaceProviderManager.Providers["ListingProvider"]).GetListing((int)_projectId);

                //check security to make sure the project belongs to the vendor
                if (!((_project.Vendor.Member.Id == _vendor.Member.Id) || Utils.IsProjectContributor(_vendor.Member.Id, (int)_projectId)))
                {
                    //this project does not belong to this member so kick them back to the project list in their profile.
                    Response.Redirect("~/member/profile/projects/");
                }
            }

            _currentStep = umbraco.helper.Request("editorStep");

            ListingCreatorStep _s;

            if (string.IsNullOrEmpty(_currentStep))
                _s = ListingSteps()["details"];
            else
                _s = ListingSteps()[_currentStep];

            loadContent(_s);
        }
 public VendorDirectory(Directory vendorLocation, IVendor vendor, SystemClock clock)
 {
     _vendorLocation = vendorLocation;
     _vendor = vendor;
     _clock = clock;
 }
		public Northwind(string connectionString, IVendor vendor)
		: base(connectionString)
		{
		}
		public DrivingScoolContext(IDbConnection connection, IVendor vendor)
		: base(connection, vendor)
		{
		}
        /// <summary>
        /// This method saves the Vendor details in the database
        /// </summary>

        protected void btnSave_Click(object sender, EventArgs e)
        {
            int vendorid = Convert.ToInt32(Request.QueryString["VendorID"]);
            if (vendorid != 0)//update
            {
                try
                {
                    for (int i = 0; i < chkVendorItemCategory.Items.Count; i++)
                    {
                        if (chkVendorItemCategory.Items[i].Selected)
                        {
                            objVendor.CategoryList.Add(Convert.ToInt32(chkVendorItemCategory.Items[i].Value));
                        }
                    }

                    if (objVendor.CategoryList.Count == 0)
                    {
                        lblMessage.Text = "Please select at least one category";
                        return;
                    }

                    objVendor.NameOfOrganisation = txtOrganization.Text;
                    objVendor.NameOfContactPerson = txtName.Text;
                    objVendor.Address = txtAddress.Text;
                    objVendor.City = Convert.ToString(ddlCity.SelectedItem);
                    objVendor.State = Convert.ToString(ddlState.SelectedItem);
                    objVendor.ContactNumber = Convert.ToInt32(txtContact.Text);
                    objVendor.VendorType = Convert.ToString(ddlType.SelectedItem);
                    objVendor.EmailId = txtEmail.Text;

                    bool update = objBLL.UpdateVendorDetails(objVendor, vendorid); 


                    lblMessage.Text = "Vendor details saved successfully";

                }
                catch (Exception)
                {
                    lblMessage.Text = "An error occurred while Updating Vendor details";
                }
                finally
                {
                    objVendor = null;
                    objBLL = null;
                }
            }

            else
            {
                try
                {

                    for (int i = 0; i < chkVendorItemCategory.Items.Count; i++)
                    {
                        if (chkVendorItemCategory.Items[i].Selected)
                        {
                            objVendor.CategoryList.Add(Convert.ToInt32(chkVendorItemCategory.Items[i].Value));
                        }
                    }

                    if (objVendor.CategoryList.Count == 0)
                    {
                        lblMessage.Text = "Please select at least one category";
                        return;
                    }

                    objVendor.NameOfOrganisation = txtOrganization.Text;
                    objVendor.NameOfContactPerson = txtName.Text;
                    objVendor.Address = txtAddress.Text;
                    objVendor.City = Convert.ToString(ddlCity.SelectedItem);
                    objVendor.State = Convert.ToString(ddlState.SelectedItem);
                    objVendor.ContactNumber = Convert.ToInt32(txtContact.Text);
                    objVendor.VendorType = Convert.ToString(ddlType.SelectedItem);
                    objVendor.EmailId = txtEmail.Text;

                    bool vendorAdd = objBLL.AddVendorDetails(objVendor);

                   

                    lblMessage.Text = "Vendor details saved successfully.";
                    lblMessage2.Text = "The Vendor ID is:" + objVendor.VendorId;

                }
                catch (Exception)
                {
                    lblMessage.Text = "An error occurred while saving Vendor details";
                    lblMessage2.Text = "";
                }
                finally
                {
                    objVendor = null;
                    objBLL = null;
                }
            }
        }
Beispiel #43
0
 public Main(IDbConnection connection, IVendor vendor)
     : base(connection, vendor)
 {
 }
        /// <summary>
        /// To add the details of a new vendor
        /// </summary>
        /// <param name="intEmpId">objVendor object of vendor class</param>
        /// <returns>returns true/false</returns>
        public bool AddVendorDetails(IVendor objVendor)
        {


            bool isAdded = false;
            SqlConnection objSQLConn = null;
            SqlCommand objSQLCommand = null;
            SqlTransaction objTran = null;

            try
            {
                objSQLConn = new SqlConnection(strConnectionString);

                objSQLCommand = new SqlCommand("usp_addVendorDetails", objSQLConn);
                objSQLCommand.CommandType = System.Data.CommandType.StoredProcedure;

                objSQLCommand.Parameters.AddWithValue("@nameOfOrganization", objVendor.NameOfOrganisation);

                objSQLCommand.Parameters.AddWithValue("@nameOfContactPerson", objVendor.NameOfContactPerson);
                objSQLCommand.Parameters.AddWithValue("@vendorAddress", objVendor.Address);
                objSQLCommand.Parameters.AddWithValue("@city", objVendor.City);
                objSQLCommand.Parameters.AddWithValue("@state", objVendor.State);
                objSQLCommand.Parameters.AddWithValue("@contactNumber", objVendor.ContactNumber);
                objSQLCommand.Parameters.AddWithValue("@vendorType", objVendor.VendorType);
                objSQLCommand.Parameters.AddWithValue("@emailId", objVendor.EmailId);
                //objSQLCommand.Parameters.AddWithValue("@categoryId ", objVendor.CategoryId);

                objSQLCommand.Parameters.Add("@vendorId", System.Data.SqlDbType.Int);
                objSQLCommand.Parameters["@vendorId"].Direction = System.Data.ParameterDirection.Output;

                objSQLConn.Open();
                objTran = objSQLConn.BeginTransaction();
                objSQLCommand.Transaction = objTran;

                int noOfRowsAffected = objSQLCommand.ExecuteNonQuery();
                if (noOfRowsAffected > 0)
                {
                    objVendor.VendorId = Convert.ToInt32(objSQLCommand.Parameters["@vendorId"].Value);

                    //loop thru vendor's cateogry list
                    for (int i = 0; i < objVendor.CategoryList.Count; i++)
                    {
                        objSQLCommand = new SqlCommand("usp_AddVendorItemCategory_group1", objSQLConn);
                        objSQLCommand.CommandType = System.Data.CommandType.StoredProcedure;
                        objSQLCommand.Parameters.AddWithValue("@VendorID ", objVendor.VendorId);
                        objSQLCommand.Parameters.AddWithValue("@CategoryID ", objVendor.CategoryList[i]);
                        objSQLCommand.Transaction = objTran;
                        noOfRowsAffected = objSQLCommand.ExecuteNonQuery();

                        if (noOfRowsAffected == 0)
                        {
                            objTran.Rollback();
                            break;
                        }
                    }
                }

                objTran.Commit();
                isAdded = true;
            }
            catch
            {
                objTran.Rollback();
                throw;
            }
            finally
            {
                if (objSQLConn != null && objSQLConn.State != System.Data.ConnectionState.Closed)
                    objSQLConn.Close();
            }

            return isAdded;
        }
 public IVendorDirectory GetVendorDirectory(IVendor vendor)
 {
     var dir = _pendingLocation.GetChildDirectory(vendor.Handle);
     return new VendorDirectory(dir, vendor, _clock);
 }
Beispiel #46
0
 public void fillFromRow(DataRow row)
 {
     this.Recnum = Convert.ToInt32(row["recnum"]);
     this.CostHours = Convert.ToDecimal(row["csthrs"]);
     this.Period = Convert.ToInt32(row["actprd"]);
     this.Status = Convert.ToInt32(row["status"]);
     this.Cost = Convert.ToInt32(row["cstamt"]);
     this.BillingStatus = Convert.ToInt32(row["bllsts"]);
     this.BillingTotal = Convert.ToDecimal(row["blgttl"]);
     this.PayType = Convert.ToInt32(row["paytyp"]);
     this.EquipmentQuantity = Convert.ToDecimal(row["eqpqty"]);
     this.BillingQuantity = Convert.ToDecimal(row["blgqty"]);
     this.TransactionNumber = row["trnnum"].ToString().NullToBlank();
     this.Description = row["dscrpt"].ToString().NullToBlank();
     this.TransactionDate = Convert.ToDateTime(row["trndte"]);
     this.CostType = new CostType(Convert.ToInt32(row["csttyp"]));
     this.Vendor = new Vendor(Convert.ToInt64(row["vndnum"]));
     // this.Acrinv = Convert.ToInt64(row["acrinv"]);
 }
Beispiel #47
0
 public Payment(IVendor vendor)
 {
     this.vendor = vendor;
 }
 public bool AddVendorDetails(IVendor objVendor)
 {
     IInventoryManagerDAL objDAL = InventoryManagerDALFactory.CreateInventoryManagerDALObject();
     return objDAL.AddVendorDetails(objVendor);
 }
Beispiel #49
0
 public database(IDbConnection connection, IVendor vendor)
     : base(connection, vendor)
 {
 }
Beispiel #50
0
 public StudentDataContext(IDbConnection connection, IVendor vendor)
     : base(connection, vendor)
 {
 }
        protected void Page_Load(object sender, EventArgs e)
        {

            IInventoryManagerBLL objBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject();
            IItemCategory objcategory1 = ItemCategotyBOFactory.CreateItemCategoryObject();
            //List<IVendor> vendorList = objBLL.GetVendorDetails();
            List<IItemCategory> cateogies = new List<IItemCategory>();
            int vendorid = Convert.ToInt32(Request.QueryString["VendorID"]);
            if (!IsPostBack)
            {
                cateogies = objBLL.GetItemCategory();
                chkVendorItemCategory.DataSource = cateogies;
                chkVendorItemCategory.DataTextField = "CategoryName";
                chkVendorItemCategory.DataValueField = "CategoryID";
                chkVendorItemCategory.DataBind();

                if (vendorid != 0)//update
                {
                    IVendor objVendor = VendorBOFactory.CreateVendorObject();
                    objVendor = objBLL.GetVendorByVendorId(vendorid);
                    lblMessage2.Text = "Vendor Id is:" + objVendor.VendorId;
                    vendorid = Convert.ToInt32(Request.QueryString["VendorID"]);


                    objVendor.VendorId = vendorid;

                    txtOrganization.Text = Convert.ToString(objVendor.NameOfOrganisation);
                    objVendor.CategoryList =objBLL.getVendorCategoryList(objVendor.VendorId);

                   
                   
                    for (int i = 0; i < chkVendorItemCategory.Items.Count; i++)
                    {
                        int categoryId = objVendor.CategoryList.Find(delegate(int cID) { return cID == Convert.ToInt32(chkVendorItemCategory.Items[i].Value); });
                        if (categoryId != 0)
                            chkVendorItemCategory.Items[i].Selected = true;
                    }
                    chkVendorItemCategory.SelectedValue = Convert.ToString(objVendor.CategoryList);

                    txtName.Text = Convert.ToString(objVendor.NameOfContactPerson);
                    txtAddress.Text = Convert.ToString(objVendor.Address);
                    txtEmail.Text = Convert.ToString(objVendor.EmailId);
                    ddlState.SelectedItem.Text = Convert.ToString(objVendor.State);
                    ddlState_SelectedIndexChanged(sender, e);



                    ddlCity.SelectedItem.Text = Convert.ToString(objVendor.City);
                    txtContact.Text = Convert.ToString(objVendor.ContactNumber);

                    ddlType.SelectedItem.Text = Convert.ToString(objVendor.VendorType);
                 

                }
                else//add
                {


                    
                    chkVendorItemCategory.SelectedValue = Convert.ToString(objVendor.CategoryList);
                    txtOrganization.Text = Convert.ToString(objVendor.NameOfOrganisation);
                    txtName.Text = Convert.ToString(objVendor.NameOfContactPerson);
                    txtAddress.Text = Convert.ToString(objVendor.Address);
                    txtEmail.Text = Convert.ToString(objVendor.EmailId);
                    ddlState.SelectedValue = Convert.ToString(objVendor.State);
                   



                    ddlCity.SelectedValue = Convert.ToString(objVendor.City);
                    txtContact.Text = Convert.ToString(objVendor.ContactNumber);

                    ddlType.SelectedValue = Convert.ToString(objVendor.VendorType);
                   

                }


            }
        }