예제 #1
0
        public ActionResult Download(string p)
        {
            string strCurrentIP             = Request.UserHostAddress;
            FORBIDDEN_IPTableAdapter adptIP = new FORBIDDEN_IPTableAdapter();
            string strUniqueId = Guid.NewGuid().ToString("N");

            using (adptIP)
            {
                //adptIP.AllowSingleIpConnection(strCurrentIP, strUniqueId);
                //if ((int)adptIP.TestForSingleIpConnection(strCurrentIP, strUniqueId) > 0)
                //{
                //    adptIP.BlockIP(strCurrentIP);
                ViewBag.Product     = p;
                ViewBag.DownloadUrl = String.Format("http://{0}/Default/Transport?p={1}", HttpContext.Request.Url.Authority, p);
                ITEMTableAdapter objAdapter2 = new ITEMTableAdapter();
                ViewBag.DownloadInstructions = objTextPool.BasicInstructions;
                return(View());
                //}
                //else
                //{
                //return View("Index");
                //}
            }

            //using (adptIP)
            //{
            //    adptIP.ReleaseIP(strCurrentIP, strUniqueId);
            //}


            //EmptyResult er = new EmptyResult();
            //return er;
        }
예제 #2
0
        static void Main(string[] args)
        {
            var foxDA = new FoxDataAccess();
            var data  = foxDA.GetData("ORDENES.DBF");
            var ta    = new ItemTableAdapter();
            var sqlta = new ITEMTableAdapter();
            var sqlDt = new SqlServerDS.ITEMDataTable();
            var foxDt = ta.GetDataItrm();

            foreach (FoxDS.ItemRow r in foxDt)
            {
                Console.WriteLine(string.Join(",", r.ItemArray));
                sqlDt.AddITEMRow(r.cod_item, r.cod_iten, r.nomb_item, r.cod_par, r.precio_pro, r.existe, r.precio_ult,
                                 r.unidad, r.uti_item1, r.uti_item2, r.uti_item3, r.maximo, r.minimo, r.factor, r.prsocio, r.prventa,
                                 r.protros, r.cta_mer, r.cta_vta, r.grupo, r.uso);
            }

            sqlta.Update(sqlDt);

            Console.ReadLine();
        }