Exemplo n.º 1
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        //新增地址
        EasyDataProvide Address = new EasyDataProvide("Address");
        Address.AddParameter("city", Request["city"]);
        Address.AddParameter("division", Request["division"]);
        Address.AddParameter("zip", Request["zip"]);
        Address.AddParameter("address", address.Value);
        string addressID = Address.InsertReturnValue();

        //新增電話
        EasyDataProvide Telepone = new EasyDataProvide("Telephone");
        Telepone.AddParameter("areaCode", areaCode.Value);
        Telepone.AddParameter("numberCode", numberCode.Value);
        string telephoneID = Telepone.InsertReturnValue();

        //新增學校
        EasyDataProvide school = new EasyDataProvide("School");
        school.AddParameter("id",id.Text);
        int i = school.GetRowCount("id=@id");
        if(i>0)
        {
            My.WebForm.doJavaScript("alert('學校編號已經重複!')");
            return;
        }
        school.RemoveParameter("id");
        school.SetPlaceHolderFormQuest();

        school.AddParameter("address_id", addressID);
        school.AddParameter("telephone_id", telephoneID);
        school.Insert();
        My.WebForm.doJavaScript("alert('新增成功');location.href='School_List.aspx'");
    }
Exemplo n.º 2
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        EasyDataProvide Member = new EasyDataProvide("Member");

        Member.SetPlaceHolderFormQuest();
        DataRow dataRow = Member.GetSingleRow("account=@account");

        if (dataRow != null)
        {
            My.WebForm.doJavaScript("alert('帳號已使用!');");
            return;
        }
        Member.AddParameter("password", FormsAuthentication.HashPasswordForStoringInConfigFile(password.Text, "MD5"));
        string premissionString = PermissionUserControl1.permissionString;

        Member.AddParameter("Permission", premissionString);
        string userID = Member.InsertReturnValue();

        if (ddlRole.Items.Count > 0)
        {
            EasyDataProvide RoleUserMapping = new EasyDataProvide("RoleUserMapping");
            RoleUserMapping.AddParameter("roleID", ddlRole.SelectedValue);
            RoleUserMapping.AddParameter("userID", userID);
            RoleUserMapping.Insert();
        }


        Response.Redirect("Account_list.aspx?ModuleID=" + Request["ModuleID"]);
    }
Exemplo n.º 3
0
 protected void InsertButton_Click1(object sender, EventArgs e)
 {
     TIN.EasyDataProvide UnitName = new EasyDataProvide("UnitName");
     UnitName.SetPlaceHolderFormQuest();
     UnitName.Insert();
     Response.Redirect("Unit_list.aspx?ModuleID=" + Request["ModuleID"]);
 }
Exemplo n.º 4
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        //檢查帳號是否重複
        EasyDataProvide Customer = new EasyDataProvide("Customer");

        Customer.AddParameter("username", username.Text);
        DataRow rowCheck = Customer.GetSingleRow("username=@username");

        if (rowCheck != null)
        {
            My.WebForm.doJavaScript("alert('帳號已經存在')");
            return;
        }

        //驗證手機號碼格式


        //新增會員
        Customer.SetPlaceHolderFormQuest();
        Customer.AddParameter("password", password.Text);
        Customer.AddParameter("city", Request["city"]);
        Customer.AddParameter("division", Request["division"]);
        Customer.AddParameter("zip", Request["zip"]);

        Customer.Insert();
        My.WebForm.doJavaScript("alert('加入成功!');location.href='index.aspx'");
    }
Exemplo n.º 5
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        string areaID = "";
        string telID = "";

        //新增或修改電話
        _telephone.AddParameter("areaCode", areaCode.Value);
        _telephone.AddParameter("numberCode", numberCode.Value);

        if (string.IsNullOrEmpty(ViewState["tel"].ToString()))
        {
            telID = _telephone.InsertReturnValue();
        }
        else
        {
            _telephone.UpdateById(ViewState["tel"].ToString());
            telID = ViewState["tel"].ToString();
        }

        //新增或修改地址
        _address.AddParameter("city", Request["city"]);
        _address.AddParameter("division", Request["division"]);
        _address.AddParameter("zip", Request["zip"]);
        _address.AddParameter("address", address.Value);
        if (string.IsNullOrEmpty(ViewState["address"].ToString()))
        {
            areaID = _address.InsertReturnValue();
        }
        else
        {
            _address.UpdateById(ViewState["address"].ToString());
            areaID = ViewState["address"].ToString();
        }

        //更新Pepole
        EasyDataProvide People = new EasyDataProvide("People");
        People.SetPlaceHolderFormQuest();
        People.AddParameter("address_id", telID);
        People.AddParameter("telephone_id", areaID);
        People.UpdateById(Request["id"]);

        //更新teacher
        _teacher.AddParameter("rank", rank.SelectedValue);
        _teacher.UpdateById(Request["id"]);

        //更新People_School

        _people_School.AddParameter("people_id", Request["id"]);
        _people_School.AddParameter("school_id", ddlSchool.SelectedValue);
        _people_School.Update("people_id=@people_id");

        //更新帳號

        _account.AddParameter("password", FormsAuthentication.HashPasswordForStoringInConfigFile(password.Text, "MD5"));
        _account.AddParameter("emailAddress", emailAddress.Text);
        _account.AddParameter("people_id", Request["id"]);
        _account.UpdateById(Request["id"]);
        My.WebForm.doJavaScript("alert('修改成功');location.href='Teacher_List.aspx'");
    }
