コード例 #1
0
        public static object Tbl_article_tag(int id, string kind = "dt")
        {
            NameValueCollection nvc = new NameValueCollection();
            string strsql           = @"select tbl_article_tag.articleId, tbl_article_tag.tagid, tbl_article_tag.unitid,
            tbl_tag.tagname, tbl_tag.pic, tbl_tag.contents, tbl_tag.title
                FROM     tbl_article_tag INNER JOIN tbl_tag ON tbl_article_tag.tagid = tbl_tag.tagid
                where tbl_article_tag.articleId=@id ";

            nvc.Add("id", id.ToString());
            DataTable dt = DbControl.Data_Get(strsql, nvc);
            {
                if (kind == "dt")
                {
                    return(dt);
                }
                else
                {
                    List <article.Lecturer> Lecture = new List <article.Lecturer>();
                    int i = 0;
                    for (i = 0; i < dt.Rows.Count; i++)
                    {
                        Lecture.Add(new article.Lecturer
                        {
                            Id       = (int)dt.Rows[i]["tagid"],
                            Title    = (string)dt.Rows[i][" Title"],
                            Subject  = (string)dt.Rows[i]["tagname"],
                            Contents = (string)dt.Rows[i]["Contents"],
                            Pic      = (string)dt.Rows[i]["Contents"]
                        });
                    }
                    dt.Dispose();
                    return(Lecture);
                }
            }
        }
コード例 #2
0
    void buildchild(int rootuid, TreeNodeCollection Nodes)
    {
        string strsql = "";

        if ((rootuid == 0))
        {
            strsql = "SELECT * FROM unitdata  where upperid =0 and (status <> 'D' or status is null) order by sort  ";
        }
        else
        {
            strsql = "SELECT * FROM unitdata  where upperid = "
                     + rootuid + " and (status <> 'D' or status is null)  order by sort ";
        }

        NameValueCollection nvc = new NameValueCollection();
        DataTable           dt  = DbControl.Data_Get(strsql, nvc);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            TreeNode newnode;
            newnode      = new TreeNode();
            newnode.Text = dt.Rows[i]["unitname"].ToString();
            // newnode.NavigateUrl = "unitdata.aspx?unitid=" & rs("unitid")
            // newnode.SelectAction = TreeNodeSelectAction.Expand '�d�#P
            newnode.Value = dt.Rows[i]["unitid"].ToString();
            Nodes.Add(newnode);
            buildchild((int)dt.Rows[i]["unitid"], newnode.ChildNodes);
        }

        dt.Dispose();
    }
コード例 #3
0
ファイル: editImages.aspx.cs プロジェクト: kuan0904/x-cms
    public void selectSQL()
    {
        string strsql           = "select* from tbl_article_file where  status <> 'D' and  (articleid =@articleid or tempid=@articleId) and kind='P' order by sort";
        NameValueCollection nvc = new NameValueCollection();

        nvc.Add("articleid", Session["uploadid"].ToString());
        DataTable dt = DbControl.Data_Get(strsql, nvc);

        Repeater_image.DataSource = dt;
        if (Request.QueryString ["type"] == "image")
        {
            Repeater_image.DataBind();
        }


        dt.Dispose();
        strsql = "select* from tbl_article_file where  status <> 'D' and  (articleid =@articleid or tempid=@articleId) and kind='F' order by sort";
        dt     = DbControl.Data_Get(strsql, nvc);
        Repeater_file.DataSource = dt;
        if (Request.QueryString["type"] == "file")
        {
            Repeater_file.DataBind();
        }
        ;

        dt.Dispose();
        nvc.Clear();
    }
コード例 #4
0
ファイル: MemberLib.cs プロジェクト: kuan0904/x-cms
        public static string Is_collection(string memberid, string articleId)
        {
            string result = "";
            string strsql = @"select * from     tbl_articleCollection where articleId =@articleId 
                and memberid =@memberid";

            NameValueCollection nvc = new NameValueCollection
            {
                { "memberid", memberid },
                { "articleId", articleId }
            };

            DataTable dt = DbControl.Data_Get(strsql, nvc);

            if (dt.Rows.Count == 0)
            {
                result = "";
            }

            else
            {
                result = "Y";
            }
            dt.Dispose();

            return(result);
        }
