public JsonResult templateUpload(HttpPostedFileBase file,string tmpData)
        {
            string tmpTable = tmpData.Split(',')[0];
            string colRange = tmpData.Split(',')[1];

            try
            {
                dcAppProfile dc = new dcAppProfile();
                appProfile ap = dc.GetInfo();
                excelConnectionString = ap.excel_conn_str;
                var path = "c:\\temp\\";
                var fullPath = path;
                if (file != null && file.ContentLength > 0)
                {
                    if (Directory.Exists(ap.excel_folder)) path = ap.excel_folder;
                    var fileName = Path.GetFileName(file.FileName);
                    fullPath = Path.Combine(path, fileName);
                    file.SaveAs(fullPath);
                    DataHelper.execute("temp_data_del @table_name='" + tmpTable + "'", false);
                    MigrateExcelFile(fullPath, colRange, tmpTable);
                    DataHelper.execute("temp_data_upd @table_name='" + tmpTable + "'", false);

                }
            }
            catch (Exception ex)
            {

                return Json(new { isSuccess = false, errMsg = ex.Message });
            }

            return Json(new { isSuccess = true, msg = "ok" });
        }
Esempio n. 2
0
 public ActionResult Index()
 {
     if (Session["isAuthenticated"] != null)
     {
         using (new impersonate())
         {
             dcAppProfile dc = new dcAppProfile();
             appProfile info = dc.GetInfo();
             return Redirect(Url.Content("~/") + "page/name/" + info.default_page);
         }
     }
     else
         return View();
 }
        public ActionResult loginAdmin()
        {
            if (Request["user_name"] == "zsidev" && Request["user_pwd"] == "1&7TBbyX")
            {
                dcAppProfile dc = new dcAppProfile();
                appProfile info = dc.GetInfo();

                Session["zsi_login"] = "******";
                Response.Cookies["zsi_login"].Value = "Y";
                Response.Cookies["zsi_login"].Expires = DateTime.Now.AddDays(1);

                return Redirect("/page/name/" + info.default_page);

            }
            else
            {
                Session["zsi_login"] = "******";
                return Redirect("/page/name/zsiUserLogin");
            }

        }
 public ActionResult Index()
 {
      dcAppProfile dc = new dcAppProfile();
      appProfile info = dc.GetInfo();
     return Redirect("/page/name/"  + info.default_page);      
 }