Exemplo n.º 6
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        //檢查帳號是否重複
        EasyDataProvide Account = new EasyDataProvide("Account");
        Account.AddParameter("username", username.Text);
        DataRow rowCheck = Account.GetSingleRow("username=@username");
        if (rowCheck != null)
        {
            My.WebForm.doJavaScript("alert('帳號已經存在')");
            return;
        }

        string peopleId = Guid.NewGuid().ToString();
        //新增地址
        EasyDataProvide Address = new EasyDataProvide("Address");
        Address.AddParameter("city", Request["city"]);
        Address.AddParameter("division", Request["division"]);
        Address.AddParameter("zip", Request["zip"]);
        Address.AddParameter("address", address.Value);
        string addressID = Address.InsertReturnValue();

        //新增電話
        EasyDataProvide Telepone = new EasyDataProvide("Telephone");
        Telepone.AddParameter("areaCode", areaCode.Value);
        Telepone.AddParameter("numberCode", numberCode.Value);
        string telephoneID = Telepone.InsertReturnValue();

        //新增Pepole
        EasyDataProvide People = new EasyDataProvide("People");
        People.SetPlaceHolderFormQuest();
        People.AddParameter("id", peopleId);
        People.AddParameter("address_id", addressID);
        People.AddParameter("telephone_id", telephoneID);
        People.AddParameter("role", "2");
        People.Insert();

        //新增Parent
        EasyDataProvide Parent = new EasyDataProvide("Parent");

        Parent.AddParameter("id", peopleId);
        Parent.SetPlaceHolderFormQuest();
        Parent.Insert();

        //新增People_School
        EasyDataProvide People_School = new EasyDataProvide("People_School");
        People_School.AddParameter("people_id", peopleId);
        People_School.AddParameter("school_id", (new Person()).School_id);
        People_School.Insert();

        //新增帳號
        Account.AddParameter("password", FormsAuthentication.HashPasswordForStoringInConfigFile(password.Text, "MD5"));
        Account.AddParameter("emailAddress", emailAddress.Text);

        Account.AddParameter("people_id", peopleId);
        Account.AddParameter("id", Guid.NewGuid().ToString());
        Account.Insert();

        My.WebForm.doJavaScript("alert('新增成功');location.href='Parent_List.aspx'");
    }
Exemplo n.º 7
0
    protected void UpdateButton_Click(object sender, EventArgs e)
    {
        EasyDataProvide InputData = new EasyDataProvide("InputData");

        InputData.SetPlaceHolderFormQuest();
        InputData.UpdateById(Request["ID"]);
        Response.Redirect("Input_list.aspx?ModuleID=" + Request["ModuleID"]);
    }
Exemplo n.º 8
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        EasyDataProvide EmailTemplats = new EasyDataProvide("EmailTemplats");

        EmailTemplats.SetPlaceHolderFormQuest();
        EmailTemplats.Insert();
        Response.Redirect("EmailTemplat_List.aspx?ModuleID=" + Request["ModuleID"]);
    }
Exemplo n.º 9
0
    //private void ShowOrg()
    //{
    //    EasyDataProvide UnitName = new EasyDataProvide("UnitName");
    //    DataTable dt = UnitName.GetAllData();
    //    ddlOrg.DataSource = dt;
    //    ddlOrg.DataBind();
    //}
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        Person person = new Person();

        EasyDataProvide ModulePublish = new EasyDataProvide("ModulePublish");
        ModulePublish.SetPlaceHolderFormQuest();
        //處理上傳檔案
        if (ddlFile.SelectedValue == "檔案上傳" && fuFile.HasFile)
        {
            //取得副檔名
            string Extension = fuFile.FileName.Split('.')[fuFile.FileName.Split('.').Length - 1];
            //新檔案名稱
            string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension);
            fuFile.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Files/{0}", fileName)));
            ModulePublish.AddParameter("fileUrl", fileName);

        }

        //處理上傳圖片

        if (fuPic.HasFile)
        {
            if (fuPic.PostedFile.ContentType.IndexOf("image") == -1)
            {
                My.WebForm.doJavaScript("alert('檔案型態錯誤!');");
                return;
            }

            //取得副檔名
            string Extension = fuPic.FileName.Split('.')[fuPic.FileName.Split('.').Length - 1];
            //新檔案名稱
            string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension);
            fuPic.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Images/{0}", fileName)));
            My.WebForm.GenerateThumbnailImage(fileName, fuPic.PostedFile.InputStream, Server.MapPath("~/UploadFiles/Images"), "S", 69, 50);
            ModulePublish.AddParameter("picUrl", fileName);

        }

        ModulePublish.AddParameter("classID", ddlClass1.SelectedValue);
        //ModulePublish.AddParameter("OrgID", ddlOrg.SelectedValue);
        //ModulePublish.AddParameter("OrgNames", ddlOrg.SelectedItem.Text);
        //ModulePublish.AddParameter("updater", person.name);
        //ModulePublish.AddParameter("updaterUnit", person.organization);
        //ModulePublish.AddParameter("lastupdated", DateTime.Now.ToString());
        //不填結束日期時,設定一個800年後的日期
        if (string.IsNullOrEmpty(endDate.Text))
        {
            ModulePublish.AddParameter("endDate", "2800/1/1");
        }
        ModulePublish.UpdateById(Request["ID"]);

        EasyDataProvide ModuleContents = new EasyDataProvide("ModuleContents");
        ModuleContents.AddParameter("publishID", Request["ID"]);
        ModuleContents.AddParameter("article", article.Text);
        ModuleContents.Update("publishID=@publishID");

        Response.Redirect(String.Format("Discusses_List.aspx?ModuleID={0}&page={1}&grade_id={2}", Request["ModuleID"], Request["page"], Request["grade_id"]));
    }
Exemplo n.º 10
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        EasyDataProvide courseSubject = new EasyDataProvide("CourseSubject");
        courseSubject.SetPlaceHolderFormQuest();

        courseSubject.AddParameter("school_id",(new Person()).School_id);
        courseSubject.Insert();
        My.WebForm.doJavaScript("alert('新增成功');location.href='CourseSubject_List.aspx'");
    }
Exemplo n.º 11
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        EasyDataProvide OutputDate = new EasyDataProvide("OutputDate");

        OutputDate.SetPlaceHolderFormQuest();

        OutputDate.Insert();
        Response.Redirect("Output_list.aspx?ModuleID=" + Request["ModuleID"]);
    }