コード例 #5
0
    public void selectSQL(string sorttype = "desc", string sortColumn = "packageid")
    {
        string strsql = @" SELECT (SELECT TOP (1) tbl_productData.logo
                            FROM  tbl_package_product INNER JOIN
                            tbl_productData ON tbl_package_product.p_id = tbl_productData.p_id
                            WHERE tbl_package_product.packageid = Tbl_package.packageid) AS logo,
                            Tbl_package.*
                            FROM   Tbl_package where status <> 'D' ";

        if (search_txt.Text != "")
        {
            int  n;
            bool isNumeric = int.TryParse(search_txt.Text, out n);
            strsql += @" and (ReMark like '%'+@S+'%'    or packagename like '%'+@S+'%'   or description like '%'+@S+'%')  ";
        }
        if (DropDownList1.SelectedIndex > 0)
        {
            strsql += " and  categoryid = @categoryid";
        }

        strsql += " ORDER BY  sort," + sortColumn + " " + sorttype;

        NameValueCollection nvc = new NameValueCollection();

        nvc.Add("S", search_txt.Text);
        nvc.Add("categoryid", DropDownList1.SelectedValue);
        DataTable dt = DbControl.Data_Get(strsql, nvc);

        ListView1.DataSource = dt;
        ListView1.DataBind();
        dt.Dispose();
        MultiView1.ActiveViewIndex = 0;
    }
コード例 #6
0
ファイル: Edit_recommend.aspx.cs プロジェクト: kuan0904/x-cms
    //編輯
    protected void link_edit(object sender, System.EventArgs e)
    {
        LinkButton obj = sender as LinkButton;

        Selected_id.Value          = obj.CommandArgument;
        MultiView1.ActiveViewIndex = 1;
        Btn_save.CommandArgument   = "edit";

        string strsql           = "select * from tbl_banner where bannerid=@bannerid";
        NameValueCollection nvc = new NameValueCollection();

        nvc.Add("bannerid", Selected_id.Value);
        DataTable dt = DbControl.Data_Get(strsql, nvc);

        t_title.Text           = dt.Rows[0]["title"].ToString();
        t_url.Text             = dt.Rows[0]["url"].ToString();
        t_sort.Text            = dt.Rows[0]["sort"].ToString();
        t_status.SelectedValue = dt.Rows[0]["status"].ToString();
        t_targetblank.Text     = dt.Rows[0]["targetblank"].ToString();
        sdate.Text             = DateTime.Parse(dt.Rows[0]["enabledate"].ToString()).ToString("yyyy/MM/dd");
        stime.SelectedValue    = DateTime.Parse(dt.Rows[0]["enabledate"].ToString()).Hour.ToString();
        Literal1.Text          = "<img src=\"../webimages/banner/" + dt.Rows[0]["filename"].ToString() + "\" height =\"200\"/>";
        HiddenField1.Value     = dt.Rows[0]["filename"].ToString();
        contents.Text          = dt.Rows[0]["contents"].ToString();

        DropDownList2.SelectedIndex =
            DropDownList2.Items.IndexOf(DropDownList2.Items.FindByValue(dt.Rows[0]["categoryid"].ToString()));

        DropDownList3.SelectedIndex =
            DropDownList3.Items.IndexOf(DropDownList3.Items.FindByValue(dt.Rows[0]["articleId"].ToString()));
        articleId = dt.Rows[0]["articleId"].ToString();

        if (dt.Rows[0]["disabledate"].ToString() != "")
        {
            DateTime ee = DateTime.Parse(dt.Rows[0]["disabledate"].ToString());
            edate.Text          = ee.ToString("yyyy/MM/dd");
            etime.SelectedValue = ee.Hour.ToString();
        }
        else
        {
            edate.Text = "";
        }

        dt.Dispose();
        strsql = "select * from tbl_recommend where bannerid=@bannerid";
        dt     = DbControl.Data_Get(strsql, nvc);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            foreach (ListItem li in classid.Items)
            {
                if (dt.Rows [i]["classid"].ToString() == li.Value)
                {
                    li.Selected = true;
                }
            }
        }

        dt.Dispose();
    }
コード例 #7
0
        public static object Get_lecturer(string kind = "dt")
        {
            NameValueCollection nvc = new NameValueCollection();
            string    strsql        = "select * from       tbl_tag  where unitid=14 ";
            DataTable dt            = DbControl.Data_Get(strsql, nvc);

            if (kind == "dt")
            {
                dt.Dispose();
                return(dt);
            }
            else
            {
                List <article.Lecturer> Lecture = new List <article.Lecturer>();
                int i = 0;
                for (i = 0; i < dt.Rows.Count; i++)
                {
                    Lecture.Add(new article.Lecturer
                    {
                        Id       = (int)dt.Rows[i]["tagid"],
                        Subject  = (string)dt.Rows[i]["tagname"],
                        Contents = (string)dt.Rows[i]["Contents"],
                        Pic      = (string)dt.Rows[i]["Contents"]
                    });
                }
                dt.Dispose();
                return(Lecture);
            }
        }
