Esempio n. 1
0
        public Int32 UpdateReseller(IReseller ireseller)
        {
            Database  db         = DatabaseFactory.CreateDatabase("SUPPORTTICKETS");
            string    sqlCommand = "proResellerUpdate";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "@UserAction", DbType.Byte, ireseller.UserAction);
            db.AddInParameter(dbCommand, "@ID_Reseller", DbType.String, ireseller.MasterID);
            db.AddInParameter(dbCommand, "@ResCode", DbType.String, ireseller.ResCode);
            db.AddInParameter(dbCommand, "@ResName", DbType.String, ireseller.ResName);
            db.AddInParameter(dbCommand, "@ResAddress1", DbType.String, ireseller.ResAddress1);
            db.AddInParameter(dbCommand, "@ResAddress2", DbType.String, ireseller.ResAddress2);
            db.AddInParameter(dbCommand, "@ResEmail", DbType.String, ireseller.ResEmail);
            db.AddInParameter(dbCommand, "@ResPhone", DbType.String, ireseller.ResPhone);
            db.AddInParameter(dbCommand, "@ResMob", DbType.String, ireseller.ResMob);
            db.AddInParameter(dbCommand, "@Active", DbType.Byte, ireseller.Active);
            db.AddInParameter(dbCommand, "@SortOrder", DbType.Int64, ireseller.SortOrder);
            db.AddInParameter(dbCommand, "@UserCode", DbType.Int64, ireseller.UserCode);
            db.AddInParameter(dbCommand, "@FK_Company", DbType.Int64, ireseller.FK_Company);
            try
            {
                return(Convert.ToInt32(db.ExecuteScalar(dbCommand)));
            }
            catch (SqlException e)
            {
                return(0);
            }
        }
Esempio n. 2
0
        public int DeleteReseller(IReseller ireseller)
        {
            Database  db         = DatabaseFactory.CreateDatabase("SUPPORTTICKETS");
            string    sqlCommand = "proResellerDelete";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "@ID_Reseller", DbType.Int64, ireseller.MasterID);
            db.AddInParameter(dbCommand, "@CancelledUser", DbType.Int64, ireseller.UserCode);
            db.AddInParameter(dbCommand, "@FK_Company", DbType.Int64, ireseller.FK_Company);

            try
            {
                return(Convert.ToInt32(db.ExecuteScalar(dbCommand)));
            }
            catch (SqlException e)
            {
                //UpdateErrorLog(iProduct, e);
                throw e;
            }
        }
        public static void Main(string[] args)
        {
            ReadFile          readFile          = new ReadFile(Constants.CustomerFileName);
            ConverterCustomer converterCustomer = new ConverterCustomer();
            ConverterDomain   converterDomain   = new ConverterDomain();

            customer  = converterCustomer.Convert(readFile.Read()).ElementAt(0);
            registrar = new Registrar();
            reseller  = new Reseller(registrar);
            readFile  = new ReadFile(Constants.DomainFileName);
            List <TwoStrings> domains;

            domains = converterDomain.Convert(readFile.Read());
            customer.WantANewDomain(domains.ElementAt(0).FirstString, domains.ElementAt(0).SecondString, reseller);
            customer.WantANewDomain(domains.ElementAt(0).FirstString, domains.ElementAt(0).SecondString, reseller);
            customer.WantANewDomain(domains.ElementAt(1).FirstString, domains.ElementAt(1).SecondString, reseller);
            customer.WantANewDomain(domains.ElementAt(1).FirstString, domains.ElementAt(1).SecondString, reseller);
            customer.WantANewDomain(domains.ElementAt(1).FirstString, domains.ElementAt(1).SecondString, reseller);
            customer.WantANewDomain(domains.ElementAt(2).FirstString, domains.ElementAt(2).SecondString, reseller);
            customer.WantANewDomain(domains.ElementAt(2).FirstString, domains.ElementAt(2).SecondString, reseller);
        }
Esempio n. 4
0
        public DataTable SelectAllReseller(IReseller ireseller)
        {
            DataTable dtblProduct = new DataTable();
            Database  db          = DatabaseFactory.CreateDatabase("SUPPORTTICKETS");
            string    sqlCommand  = "proResellerSelect";
            DbCommand dbCommand   = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "@ID_Reseller", DbType.String, ireseller.MasterID);
            db.AddInParameter(dbCommand, "@ResCode", DbType.String, ireseller.ResCode);
            db.AddInParameter(dbCommand, "@ResName", DbType.String, ireseller.ResName);
            db.AddInParameter(dbCommand, "@ResEmail", DbType.String, ireseller.ResEmail);
            db.AddInParameter(dbCommand, "@PageIndex", DbType.Int32, ireseller.PageIndex);
            db.AddInParameter(dbCommand, "@PageSize", DbType.Int32, ireseller.PageSize);
            db.AddInParameter(dbCommand, "@FK_Company", DbType.Int64, ireseller.FK_Company);
            try
            {
                dtblProduct = db.ExecuteDataSet(dbCommand).Tables[0];
                return(dtblProduct);
            }
            catch (SqlException e)
            {
                throw e;
            }
        }
Esempio n. 5
0
 public bool WantANewDomain(string name, string hosts, IReseller reseller)
 {
     return(reseller.CreateNewDomain(name, hosts, FirstName + " " + LastName + " email:" + EmailAddress));
 }