Exemplo n.º 12
0
 //秀出所有學校名單(下拉式選單)
 /*
    * private void ShowSchools()
 {
     EasyDataProvide School = new EasyDataProvide("School");
     DataTable dt = School.GetData("disable='False'");
     school_id.DataTextField ="name";
     school_id.DataValueField = "id";
     school_id.DataSource = dt;
     school_id.DataBind();
 }
    * */
 protected void InsertButton_Click(object sender, EventArgs e)
 {
     //新增班級
     EasyDataProvide grade = new EasyDataProvide("Grade");
     grade.SetPlaceHolderFormQuest();
     grade.AddParameter("school_id", (new Person()).School_id);
     grade.Insert();
     My.WebForm.doJavaScript("alert('新增成功');location.href='Grade_List.aspx'");
 }
Exemplo n.º 13
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        EasyDataProvide InputData = new EasyDataProvide("InputData");

        InputData.SetPlaceHolderFormQuest();
        InputData.AddParameter("customerID", ddlCustomer.SelectedValue);
        InputData.AddParameter("aliasName", ddlCustomer.SelectedItem.Text);
        InputData.Insert();
        Response.Redirect("Input_list.aspx?ModuleID=" + Request["ModuleID"]);
    }
Exemplo n.º 14
0
    protected void btnADD_Click(object sender, EventArgs e)
    {
        string          RoleID = Request["ID"].ToString();
        EasyDataProvide Role   = new EasyDataProvide("Role");

        Role.SetPlaceHolderFormQuest();
        Role.AddParameter("permission", PermissionUserControl2.permissionString);
        Role.UpdateById(RoleID);

        Response.Redirect("Role_list.aspx?ModuleID=A02");
    }
Exemplo n.º 15
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        EasyDataProvide Role = new EasyDataProvide("Role");

        Role.SetPlaceHolderFormQuest();
        Role.AddParameter("permission", PermissionUserControl2.permissionString);
        Role.Insert();


        Response.Redirect("Role_list.aspx?ModuleID=A02");
    }
Exemplo n.º 16
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        string strUserData = ((FormsIdentity)(HttpContext.Current.User.Identity)).Ticket.UserData;

        EasyDataProvide InputData = new EasyDataProvide("InputData");

        InputData.SetPlaceHolderFormQuest();
        InputData.AddParameter("customerID", User.Identity.Name);
        InputData.AddParameter("aliasName", strUserData);
        InputData.Insert();
        My.WebForm.doJavaScript("alert('已送出!管理者審核中!');location='index.aspx'");
    }
Exemplo n.º 17
0
    protected void UpdateButton_Click(object sender, EventArgs e)
    {
        _Member.SetPlaceHolderFormQuest();
        if (!string.IsNullOrEmpty(Cpassword.Text))
        {
            _Member.AddParameter("password", FormsAuthentication.HashPasswordForStoringInConfigFile(Cpassword.Text, "MD5"));
        }
        string premissionString = PermissionUserControl1.permissionString;

        _Member.AddParameter("Permission", premissionString);
        _Member.UpdateById(Request["ID"]);
        Response.Redirect("Account_list.aspx?ModuleID=" + Request["ModuleID"]);
    }
Exemplo n.º 18
0
    protected void lnkAddMyBookCase_Click(object sender, EventArgs e)
    {
        EasyDataProvide BookCase = new EasyDataProvide("BookCase");

        BookCase.SetPlaceHolderFormQuest();
        BookCase.AddParameter("file_id", ViewState["file_id"].ToString());
        BookCase.AddParameter("school_id", _myPerson.School_id);
        BookCase.AddParameter("people_id", _myPerson.people_id);
        BookCase.AddParameter("tab_id", "9");
        BookCase.AddParameter("role", _myPerson.Role == Person.LoginRole.Teacher ? "0" : "1");

        BookCase.Insert();

        Response.Redirect("BookCase_List.aspx");
    }
Exemplo n.º 19
0
    protected void btnSure_Click(object sender, EventArgs e)
    {
        EasyDataProvide ModuleContents = new EasyDataProvide("ModuleContents");
        ModuleContents.AddParameter("publishID", Request["ID"]);
        DataRow row = ModuleContents.GetSingleRow("publishID=@publishID");
        ModuleContents.SetPlaceHolderFormQuest();
        if (row == null)
        {
            ModuleContents.Insert();
        }
        else
        {
            //DataLayer.setBehaviour("�ʺA�o���t��", "�ק�" + ViewState["title"]);
            ModuleContents.Update("publishID=@publishID");
        }

        Response.Redirect("_News_Files.aspx?ModuleID=" + Request["ModuleID"] + "&ID=" + Request["ID"]);
    }
Exemplo n.º 20
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(allName.Text))
        {
            My.WebForm.doJavaScript("alert('您的姓名尚未填寫!');");
            return;
        }
        if (string.IsNullOrEmpty(emailAddress.Text))
        {
            My.WebForm.doJavaScript("alert('您的電子郵件尚未填寫!');");
            return;
        }
        if (!My.WebForm.IsValidEmail(emailAddress.Text))
        {
            My.WebForm.doJavaScript("alert('您的電子郵件格式有誤!');");
            return;
        }
        if (string.IsNullOrEmpty(phoneNumber.Text))
        {
            My.WebForm.doJavaScript("alert('您的聯絡電話尚未填寫!');");
            return;
        }
        if (string.IsNullOrEmpty(article.Text))
        {
            My.WebForm.doJavaScript("alert('問題或建議必填!');");
            return;
        }
        if (txtVCode.Text != ViewState["Captcha"].ToString())
        {
            My.WebForm.doJavaScript("alert('驗證碼輸入錯誤!');");
            return;
        }

        ViewState["GUID"] = Guid.NewGuid().ToString();
        EasyDataProvide Contact = new EasyDataProvide("Contact");

        Contact.SetPlaceHolderFormQuest();

        Contact.AddParameter("id", ViewState["GUID"].ToString());
        Contact.AddParameter("questionClass", ddlQuestionClass.SelectedValue);
        Contact.Insert();

        My.WebForm.doJavaScript("alert('問題已送出,感謝您的意見!');location.href='index.aspx'");
    }