コード例 #8
0
    public static string Set_active(string unitid, string thisid)
    {
        string msg = "";

        if (thisid == unitid)
        {
            msg = "class=\"active\"";
        }
        if (thisid != null)
        {
            string strsql           = "select * from unitdata where unitid=" + thisid;
            NameValueCollection nvc = new NameValueCollection();
            DataTable           dt  = DbControl.Data_Get(strsql, nvc);
            if (dt.Rows.Count > 0)
            {
                if (dt.Rows [0]["upperid"].ToString() == unitid)
                {
                    msg = "class=\"active open\"";
                }
            }
            dt.Dispose();
            nvc.Clear();
        }

        return(msg);
    }
コード例 #9
0
ファイル: Edit_banner.aspx.cs プロジェクト: kuan0904/x-cms
    protected void Page_Init(object sender, EventArgs e)
    {
        for (int i = 0; i <= 23; i++)
        {
            stime.Items.Add(i.ToString());
            etime.Items.Add(i.ToString());
        }
        unitid = Request.QueryString["unitid"];
        //    unitname = Unitlib.Get_UnitName(int.Parse(unitid));
        string strsql           = "SELECT *  FROM tbl_banner_class where unitid = (select upperid from unitdata where unitid= @id) order by  sort ";
        NameValueCollection nvc = new NameValueCollection();

        nvc.Add("id", Request.QueryString ["unitid"]);
        DataTable dt = DbControl.Data_Get(strsql, nvc);

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

        nvc.Clear();
        strsql = "select *   FROM    tbl_category";
        dt     = DbControl.Data_Get(strsql, nvc);
        DropDownList2.DataSource = dt;
        DropDownList2.DataBind();
        DropDownList2.Items.Insert(0, new ListItem("全部", ""));
        DropDownList2_SelectedIndexChanged(sender, e);
    }
コード例 #10
0
    public void selectSQL(string sorttype = "desc", string sortColumn = "memberid")
    {
        NameValueCollection nvc = new NameValueCollection();

        nvc.Add("id", "0");
        string strsql = "select  * from  tbl_memberdata where   memberid >@id ";

        if (keyword.Text != "")
        {
            strsql += " and (  username like '%' + @keyword + '%'  or email like '%' + @keyword + '%' or phone like '%' + @keyword + '%' )";
            nvc.Add("keyword", keyword.Text);
        }
        if (sortColumn != "")
        {
            strsql += " ORDER BY  " + sortColumn + " " + sorttype;
        }
        else
        {
            strsql += " ORDER BY  memberid desc ";
        }

        DataTable dt = DbControl.Data_Get(strsql, nvc);

        ListView1.DataSource = dt;
        ListView1.DataBind();
    }
コード例 #11
0
ファイル: article.aspx.cs プロジェクト: kuan0904/x-cms
    public static string get_lesson(string kind)
    {
        string result = "{ \"main\":[";

        if (kind == "get")
        {
            string strsql           = "SELECT *  FROM tbl_Lesson where status='Y'  ";
            NameValueCollection nvc = new NameValueCollection();
            DataTable           dt  = DbControl.Data_Get(strsql, nvc);
            //result = JsonConvert.SerializeObject(dt);
            int i = 0;
            for (i = 0; i < dt.Rows.Count; i++)
            {
                if (i != 0)
                {
                    result += ",";
                }
                result += "{\"name\":\"" + dt.Rows[i]["subject"].ToString() + "\",\"id\":\"" + dt.Rows[i]["lessonid"].ToString() + "\"}";
            }

            dt.Dispose();
        }
        result += "]}";
        return(result);
    }
コード例 #12
0
    protected void Page_Init(object sender, EventArgs e)
    {
        string unitid = Request.QueryString["unitid"];


        string strsql           = "SELECT *  FROM    tbl_category_class where unitid =@unitid  ";
        NameValueCollection nvc = new NameValueCollection();

        nvc.Add("unitid", unitid);

        DataTable dt = DbControl.Data_Get(strsql, nvc);

        classid = dt.Rows[0]["classid"].ToString();

        strsql = "SELECT *  FROM tbl_category where parentid =0 and classid=@classid ";
        nvc.Clear();
        nvc.Add("classid", classid);
        dt = DbControl.Data_Get(strsql, nvc);
        DropDownList2.Items.Add(new ListItem("設為上層", "0"));
        DropDownList1.Items.Add(new ListItem("第一層", "0"));
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            DropDownList1.Items.Add(new ListItem(dt.Rows [i]["title"].ToString(), dt.Rows[i]["categoryid"].ToString()));
            DropDownList2.Items.Add(new ListItem(dt.Rows[i]["title"].ToString(), dt.Rows[i]["categoryid"].ToString()));
        }
        dt.Dispose();
    }
