private void ShowContactBookMessage()
    {
        EasyDataProvide ContactBook = new EasyDataProvide("ContactBook");
        //如果有資料則撈回學生個別聯絡事項資料
        EasyDataProvide StudentContactBook = new EasyDataProvide("StudentContactBook");
        StudentContactBook.AddParameter("contactBook_id", Request["contactBook_id"]);
        StudentContactBook.AddParameter("people_id", Request["people_id"]);
        DataRow rowSbook = StudentContactBook.GetSingleRow("people_id=@people_id and contactBook_id=@contactBook_id");
        if(rowSbook==null)
        {
            return;
        }

        EasyDataProvide StudentContactBookMessage = new EasyDataProvide("StudentContactBookMessage");
        StudentContactBookMessage.AddParameter("student_id", Request["people_id"]);
        StudentContactBookMessage.AddParameter("studentContactBook_id", rowSbook["id"].ToString());
        StudentContactBookMessage.FillContentPlaceHolderControls("student_id=@student_id and studentContactBook_id=@studentContactBook_id and Role=0");

        DataRow row= ContactBook.FillPlaceHolderControlsById(Request["contactBook_id"]);
        if(row["activity"].ToString()=="True")
        {
            InsertButton.Visible = false;
        }
        ViewState["date"] = row["date"].ToString();
        ViewState["contactBook_id"] = rowSbook["id"].ToString();
    }
Exemplo n.º 2
0
    private void Show()
    {
        //DataRow row = _Customer.FillPlaceHolderControlsById(Request["id"]);
        _Customer.AddParameter("id", User.Identity.Name);
        DataRow row = _Customer.FillContentPlaceHolderControls("id=@id");

        if (row == null)
        {
            return;
        }
        hidzip.Value = row["zip"].ToString();
    }
Exemplo n.º 3
0
    private void Show()
    {
        DataRow rowPublish = _ModulePublish.FillPlaceHolderControlsById(Request["id"]);

        if (rowPublish == null)
        {
            Response.Redirect("index.aspx");
        }
        this.Title = " " + rowPublish["title"].ToString();

        EasyDataProvide ModuleFiles = new EasyDataProvide("ModuleFiles");

        ModuleFiles.AddParameter("publishID", Request["id"]);
        DataTable dtFile = ModuleFiles.GetData("publishID=@publishID order by listNum Asc");

        dlFile.DataSource = dtFile;
        dlFile.DataBind();

        if (dlFile.Items.Count == 0)
        {
            h2file.Visible = false;
        }

        //EasyDataProvide ModulePictures = new EasyDataProvide("ModulePictures");
        //ModulePictures.AddParameter("publishID", Request["id"]);
        //DataTable dtImages = ModulePictures.GetData("publishID=@publishID order by listNum Asc");
        //dlImages.DataSource = dtImages;
        //dlImages.DataBind();


        //EasyDataProvide ModuleLinks = new EasyDataProvide("ModuleLinks");
        //ModuleLinks.AddParameter("publishID", Request["id"]);
        //DataTable dtLinks = ModuleLinks.GetData("publishID=@publishID order by listNum Asc");
        //repLinks.DataSource = dtLinks;
        //repLinks.DataBind();



        _ModuleContents.AddParameter("publishID", Request["id"]);
        DataRow rowContent = _ModuleContents.FillContentPlaceHolderControls("publishID=@publishID and type is null");

        article.Text = rowContent["article"].ToString();

        DataTable dtReply = _ModuleContents.GetData("publishID=@publishID and type=1", "order by initDate desc");

        repReply.DataSource = dtReply;
        repReply.DataBind();

        DataLayer dl = new DataLayer();

        dl.ModulePublish_UpdateCountsPlus(Request["ID"]);

        if (!User.Identity.IsAuthenticated)
        {
            txtReply.Visible     = false;
            lblMessage.Visible   = true;
            btnReply.Visible     = false;
            btnOpenReply.Visible = false;
        }
        else
        {
            string strUserData = ((FormsIdentity)(HttpContext.Current.User.Identity)).Ticket.UserData;
            if (strUserData.Length > 20)
            {
                FormsAuthentication.SignOut();
                Response.Redirect(Request.Url.ToString());
            }

            txtReply.Visible     = true;
            lblMessage.Visible   = false;
            btnReply.Visible     = true;
            btnOpenReply.Visible = true;
        }
    }
Exemplo n.º 4
0
 private void show()
 {
     EasyDataProvide ModuleContents = new EasyDataProvide("ModuleContents");
     ModuleContents.AddParameter("publishID", Request["ID"]);
     ModuleContents.FillContentPlaceHolderControls("publishID=@publishID");
 }
    private void ShowContactBookData()
    {
        DStudent student = new DStudent(Request["people_id"]);

        //Step 1:取得ContactBook Data
        DataLayer dl = new DataLayer();
        //如果txtDate.Text為空,會自動去抓取最新一筆聯絡簿資料
        DataRow rowBook = dl.GetTop1ContentBook(txtDate.Text, student.GradeID, "true");
        if (rowBook == null)
        {
            My.WebForm.doJavaScript("alert('無聯絡簿資料!');");
            return;
        }
        description.Text =My.WebForm.TXT2HTML(rowBook["description"].ToString());

        //Step 2:取得StudentContactBook 資料
        //根據contactBook_id 與people_id 取得StudentContactBook 資料
        EasyDataProvide StudentContactBook = new EasyDataProvide("StudentContactBook");
        StudentContactBook.AddParameter("contactBook_id", rowBook["id"].ToString());
        StudentContactBook.AddParameter("people_id", Request["people_id"]); //由網址列取得
        DataRow rowStudentBook = StudentContactBook.GetSingleRow("contactBook_id=@contactBook_id and people_id=@people_id");
        if (rowStudentBook == null)
        {
            return;
        }
        //如果聯絡簿資料已經上傳就不可以再編輯
        if(rowStudentBook["checkUpload"].ToString()=="1")
        {
            Panel1.Visible = false;
        }

        //Step 3:取得StudentContactBookMessage 資料
        //如果有資料則撈回學生個別聯絡事項資料
        EasyDataProvide StudentContactBookMessage = new EasyDataProvide("StudentContactBookMessage");
        StudentContactBookMessage.AddParameter("student_id", Request["people_id"]);
        StudentContactBookMessage.AddParameter("studentContactBook_id", rowStudentBook["id"].ToString());

        StudentContactBookMessage.FillContentPlaceHolderControls("student_id=@student_id and studentContactBook_id=@studentContactBook_id and Role=0");

        ViewState["date"] = rowBook["date"].ToString();
        ViewState["studentContactBook_id"] = rowStudentBook["id"].ToString();
    }