Exemplo n.º 21
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(article.Text))
        {
            My.WebForm.doJavaScript("alert('詳細說明不可以空白.');");
            return;
        }
        //if (shortDescription.Text.Length >=500)
        //{
        //    My.WebForm.doJavaScript("alert('簡單說明不可以超過500個字.');");
        //    return;
        //}



        EasyDataProvide ModulePublish = new EasyDataProvide("ModulePublish");

        ModulePublish.SetPlaceHolderFormQuest();

        string strUserData = ((FormsIdentity)(HttpContext.Current.User.Identity)).Ticket.UserData;

        ModulePublish.AddParameter("updater", strUserData);

        ModulePublish.AddParameter("lastupdated", DateTime.Now.ToString());

        ModulePublish.UpdateById(Request["ID"]);

        EasyDataProvide ModuleContents = new EasyDataProvide("ModuleContents");

        ModuleContents.AddParameter("article", article.Text);
        ModuleContents.UpdateById(ViewState["articleID"].ToString());



        Response.Redirect(String.Format("i-post.aspx?&page={0}", Request["page"]));
    }
Exemplo n.º 22
0
    //private void ShowOrg()
    //{
    //    EasyDataProvide UnitName = new EasyDataProvide("UnitName");
    //    DataTable dt = UnitName.GetAllData();
    //    ddlOrg.DataSource = dt;
    //    ddlOrg.DataBind();
    //}
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(article.Text))
        {
            My.WebForm.doJavaScript("alert('�Բӻ������i�H�ť�.');");
            return;
        }
        if (shortDescription.Text.Length >= 500)
        {
            My.WebForm.doJavaScript("alert('²�满�����i�H�W�L500�Ӧr.');");
            return;
        }

        Person person = new Person();

        EasyDataProvide ModulePublish = new EasyDataProvide("ModulePublish");
        ModulePublish.SetPlaceHolderFormQuest();
        //�B�z�W���ɮ�
        if (ddlFile.SelectedValue == "�ɮפW��" && fuFile.HasFile)
        {
            //���o���ɦW
            string Extension = fuFile.FileName.Split('.')[fuFile.FileName.Split('.').Length - 1];
            //�s�ɮצW��
            string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension);
            fuFile.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Files/{0}", fileName)));
            ModulePublish.AddParameter("fileUrl", fileName);

        }

        //�B�z�W�ǹϤ�

        if (fuPic.HasFile)
        {
            if (fuPic.PostedFile.ContentType.IndexOf("image") == -1)
            {
                My.WebForm.doJavaScript("alert('�ɮ׫��A���~!');");
                return;
            }

            //���o���ɦW
            string Extension = fuPic.FileName.Split('.')[fuPic.FileName.Split('.').Length - 1];
            //�s�ɮצW��
            string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension);
            fuPic.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Images/{0}", fileName)));
            ModulePublish.AddParameter("picUrl", fileName);

        }

        ModulePublish.AddParameter("classID", ddlClass1.SelectedValue);
        //ModulePublish.AddParameter("OrgID", ddlOrg.SelectedValue);
        //ModulePublish.AddParameter("OrgNames", ddlOrg.SelectedItem.Text);
        //ModulePublish.AddParameter("updater", person.name);
        //ModulePublish.AddParameter("updaterUnit", person.organization);
        //ModulePublish.AddParameter("lastupdated", DateTime.Now.ToString());
        //���񵲧����ɡA�]�w�@��800�~�᪺���
        if (string.IsNullOrEmpty(endDate.Text))
        {
            ModulePublish.AddParameter("endDate", "2800/1/1");
        }
        ModulePublish.UpdateById(Request["ID"]);

        EasyDataProvide ModuleContents = new EasyDataProvide("ModuleContents");
        ModuleContents.AddParameter("publishID", Request["ID"]);
        ModuleContents.AddParameter("article", article.Text);
        ModuleContents.Update("publishID=@publishID");

        Response.Redirect(String.Format("News_List.aspx?ModuleID={0}&page={1}", Request["ModuleID"], Request["page"]));
    }
Exemplo n.º 23
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(article.Text))
        {
            My.WebForm.doJavaScript("alert('�Բӻ������i�H�ť�.');");
            return;
        }
        if (shortDescription.Text.Length >= 500)
        {
            My.WebForm.doJavaScript("alert('²�满�����i�H�W�L500�Ӧr.');");
            return;
        }
        Person person = new Person();

        EasyDataProvide ModulePublish = new EasyDataProvide("ModulePublish");
        ModulePublish.SetPlaceHolderFormQuest();
        //�B�z�W���ɮ�
        if (ddlFile.SelectedValue == "�ɮפW��" && fuFile.HasFile)
        {
            //���o���ɦW
            string Extension = fuFile.FileName.Split('.')[fuFile.FileName.Split('.').Length - 1];
            //�s�ɮצW��
            string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension);
            fuFile.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Files/{0}", fileName)));
            ModulePublish.AddParameter("fileUrl", fileName);

        }

        //�B�z�W�ǹϤ�

        if (fuPic.HasFile)
        {
            if (fuPic.PostedFile.ContentType.IndexOf("image") == -1)
            {
                My.WebForm.doJavaScript("alert('�ɮ׫��A���~!');");
                return;
            }

            //���o���ɦW
            string Extension = fuPic.FileName.Split('.')[fuPic.FileName.Split('.').Length - 1];
            //�s�ɮצW��
            string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension);
            fuPic.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Images/{0}", fileName)));
            ModulePublish.AddParameter("picUrl", fileName);

        }

        ModulePublish.AddParameter("id", ViewState["GUID"].ToString());
        ModulePublish.AddParameter("moduleID", Request["ModuleID"]);
        ModulePublish.AddParameter("OrgID", person.School_id);
        //ModulePublish.AddParameter("OrgNames", ddlOrg.SelectedItem.Text);
        ModulePublish.AddParameter("classID", ddlClass1.SelectedValue);
        ModulePublish.AddParameter("poster", person.people_id);

        //���񵲧����ɡA�]�w�@��800�~�᪺���
        if (string.IsNullOrEmpty(endDate.Text))
        {
            ModulePublish.AddParameter("endDate", "2800/1/1");
        }

        //if (DataLayer.IsInRole("admins", HttpContext.Current.User.Identity.Name))
        //{
        //    ModulePublish.addParameter("beSelect", "1"); //admin �s�յo�G��
        //}
        ModulePublish.Insert();

        EasyDataProvide ModuleContents = new EasyDataProvide("ModuleContents");
        ModuleContents.AddParameter("publishID", ViewState["GUID"].ToString());
        ModuleContents.AddParameter("article", article.Text);
        ModuleContents.Insert();
        Session[Request["ModuleID"] + "ddlOrg"] = ddlOrg.SelectedValue;
        Session[Request["ModuleID"] + "Class1"] = ddlClass1.SelectedValue;
        Response.Redirect("News_List.aspx?ModuleID=" + Request["ModuleID"] + "&ID=" + ViewState["GUID"]);
    }