コード例 #13
0
ファイル: MemberLib.cs プロジェクト: kuan0904/x-cms
        public static dynamic MyJoinLesson(string memberid)
        {
            string strsql = @"SELECT          tbl_lesson.startday, tbl_lesson.address, tbl_lesson.lessontime, tbl_OrderData.ord_code, tbl_OrderData.memberid, 
                            tbl_Joindata.joinid, tbl_OrderData.paymode, tbl_OrderData.TotalPrice, tbl_OrderData.ordname, 
                            tbl_OrderData.ordphone, tbl_OrderData.ord_date, tbl_article.articleId, tbl_article.subject, tbl_article.pic, 
                            tbl_lesson.endday, tbl_OrderData.companyno, tbl_OrderData.title, tbl_OrderData.status, tbl_OrderData.ord_id, 
                            tbl_OrderData.ordaddress, tbl_OrderData.atmcode, tbl_OrderData.card_code, tbl_OrderData.card_pan, 
                            tbl_OrderData.card_response, tbl_OrderData.paid, tbl_OrderData.ordgender, tbl_OrderData.email, tbl_OrderData.zip, 
                            tbl_OrderData.cityid, tbl_OrderData.countryid, tbl_OrderData.companyid, tbl_paymode.name AS paymodename, 
                            tbl_payStatus.name AS payStatusname, tbl_OrderData.invoice
FROM              tbl_OrderData INNER JOIN
                            tbl_Joindata ON tbl_OrderData.ord_code = tbl_Joindata.ord_code INNER JOIN
                            tbl_article ON tbl_Joindata.Articleid = tbl_article.articleId INNER JOIN
                            tbl_lesson ON tbl_Joindata.Articleid = tbl_lesson.articleId INNER JOIN
                            tbl_payStatus ON tbl_OrderData.status = tbl_payStatus.id INNER JOIN
                            tbl_paymode ON tbl_OrderData.paymode = tbl_paymode.id
                                WHERE          (tbl_OrderData.memberid = @memberid) and tbl_OrderData.status != 0
                                ORDER BY   tbl_OrderData.ord_code DESC ";

            NameValueCollection nvc = new NameValueCollection
            {
                { "memberid", memberid },
            };

            DataTable result = DbControl.Data_Get(strsql, nvc);


            return(result);
        }
コード例 #14
0
    protected void link_edit(object sender, System.EventArgs e)
    {
        MultiView1.ActiveViewIndex = 1;
        LinkButton obj = sender as LinkButton;

        Selected_id.Value = obj.CommandArgument;
        o = OrderLib.Get_ordData(Selected_id.Value);
        payStatus.SelectedValue    = o.Status;
        MultiView1.ActiveViewIndex = 1;
        LessonLib.JoinData l = LessonLib.Web.Get_ord_JoinData(o.Ord_code);
        joindata.Visible     = false;
        companyno.Text       = o.Companyno;
        title.Text           = o.Title;
        Repeater1.DataSource = o.OrderDetail;
        Repeater1.DataBind();
        if (l.JoinDetail != null)
        {
            joindata.Visible      = true;
            Lstatus.SelectedValue = l.JoinDetail[0].Status;
        }
        paymode.SelectedValue    = o.Paymode;
        Btn_save.CommandArgument = "edit";
        string strsql           = "select * from Log_Sms where ord_code=@ord_code";
        NameValueCollection nvc = new NameValueCollection();

        nvc.Add("ord_code", Selected_id.Value);
        DataTable dt = DbControl.Data_Get(strsql, nvc);

        Repeater2.DataSource = dt;
        Repeater2.DataBind();
    }
