Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        oValue.setRequestGet("Type");
        string UploadType = oValue.Data("Type");

        switch (UploadType)
        {
        case "A":
            UploadUrl   = Server.MapPath("~") + @"\upload\global\type02\";
            Label1.Text = "序號件";
            break;

        case "B":
            UploadUrl   = Server.MapPath("~") + @"\upload\global\type04\";
            Label1.Text = "非序號件";
            break;

        case "":
            UploadUrl = Server.MapPath("~") + @"\";
            break;
        }
        KeepType.Text = UploadType;
        string SQL = "";

        Sql.ClearQuery();
        SQL = "select A19I02UV0004,A19F01NV0032 from A19 where A19I03CV0001='B'";
        //Sql.sqlTransferColumn = "A12I03CV0001";
        recordset = Sql.selectTable(SQL, "A19");
        if (recordset != null)
        {
            for (int i = 0; i < recordset.Rows.Count; i++)
            {
                ListItem iTem = new ListItem();
                iTem.Text  = recordset.Rows[i]["A19F01NV0032"].ToString();
                iTem.Value = recordset.Rows[i]["A19I02UV0004"].ToString();
                DropDownList1.Items.Add(iTem);
            }
        }
        else
        {
        }
        Sql.ClearQuery();
        SQL = "select A12I02UV0010,A12I03CV0001,A12F01NV0064 from A12 where A12I03CV0001='A'";
        Sql.sqlTransferColumn = "A12I03CV0001";
        recordset             = Sql.selectTable(SQL, "A12");
        if (recordset != null)
        {
            for (int i = 0; i < recordset.Rows.Count; i++)
            {
                ListItem iTem = new ListItem();
                iTem.Text  = recordset.Rows[i]["A12F01NV0064"].ToString();
                iTem.Value = recordset.Rows[i]["A12I02UV0010"].ToString();
                DropDownList2.Items.Add(iTem);
            }
        }
        else
        {
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Sql.ClearQuery();
        SQL = "select A12I02UV0010,A12I03CV0001,A12F01NV0064 from A12";
        Sql.sqlTransferColumn = "A12I03CV0001";
        dt = Sql.selectTable(SQL, "A12");

        Gd2.DataSource = dt;
        Gd2.DataBind();

        oTemplate.SetTemplatesDir("/template/excel/");
        oTemplate.SetTemplateFileCharset("test.html", "UTF-8");


        thisOut = oTemplate.GetOutput();
    }
Exemplo n.º 3
0
    public static void Check_Login()
    {
        bool       pBool      = false;
        string     strAccount = "";
        HttpCookie cookie     = HttpContext.Current.Request.Cookies["Account"];

        if (cookie != null)
        {
            strAccount          = cookie.Values["strAccount"].ToString();
            PageBase.strAccount = strAccount;
            if (strAccount != "")
            {
                pBool = true;
            }
        }
        //cookie.Values.Remove("strAccount");
        if (strAccount == "")
        {
            string    strIP = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
            Cls_SQL   Sql   = new Cls_SQL();
            DataTable dt    = new DataTable();
            dt = Sql.selectTable("select top 1 U01I02UV0024 from U01 where U01I07CV0015 ='" + strIP + "'", "U01");
            try
            {
                if (dt.Rows.Count > 0)
                {
                    HttpCookie Cookie = new HttpCookie("Account");
                    DateTime   dtm    = DateTime.Now;
                    TimeSpan   ts     = new TimeSpan(1, 0, 0, 0);
                    Cookie.Expires = dtm.Add(ts);
                    Cookie.Values.Add("strAccount", dt.Rows[0]["U01I02UV0024"].ToString());
                    HttpContext.Current.Response.AppendCookie(Cookie);
                    pBool = true;
                    PageBase.strAccount = dt.Rows[0]["U01I02UV0024"].ToString();
                }
            }
            catch {
            }
        }
        if (pBool == false)
        {
            HttpContext.Current.Response.Redirect(PageBase.WebRoute + "/login.aspx");
        }
    }