Exemplo n.º 24
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        if (_myPerson.Role == Person.LoginRole.Teacher)
        {
            bool flag = false;
            foreach (ListItem item in cblGrade.Items)
            {
                if (item.Selected)
                {
                    flag = true;
                }
            }
            if (!flag)
            {
                My.WebForm.doJavaScript("alert('請選擇班級!!')");
                return;
            }
        }

        EasyDataProvide AttachmentFile = new EasyDataProvide("AttachmentFile");
        EasyDataProvide BookCase = new EasyDataProvide("BookCase");
        AttachmentFile.SetPlaceHolderFormQuest();
        //取得副檔名
        string Path = GetMyPath();

        if (!fuFile.HasFile)
        {
            My.WebForm.doJavaScript("alert('請上傳檔案')");
            return;
        }
        string Extension = fuFile.FileName.Split('.')[fuFile.FileName.Split('.').Length - 1];
        //新檔案名稱
        string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension);

        fuFile.SaveAs(String.Format("{0}/{1}", Path, fileName));

        string filePic = "";
        if (fuPic.HasFile)
        {
            string PicExtension = fuPic.FileName.Split('.')[fuPic.FileName.Split('.').Length - 1];
            //新檔案名稱
            filePic = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, PicExtension);

            fuPic.SaveAs(String.Format("{0}/{1}", Path, filePic));
            My.WebForm.GenerateThumbnailImage(filePic, fuPic.PostedFile.InputStream, Path, "S", 86, 69);

            AttachmentFile.AddParameter("coverPicName", filePic);
        }

        AttachmentFile.AddParameter("fileName", fileName);
        AttachmentFile.AddParameter("extension", Extension);
        AttachmentFile.AddParameter("school_id", _myPerson.School_id);
        AttachmentFile.AddParameter("people_id", _myPerson.people_id);

        EasyDataProvide School = new EasyDataProvide("School");
        DataRow row = School.GetById(_myPerson.School_id);
        string domainName = "";
        if (row != null)
        {
            domainName = row["domainName"].ToString();
        }
        AttachmentFile.AddParameter("domainName", domainName);
        string file_id = AttachmentFile.InsertReturnValue();

        BookCase.SetPlaceHolderFormQuest();
        BookCase.AddParameter("file_id", file_id);
        BookCase.AddParameter("school_id", _myPerson.School_id);
        BookCase.AddParameter("people_id", _myPerson.people_id);
        BookCase.AddParameter("role", _myPerson.Role == Person.LoginRole.Teacher ? "0" : "1");

        string BookCaseID = BookCase.InsertReturnValue();
        EasyDataProvide BookCaseGrade = new EasyDataProvide("BookCaseGrade");
        if (_myPerson.Role == Person.LoginRole.Teacher)
        {
            foreach (ListItem item in cblGrade.Items)
            {
                if (item.Selected)
                {
                    BookCaseGrade.AddParameter("bookCase_id", BookCaseID);
                    BookCaseGrade.AddParameter("grade_id", item.Value);
                    BookCaseGrade.Insert();
                }
            }

        }
        else
        {
            DStudent dStudent=new DStudent(_myPerson.people_id);
            BookCaseGrade.AddParameter("bookCase_id", BookCaseID);
            BookCaseGrade.AddParameter("grade_id", dStudent.GradeID);
            BookCaseGrade.Insert();
        }
        My.WebForm.doJavaScript("alert('新增成功');location.href='BookCase_List.aspx'");
    }
Exemplo n.º 25
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(article.Text))
        {
            My.WebForm.doJavaScript("alert('詳細說明不可以空白.');");
            return;
        }
        //if (shortDescription.Text.Length >=500)
        //{
        //    My.WebForm.doJavaScript("alert('簡單說明不可以超過500個字.');");
        //    return;
        //}

        Person person = new Person();

        EasyDataProvide ModulePublish = new EasyDataProvide("ModulePublish");

        ModulePublish.SetPlaceHolderFormQuest();
        //處理上傳檔案
        if (ddlFile.SelectedValue == "檔案上傳" && fuFile.HasFile)
        {
            //取得副檔名
            string Extension = fuFile.FileName.Split('.')[fuFile.FileName.Split('.').Length - 1];
            //新檔案名稱
            string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension);
            fuFile.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Files/{0}", fileName)));
            ModulePublish.AddParameter("fileUrl", fileName);
        }

        //處理上傳圖片

        if (fuPic.HasFile)
        {
            if (fuPic.PostedFile.ContentType.IndexOf("image") == -1)
            {
                My.WebForm.doJavaScript("alert('檔案型態錯誤!');");
                return;
            }

            //取得副檔名
            string Extension = fuPic.FileName.Split('.')[fuPic.FileName.Split('.').Length - 1];
            //新檔案名稱
            string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension);
            fuPic.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Images/{0}", fileName)));
            My.WebForm.GenerateThumbnailImage(fileName, fuPic.PostedFile.InputStream, Server.MapPath("~/UploadFiles/Images/"), "S", 127, 127);
            ModulePublish.AddParameter("picUrl", fileName);
        }

        ModulePublish.AddParameter("classID", ddlClass1.SelectedValue);
        ModulePublish.AddParameter("OrgID", ddlOrg.SelectedValue);
        ModulePublish.AddParameter("OrgNames", ddlOrg.SelectedItem.Text);
        ModulePublish.AddParameter("updater", person.name);
        ModulePublish.AddParameter("updaterUnit", person.organization);
        ModulePublish.AddParameter("lastupdated", DateTime.Now.ToString());
        //不填結束日期時,設定一個800年後的日期
        if (string.IsNullOrEmpty(endDate.Text))
        {
            ModulePublish.AddParameter("endDate", "2800/1/1");
        }
        ModulePublish.UpdateById(Request["ID"]);

        EasyDataProvide ModuleContents = new EasyDataProvide("ModuleContents");

        ModuleContents.AddParameter("article", article.Text);
        ModuleContents.UpdateById(ViewState["articleID"].ToString());



        Response.Redirect(String.Format("News_List.aspx?ModuleID={0}&page={1}", Request["ModuleID"], Request["page"]));
    }