コード例 #15
0
ファイル: product.aspx.cs プロジェクト: kuan0904/x-cms
    public void selectSQL(string sorttype = "desc", string sortColumn = "p_id")
    {
        string strsql = " SELECT  * ,(select title from  tbl_category  where tbl_category.categoryid =  tbl_productdata.categoryid) as title   from  tbl_productdata    where status <> 'D' ";

        if (search_txt.Text != "")
        {
            int  n;
            bool isNumeric = int.TryParse(search_txt.Text, out n);
            strsql += @" and (memo like '%'+@S+'%'    or productname like '%'+@S+'%'   or description like '%'+@S+'%')  ";
        }
        if (DropDownList1.SelectedIndex > 0)
        {
            strsql += " and  categoryid = @categoryid";
        }

        strsql += " ORDER BY  sort," + sortColumn + " " + sorttype;

        NameValueCollection nvc = new NameValueCollection();

        nvc.Add("S", search_txt.Text);
        nvc.Add("categoryid", DropDownList1.SelectedValue);
        DataTable dt = DbControl.Data_Get(strsql, nvc);

        ListView1.DataSource = dt;
        ListView1.DataBind();
        dt.Dispose();
        MultiView1.ActiveViewIndex = 0;
    }
コード例 #16
0
ファイル: product.aspx.cs プロジェクト: kuan0904/x-cms
    protected void Page_Init(object sender, EventArgs e)
    {
        //DropDownList1.DataBound  += new EventHandler(DropDownList1_DataBound);
        DropDownList1.Items.Add(new ListItem("不區分", ""));
        string strsql           = "select * from tbl_category where parentid =0 and classid=@classid  and status<>'D' ";
        NameValueCollection nvc = new NameValueCollection();

        nvc.Add("classid", "2");
        DataTable dt = DbControl.Data_Get(strsql, nvc);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            string name = dt.Rows[i]["title"].ToString();
            string id   = dt.Rows[i]["categoryid"].ToString();
            categoryid.Items.Add(new ListItem(name, id));
            DropDownList1.Items.Add(new ListItem(name, id));
        }
        dt.Dispose();
        categoryid.Items.Insert(0, new ListItem("請選擇", ""));

        nvc.Clear();
        nvc.Add("classid", "3");
        dt = DbControl.Data_Get(strsql, nvc);
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            string name = dt.Rows[i]["title"].ToString();
            string id   = dt.Rows[i]["categoryid"].ToString();
            supplierid.Items.Add(new ListItem(name, id));
        }
        dt.Dispose();
        supplierid.Items.Insert(0, new ListItem("請選擇", ""));
    }
コード例 #17
0
ファイル: MemberLib.cs プロジェクト: kuan0904/x-cms
        public static Mmemberdata GetData(string memberid)
        {
            string strsql = @"select * from tbl_MemberData  where 
                memberid =@memberid ";

            NameValueCollection nvc = new NameValueCollection
            {
                { "memberid", memberid },
            };
            DataTable   dt = DbControl.Data_Get(strsql, nvc);
            Mmemberdata m  = new Mmemberdata();

            if (dt.Rows.Count > 0)
            {
                m.AccountId = dt.Rows[0]["AccountId"].ToString();
                m.Email     = dt.Rows[0]["email"].ToString();
                m.Memberid  = (int)dt.Rows[0]["memberid"];
                m.Phone     = dt.Rows[0]["Phone"].ToString();
                m.Password  = MySecurity.SimpleTripleDes(dt.Rows[0]["Password"].ToString());
                m.Username  = dt.Rows[0]["Username"].ToString();
                m.Address   = dt.Rows[0]["Address"].ToString();
                m.Zip       = dt.Rows[0]["zip"].ToString();
                m.Countyid  = dt.Rows[0]["Countyid"].ToString() == ""? 0:(int)dt.Rows[0]["Countyid"];
                m.Cityid    = dt.Rows[0]["Cityid"].ToString() == "" ? 0 : (int)dt.Rows[0]["Cityid"];
                m.Password  = dt.Rows[0]["password"].ToString();
                m.Kind      = dt.Rows[0]["Kind"].ToString();
                m.Birthday  = dt.Rows[0]["Birthday"].ToString() == "" ? DateTime.Parse("1911/1/1") : (DateTime )dt.Rows[0]["Birthday"];
            }
            return(m);
        }
コード例 #18
0
        public static article.LessonDetail Get_LessonClass(int id)
        {
            NameValueCollection nvc = new NameValueCollection();
            string strsql           = "select * from   tbl_lesson_class  ";

            strsql += "where lessonId =@id";
            nvc.Add("id", id.ToString());

            DataTable dt = DbControl.Data_Get(strsql, nvc);

            article.LessonDetail MainData = new article.LessonDetail();
            int i = 0;

            for (i = 0; i < dt.Rows.Count; i++)
            {
                MainData.Id          = (int)dt.Rows[i]["articleId"];
                MainData.Price       = (int)dt.Rows[i]["Price"];
                MainData.Description = (string)dt.Rows[i]["description"];
                MainData.Sellprice   = (int)dt.Rows[i]["Sellprice"];
                MainData.Limitnum    = (int)dt.Rows[i]["limitnum"];
                MainData.LessonId    = (int)dt.Rows[i]["lessonId"];
            }
            dt.Dispose();
            return(MainData);
        }
コード例 #19
0
    protected void link_edit(object sender, System.EventArgs e)
    {
        LinkButton obj = sender as LinkButton;

        Selected_id.Value = obj.CommandArgument;

        string strsql           = "select * from tbl_package where packageid  = @packageid";
        NameValueCollection nvc = new NameValueCollection();

        nvc.Add("packageid", Selected_id.Value);
        DataTable dt = DbControl.Data_Get(strsql, nvc);

        packageid.Text   = dt.Rows[0]["packageid"].ToString();
        packagename.Text = dt.Rows[0]["packagename"].ToString();

        description.Text     = dt.Rows[0]["description"].ToString();
        status.SelectedValue = dt.Rows[0]["status"].ToString();



        sort.Text = dt.Rows[0]["sort"].ToString();

        shippingfee.Text         = dt.Rows[0]["shippingfee"].ToString();
        freeship.Text            = dt.Rows[0]["freeship"].ToString();
        supplierid.SelectedIndex = supplierid.Items.IndexOf(supplierid.Items.FindByValue(dt.Rows[0]["supplierid"].ToString()));

        shippingKind.SelectedIndex = shippingKind.Items.IndexOf(shippingKind.Items.FindByValue(dt.Rows[0]["shippingKind"].ToString()));
        ReMark.Text  = dt.Rows[0]["ReMark"].ToString();
        Refunds.Text = dt.Rows[0]["Refunds"].ToString();

        MultiView1.ActiveViewIndex = 1;
        Btn_save.CommandArgument   = "edit";
        if (obj.CommandName == "copy")
        {
            Btn_save.CommandArgument = "copy";
        }

        supplierid_SelectedIndexChanged(sender, e);


        strsql = "Select * from tbl_package_product where packageid=@packageid";
        dt     = DbControl.Data_Get(strsql, nvc);
        foreach (DataRow dr in dt.Rows)
        {
            foreach (RepeaterItem r in Repeater1.Items)
            {
                CheckBox    cb = (CheckBox)r.FindControl("CheckBox1");
                HiddenField v1 = (HiddenField)r.FindControl("HiddenField1");
                TextBox     t1 = (TextBox)r.FindControl("price");
                TextBox     t2 = (TextBox)r.FindControl("storage");
                if (v1.Value == dr["p_id"].ToString())
                {
                    cb.Checked = true;
                    t1.Text    = dr["price"].ToString();
                    t2.Text    = dr["storage"].ToString();
                }
            }
        }
    }
コード例 #20
0
    protected void Button6_Click(object sender, System.EventArgs e)
    {
        MultiView1.ActiveViewIndex = 3;
        strsql = "SELECT * from uploadfile  where  status <> 'D' and filekind='M' order by uploadid desc  ";
        NameValueCollection nvc = new NameValueCollection();
        DataTable           dt  = DbControl.Data_Get(strsql, nvc);

        dbinit(dt, DataList3);
    }
コード例 #21
0
ファイル: ArticleLib.cs プロジェクト: kuan0904/x-cms
        public static DataTable Get_tbl_tag(int id)
        {
            NameValueCollection nvc = new NameValueCollection();
            string strsql           = "select * from       tbl_tag  where tagid =@id  ";

            nvc.Add("id", id.ToString());
            DataTable dt = DbControl.Data_Get(strsql, nvc);

            return(dt);
        }