Exemplo n.º 26
0
    protected void BtnUpFile1_Click1(object sender, EventArgs e)
    {
        if (ViewState["exist"].ToString() == "False")
        {
            My.WebForm.doJavaScript("alert('請先輸入課程備註、重要事項或備課事項');");
            return;
        }
        EasyDataProvide TimeTable = new EasyDataProvide("TimeTable");
        DataRow rowTime = TimeTable.GetById(Request["timetable_id"]);
        if(rowTime==null)
        {
            My.WebForm.doJavaScript("備課資料有誤!");
            return;
        }
        string grade_id = rowTime["grade_id"].ToString();

        Person myPerson = new Person();
        EasyDataProvide AttachmentFile = new EasyDataProvide("AttachmentFile");
        AttachmentFile.SetPlaceHolderFormQuest();
        //取得副檔名
        string Path = GetMyPath();

        if (!FuFile1.HasFile)
        {
            My.WebForm.doJavaScript("alert('請上傳檔案')");
            return;
        }
        string Extension = FuFile1.FileName.Split('.')[FuFile1.FileName.Split('.').Length - 1];
        //新檔案名稱
        string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension);

        FuFile1.SaveAs(String.Format("{0}/{1}", Path, fileName));
        AttachmentFile.AddParameter("fileName", fileName);
        AttachmentFile.AddParameter("extension", Extension);
        AttachmentFile.AddParameter("school_id", myPerson.School_id);
        AttachmentFile.AddParameter("people_id", myPerson.people_id);

        EasyDataProvide School = new EasyDataProvide("School");
        DataRow row = School.GetById(myPerson.School_id);
        string domainName = "";
        if (row != null)
        {
            domainName = row["domainName"].ToString();
        }
        AttachmentFile.AddParameter("domainName", domainName);
        string file_id = AttachmentFile.InsertReturnValue();

        EasyDataProvide PrepareLessonFile = new EasyDataProvide("PrepareLessonFile");
        PrepareLessonFile.AddParameter("type", "0");
        PrepareLessonFile.AddParameter("prepareLesson_id", ViewState["ID"].ToString());
        PrepareLessonFile.AddParameter("file_id", file_id);
        PrepareLessonFile.AddParameter("initDate", DateTime.Now.ToShortDateString());
        PrepareLessonFile.AddParameter("poster", myPerson.account);
        PrepareLessonFile.Insert();

        EasyDataProvide BookCase = new EasyDataProvide("BookCase");
        BookCase.SetPlaceHolderFormQuest();
        BookCase.AddParameter("file_id", file_id);
        BookCase.AddParameter("school_id", myPerson.School_id);
        BookCase.AddParameter("people_id", myPerson.people_id);
        BookCase.AddParameter("role", myPerson.Role == Person.LoginRole.Teacher ? "0" : "1");

        string BookCaseID = BookCase.InsertReturnValue();

        EasyDataProvide BookCaseGrade = new EasyDataProvide("BookCaseGrade");
        BookCaseGrade.AddParameter("bookCase_id", BookCaseID);
        BookCaseGrade.AddParameter("grade_id", grade_id);
        BookCaseGrade.AddParameter("tab_id", "7");
        BookCaseGrade.Insert();
        ShowFile1();
    }
Exemplo n.º 27
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(article.Text))
        {
            My.WebForm.doJavaScript("alert('詳細說明不可以空白.');");
            return;
        }
        //if (shortDescription.Text.Length >= 500)
        //{
        //    My.WebForm.doJavaScript("alert('簡單說明不可以超過500個字.');");
        //    return;
        //}

        EasyDataProvide ModulePublish = new EasyDataProvide("ModulePublish");

        ModulePublish.SetPlaceHolderFormQuest();
        //處理上傳檔案
        if (ddlFile.SelectedValue == "檔案上傳" && fuFile.HasFile)
        {
            //取得副檔名
            string Extension = fuFile.FileName.Split('.')[fuFile.FileName.Split('.').Length - 1];
            //新檔案名稱
            string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension);
            fuFile.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Files/{0}", fileName)));
            ModulePublish.AddParameter("fileUrl", fileName);
        }

        //處理上傳圖片

        if (fuPic.HasFile)
        {
            if (fuPic.PostedFile.ContentType.IndexOf("image") == -1)
            {
                My.WebForm.doJavaScript("alert('檔案型態錯誤!');");
                return;
            }

            //取得副檔名
            string Extension = fuPic.FileName.Split('.')[fuPic.FileName.Split('.').Length - 1];
            //新檔案名稱
            string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension);
            fuPic.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Images/{0}", fileName)));
            My.WebForm.GenerateThumbnailImage(fileName, fuPic.PostedFile.InputStream, Server.MapPath("~/UploadFiles/Images/"), "S", 127, 127);
            ModulePublish.AddParameter("picUrl", fileName);
        }

        ModulePublish.AddParameter("id", ViewState["GUID"].ToString());
        ModulePublish.AddParameter("moduleID", Request["ModuleID"]);
        ModulePublish.AddParameter("OrgID", ddlOrg.SelectedValue);
        ModulePublish.AddParameter("OrgNames", ddlOrg.SelectedItem.Text);
        ModulePublish.AddParameter("classID", ddlClass1.SelectedValue);

        Person person = new Person();

        ModulePublish.AddParameter("poster", person.name);
        ModulePublish.AddParameter("posterUnit", person.organization);
        ModulePublish.AddParameter("updater", person.name);
        ModulePublish.AddParameter("updaterUnit", person.organization);
        //不填結束日期時,設定一個800年後的日期
        if (string.IsNullOrEmpty(endDate.Text))
        {
            ModulePublish.AddParameter("endDate", "2800/1/1");
        }

        if (initDate.Text == DateTime.Now.ToString("yyyy/MM/dd"))
        {
            DateTime d = DateTime.Now;
            ModulePublish.AddParameter("initDate", d.ToString());
            ModulePublish.AddParameter("lastupdated", d.ToString());
        }
        else
        {
            ModulePublish.AddParameter("lastupdated", initDate.Text);
        }
        //if (DataLayer.IsInRole("admins", HttpContext.Current.User.Identity.Name))
        //{
        //    ModulePublish.addParameter("beSelect", "1"); //admin 群組發佈的
        //}
        ModulePublish.Insert();

        EasyDataProvide ModuleContents = new EasyDataProvide("ModuleContents");

        ModuleContents.AddParameter("publishID", ViewState["GUID"].ToString());
        ModuleContents.AddParameter("article", article.Text);
        ModuleContents.Insert();
        if (chkAlert.Checked)
        {
            EasyDataProvide Customer   = new EasyDataProvide("Customer");
            DataTable       dtCustomer = Customer.GetData("emailAddress IS NOT NULL AND emailAddress<>''");

            string subject = "【雲施團分享】" + title.Text;

            string mailBody = article.Text.Replace(@"/UploadFiles/", ConfigurationManager.AppSettings["ServerHost"] + @"/UploadFiles/");

            mailBody += "<br />發表人:團長|發表日期:" + DateTime.Now.ToShortDateString();

            mailBody += "<br /><br />文章網址:<a href='" + ConfigurationManager.AppSettings["ServerHost"] + "News_Detail.aspx?id=" + ViewState["GUID"].ToString() + "'>" + ConfigurationManager.AppSettings["ServerHost"] + "News_Detail.aspx?id=" + ViewState["GUID"].ToString() + "</a>";

            //My.WebForm.SystemSendMailCC("*****@*****.**", "*****@*****.**", subject, mailBody);
            foreach (DataRow row in dtCustomer.Rows)
            {
                My.WebForm.SystemSendMailCC("*****@*****.**", row["emailAddress"].ToString(), subject, mailBody);
            }
        }


        Session[Request["ModuleID"] + "ddlOrg"] = ddlOrg.SelectedValue;
        Session[Request["ModuleID"] + "Class1"] = ddlClass1.SelectedValue;
        Response.Redirect("_News_Files.aspx?ModuleID=" + Request["ModuleID"] + "&ID=" + ViewState["GUID"]);
    }
Exemplo n.º 28
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(article.Text))
        {
            My.WebForm.doJavaScript("alert('詳細說明不可以空白.');");
            return;
        }
        DateTime d = DateTime.Now;

        EasyDataProvide ModulePublish = new EasyDataProvide("ModulePublish");

        ModulePublish.SetPlaceHolderFormQuest();

        ModulePublish.AddParameter("id", ViewState["GUID"].ToString());
        ModulePublish.AddParameter("moduleID", "N02");
        ModulePublish.AddParameter("startDate", d.ToString());
        ModulePublish.AddParameter("endDate", "2800/1/1");
        string strUserData = ((FormsIdentity)(HttpContext.Current.User.Identity)).Ticket.UserData;

        ModulePublish.AddParameter("poster", strUserData);


        ModulePublish.Insert();

        EasyDataProvide ModuleContents = new EasyDataProvide("ModuleContents");

        ModuleContents.AddParameter("publishID", ViewState["GUID"].ToString());
        ModuleContents.AddParameter("article", article.Text);
        ModuleContents.Insert();



        EasyDataProvide ModuleFiles = new EasyDataProvide("ModuleFiles");

        //取得副檔名
        if (fileUrl.HasFile)
        {
            string Extension = fileUrl.FileName.Split('.')[fileUrl.FileName.Split('.').Length - 1];
            //新檔案名稱
            string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension);
            fileUrl.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Files/{0}", fileName)));
            ModuleFiles.AddParameter("fileUrl", fileName);
            ModuleFiles.AddParameter("fileName", "點我下載");


            ModuleFiles.AddParameter("publishID", ViewState["GUID"].ToString());
            //處理上傳檔案
            if (ddlFile.SelectedValue == "檔案連結")
            {
                ModuleFiles.AddParameter("fileUrl", fileUrlPath.Text);
            }

            ModuleFiles.Insert();
        }
        else if (fileUrlPath.Text != "")
        {
            ModuleFiles.AddParameter("fileName", "點我下載");


            ModuleFiles.AddParameter("publishID", ViewState["GUID"].ToString());
            //處理上傳檔案
            if (ddlFile.SelectedValue == "檔案連結")
            {
                ModuleFiles.AddParameter("fileUrl", fileUrlPath.Text);
            }

            ModuleFiles.Insert();
        }
        if (chkAlert.Checked)
        {
            EasyDataProvide Customer   = new EasyDataProvide("Customer");
            DataTable       dtCustomer = Customer.GetData("emailAddress IS NOT NULL AND emailAddress<>''");

            string subject = "【雲施團分享】" + title.Text;

            string mailBody = article.Text.Replace(@"/UploadFiles/", ConfigurationManager.AppSettings["ServerHost"] + @"/UploadFiles/");

            mailBody += "<br />發表人:" + strUserData + "|發表日期:" + d.ToShortDateString();

            mailBody += "<br /><br />文章出處:<a href='" + ConfigurationManager.AppSettings["ServerHost"] + "MemberNews_Detail.aspx?id=" + ViewState["GUID"].ToString() + "'>" + ConfigurationManager.AppSettings["ServerHost"] + "MemberNews_Detail.aspx?id=" + ViewState["GUID"].ToString() + "</a>";
            foreach (DataRow row in dtCustomer.Rows)
            {
                My.WebForm.SystemSendMailCC("*****@*****.**", row["emailAddress"].ToString(), subject, mailBody);
            }
        }



        Response.Redirect("index.aspx");
    }