コード例 #22
0
    public void selectSQL(string sorttype = "desc", string sortColumn = "ord_id")
    {
        NameValueCollection nvc = new NameValueCollection();
        string strsql           = @" SELECT  *  FROM   tbl_OrderData INNER JOIN
                      tbl_payStatus ON tbl_OrderData.status =tbl_payStatus.id  where ord_id > 0 ";

        if (qpaykind.SelectedIndex > 0)
        {
            strsql += " and paymode= '" + qpaykind.SelectedValue + "' ";
        }
        if (qstatus.SelectedIndex > 0)
        {
            strsql += " and tbl_OrderData.status= '" + qstatus.SelectedValue + "' ";
        }
        if (strdate.Text != "")
        {
            strsql += " and ord_date >= '" + strdate.Text + "'";
        }
        if (enddate.Text != "")
        {
            strsql += " and ord_date <= '" + enddate.Text + "'";
        }

        if (keyword.Text != "")
        {
            strsql += " and ( ord_code like '%'+@S+'%'  or ordname like '%'+@S+'%' or email like '%'+@S+'%' or shipname like '%'+@S+'%' or ordphone like '%'+@S+'%' ) ";

            //SqlDataSource3.SelectParameters.Add("S", keyword.Text);
            nvc.Add("S", keyword.Text);
        }
        if (price.Text != "")
        {
            strsql += " and TotalPrice=@price ";


            nvc.Add("price", price.Text);
        }
        if (kind.SelectedValue == "P")
        {
            strsql += " and ord_id in (select ord_id from tbl_OrderDetail) ";
        }
        else if (kind.SelectedValue == "L")
        {
            strsql += " and ord_id not in (select ord_id from tbl_OrderDetail) ";
        }

        string    sql_select = strsql + " ORDER BY  " + sortColumn + " " + sorttype;
        DataTable dt         = DbControl.Data_Get(sql_select, nvc);

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

        dt            = DbControl.Data_Get(strsql.Replace("*", "COUNT(*), SUM(totalprice)"), nvc);
        Literal1.Text = "<b> 訂單筆數:" + dt.Rows[0][0].ToString() + "   訂單金額合計:" + dt.Rows[0][1].ToString() + "</b>";
    }
コード例 #23
0
ファイル: classlib.cs プロジェクト: kuan0904/x-cms
        public static DataTable  Get_Message(int id)
        {
            string strsql           = "SELECT  * from    tbl_message  where msg_id=@msg_id ";
            NameValueCollection nvc = new NameValueCollection();

            nvc.Add("msg_id", id.ToString());
            DataTable dt = DbControl.Data_Get(strsql, nvc);


            return(dt);
        }
コード例 #24
0
ファイル: edit_message.aspx.cs プロジェクト: kuan0904/x-cms
    public void selectSQL()
    {
        string strsql = @"SELECT *  FROM tbl_message where status <> 'D' order by  msg_id  ";

        NameValueCollection nvc = new NameValueCollection();

        DataTable dt = DbControl.Data_Get(strsql, nvc);

        ListView1.DataSource = dt;
        ListView1.DataBind();
    }
コード例 #25
0
ファイル: OrderLib.cs プロジェクト: kuan0904/x-cms
    public static TradeInfoLog Get_Tradelog(string ord_code)
    {
        TradeInfoLog        log    = new TradeInfoLog();
        string              strsql = @"select *  FROM   TradeInfolog  where ord_code=@ord_code order by secno  ";
        NameValueCollection nvc    = new NameValueCollection
        {
            { "ord_code", ord_code }
        };
        DataTable       dt     = DbControl.Data_Get(strsql, nvc);
        TradeInfoResult result = new TradeInfoResult
        {
            TradeNo         = "",
            MerchantOrderNo = "",
            PaymentType     = "",
            RespondCode     = "",
            Auth            = "",
            Card6No         = "",
            Card4No         = "",
            PayTime         = "",
            PaymentMethod   = "",
            ExpireDate      = "",
            ExpireTime      = "",
            BankCode        = "",
            CodeNo          = "",
            Amt             = "",
            Exp             = ""
        };

        if (dt.Rows.Count > 0)
        {
            log.Status = dt.Rows[0]["status"].ToString();
            result     = new TradeInfoResult
            {
                TradeNo         = dt.Rows[0]["TradeNo"].ToString(),
                MerchantOrderNo = dt.Rows[0]["MerchantOrderNo"].ToString(),
                PaymentType     = dt.Rows[0]["PaymentType"].ToString(),
                RespondCode     = dt.Rows[0]["RespondCode"].ToString(),
                Auth            = dt.Rows[0]["Auth"].ToString(),
                Card6No         = dt.Rows[0]["Card6No"].ToString(),
                Card4No         = dt.Rows[0]["Card4No"].ToString(),
                PayTime         = dt.Rows[0]["PayTime"].ToString(),
                PaymentMethod   = dt.Rows[0]["PaymentMethod"].ToString(),
                ExpireDate      = dt.Rows[0]["ExpireDate"].ToString(),
                ExpireTime      = dt.Rows[0]["ExpireTime"].ToString(),
                BankCode        = dt.Rows[0]["BankCode"].ToString(),
                CodeNo          = dt.Rows[0]["CodeNo"].ToString(),
                Amt             = dt.Rows[0]["Amt"].ToString(),
                Exp             = dt.Rows[0]["Exp"].ToString()
            };
        }
        log.Result = result;
        dt.Dispose();
        return(log);
    }