Exemplo n.º 29
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        Person person = new Person();

        EasyDataProvide ModulePublish = new EasyDataProvide("ModulePublish");
        ModulePublish.SetPlaceHolderFormQuest();
        //處理上傳檔案
        if (ddlFile.SelectedValue == "檔案上傳" && fuFile.HasFile)
        {
            //取得副檔名
            string Extension = fuFile.FileName.Split('.')[fuFile.FileName.Split('.').Length - 1];
            //新檔案名稱
            string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension);
            fuFile.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Files/{0}", fileName)));
            ModulePublish.AddParameter("fileUrl", fileName);

        }

        //處理上傳圖片

        if (fuPic.HasFile)
        {
            if (fuPic.PostedFile.ContentType.IndexOf("image") == -1)
            {
                My.WebForm.doJavaScript("alert('檔案型態錯誤!');");
                return;
            }

            //取得副檔名
            string Extension = fuPic.FileName.Split('.')[fuPic.FileName.Split('.').Length - 1];
            //新檔案名稱
            string fileName = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, Extension);
            fuPic.SaveAs(Server.MapPath(String.Format("~/UploadFiles/Images/{0}", fileName)));
            My.WebForm.GenerateThumbnailImage(fileName, fuPic.PostedFile.InputStream, Server.MapPath("~/UploadFiles/Images"), "S", 69, 50);
            ModulePublish.AddParameter("picUrl", fileName);

        }

        ModulePublish.AddParameter("id", ViewState["GUID"].ToString());
        ModulePublish.AddParameter("moduleID", Request["ModuleID"]);
        ModulePublish.AddParameter("OrgID", Request["grade_id"]);
        //ModulePublish.AddParameter("OrgNames", ddlOrg.SelectedItem.Text);
        ModulePublish.AddParameter("classID", ddlClass1.SelectedValue);
        ModulePublish.AddParameter("poster", person.people_id);

        //不填結束日期時,設定一個800年後的日期
        if (string.IsNullOrEmpty(endDate.Text))
        {
            ModulePublish.AddParameter("endDate", "2800/1/1");
        }

        //if (DataLayer.IsInRole("admins", HttpContext.Current.User.Identity.Name))
        //{
        //    ModulePublish.addParameter("beSelect", "1"); //admin 群組發佈的
        //}
        ModulePublish.Insert();

        //EasyDataProvide ModuleContents = new EasyDataProvide("ModuleContents");
        //ModuleContents.AddParameter("publishID", ViewState["GUID"].ToString());
        //ModuleContents.AddParameter("article", article.Text);
        //ModuleContents.Insert();
        Session[Request["ModuleID"] + "Class1"] = ddlClass1.SelectedValue;
        Response.Redirect("Discusses_List.aspx?ModuleID=" + Request["ModuleID"] + "&ID=" + ViewState["GUID"] + "&grade_id=" + Request["grade_id"]);
    }
Exemplo n.º 30
0
 protected void UpdateButton_Click(object sender, EventArgs e)
 {
     _EmailTemplats.SetPlaceHolderFormQuest();
     _EmailTemplats.UpdateById(Request["id"]);
     Response.Redirect("EmailTemplat_List.aspx?ModuleID=" + Request["ModuleID"] + "&ID=" + ViewState["GUID"]);
 }
Exemplo n.º 31
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        string areaID = "";
        string telID = "";

        //新增或修改電話
        _telephone.AddParameter("areaCode", areaCode.Value);
        _telephone.AddParameter("numberCode", numberCode.Value);

        if (string.IsNullOrEmpty(ViewState["tel"].ToString()))
        {
            telID = _telephone.InsertReturnValue();
        }
        else
        {
            _telephone.UpdateById(ViewState["tel"].ToString());
            telID = ViewState["tel"].ToString();
        }

        //新增或修改地址
        _address.AddParameter("city", Request["city"]);
        _address.AddParameter("division", Request["division"]);
        _address.AddParameter("zip", Request["zip"]);
        _address.AddParameter("address", address.Value);
        if (string.IsNullOrEmpty(ViewState["address"].ToString()))
        {
            areaID = _address.InsertReturnValue();
        }
        else
        {
            _address.UpdateById(ViewState["address"].ToString());
            areaID = ViewState["address"].ToString();
        }

        //更新Pepole
        EasyDataProvide People = new EasyDataProvide("People");
        People.SetPlaceHolderFormQuest();
        People.AddParameter("address_id", telID);
        People.AddParameter("telephone_id", areaID);
        string Path = GetMyPath();
        string filePic = "";
        if (fuMyPhoto.HasFile)
        {
            string PicExtension = fuMyPhoto.FileName.Split('.')[fuMyPhoto.FileName.Split('.').Length - 1];
            //新檔案名稱
            filePic = String.Format("{0:yyyyMMddhhmmsss}.{1}", DateTime.Now, PicExtension);

            fuMyPhoto.SaveAs(String.Format("{0}/{1}", Path, filePic));
            My.WebForm.GenerateThumbnailImage(filePic, fuMyPhoto.PostedFile.InputStream, Path, "M", 90, 85);
            My.WebForm.GenerateThumbnailImage(filePic, fuMyPhoto.PostedFile.InputStream, Path, "S", 54, 61);

            People.AddParameter("myPhoto", filePic);
        }

        People.UpdateById((new Person()).people_id);

        //更新帳號

        _account.AddParameter("password", FormsAuthentication.HashPasswordForStoringInConfigFile(password.Text, "MD5"));
        _account.AddParameter("emailAddress", emailAddress.Text);
        _account.AddParameter("people_id", (new Person()).people_id);
        _account.UpdateById((new Person()).people_id);
        My.WebForm.doJavaScript("alert('修改成功');location.href='Person_DataEdit.aspx'");
    }