コード例 #26
0
    public void selectSQL()
    {
        string strsql           = @"SELECT * 
            FROM  " + table_name + " where status <>'D' ";
        NameValueCollection nvc = new NameValueCollection();
        DataTable           dt  = DbControl.Data_Get(strsql, nvc);

        ListView1.DataSource = dt;
        ListView1.DataBind();
        dt.Dispose();
    }
コード例 #27
0
    protected void Page_Init(object sender, EventArgs e)
    {
        string strsql           = @"SELECT  upperid FROM      UnitData WHERE (unitid = @id) ";
        NameValueCollection nvc = new NameValueCollection
        {
            { "id", Request.QueryString["unitid"] }
        };
        DataTable dt = DbControl.Data_Get(strsql, nvc);

        unitid = dt.Rows[0][0].ToString();
        dt.Dispose();
    }
コード例 #28
0
ファイル: OrderLib.cs プロジェクト: kuan0904/x-cms
    public static OrderLib.OrderData AddOrdData(OrderLib.OrderData o)
    {
        string strsql = @"insert into tbl_OrderData
            (ord_code, memberid, paymode, invoice,  receivetime, contents,  SubPrice, DeliveryPrice, DiscountPrice, 
                TotalPrice, status,ordname,ordphone,ordaddress,shipname,shipphone,shipaddress,companyno,title
            ,ordgender,shipgender,coupon_no,email,zip,cityid,countryid,delivery_kind,ord_date) values 
                (@ord_code,@memberid, @paymode, @invoice, @receivetime, @contents,@SubPrice, @DeliveryPrice, 
                @DiscountPrice,@TotalPrice, @status,@ordname,@ordphone,@ordaddress,@shipname,@shipphone,@shipaddress
                ,@companyno,@title,@ordgender,@shipgender,@coupon_no,@email,@zip,@cityid,@countryid,@delivery_kind,@ord_date)";

        NameValueCollection nvc = new NameValueCollection
        {
            { "ord_code", o.Ord_code },
            { "memberid", o.Memberid },
            { "receivetime", o.ReceiveTime },
            { "contents", o.Contents },
            { "SubPrice", o.SubPrice.ToString() },
            { "DeliveryPrice", o.ShipPrice.ToString() },
            { "DiscountPrice", o.Discount.ToString() },
            { "TotalPrice", o.TotalPrice.ToString() },
            { "status", o.Status },
            { "paymode", o.Paymode },
            { "invoice", o.Invoice },
            { "ordname", o.Ordname },
            { "ordphone", o.Ordphone },
            { "ordaddress", o.Ordaddress },
            { "shipname", o.Shipname },
            { "shipphone", o.Shipphone },
            { "shipaddress", o.Shipaddress },
            { "companyno", o.Companyno },
            { "title", o.Title },
            { "ordgender", o.Ordgender },
            { "shipgender", o.Shipgender },
            { "coupon_no", o.coupon_no },
            { "email", o.Ordemail },
            { "zip", o.Ordzip },
            { "delivery_kind", o.Delivery_kind },
            { "cityid", o.Ordcityid.Id.ToString() },
            { "countryid", o.Ordcountyid.Id.ToString() },
            { "ord_date", DateTime.Today.ToShortDateString() }
        };
        int i = DbControl.Data_add(strsql, nvc);

        nvc.Clear();


        strsql = @"select max(ord_id)   from  tbl_orderdata   ";
        DataTable dt = DbControl.Data_Get(strsql, nvc);

        o.Ord_id = (int)dt.Rows[0][0];
        return(o);
    }
コード例 #29
0
    public void selectSQL()
    {
        string strsql           = "SELECT *  FROM tbl_tag where unitid =  @unitid  ";
        NameValueCollection nvc = new NameValueCollection();

        nvc.Add("unitid", unitid);
        DataTable dt = DbControl.Data_Get(strsql, nvc);

        ListView1.DataSource = dt;
        ListView1.DataBind();
        dt.Dispose();
        nvc.Clear();
    }
コード例 #30
0
ファイル: websiteinfo.aspx.cs プロジェクト: kuan0904/x-cms
    public void selectSQL()
    {
        string strsql           = "SELECT *  FROM WebSiteInfo  ";
        NameValueCollection nvc = new NameValueCollection();

        DataTable dt = DbControl.Data_Get(strsql, nvc);

        ListView1.DataSource = dt;
        ListView1.DataBind();
        dt.Dispose();
        nvc.Clear();
        ListView1.DataBind();
    }