示例#1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string act = Request.QueryString["act"];

            BLibraryPro.Author BAuthor = new BLibraryPro.Author();
            BAuthor.FirstName = txtFirstName.Text;
            BAuthor.MiddleName = txtMiddleName.Text;
            BAuthor.LastName = txtLastName.Text;
            BAuthor.CountryCode = txtCountryCode.Text;

            if (act == "add")
            {
                string authorId = "";
                if (UseExistingAuthor.Checked)
                {
                    authorId = ddlAuthor.SelectedValue.ToString();
                    Response.Redirect("~/GUI/Setup/BookLot.aspx?act=add&BookId=" + hdnBookId.Value.ToString() + "&AuthorId=" + authorId);
                }
                else
                {
                    authorId = BAuthor.SaveAuthor();
                    Response.Redirect("~/GUI/Setup/BookLot.aspx?act=add&BookId=" + hdnBookId.Value.ToString() + "&AuthorId=" + authorId);
                }

            }
            else if (act == "edit")
            {
                BAuthor.AuthorCode = Request.QueryString["code"];
                msgBox.Message = BAuthor.UpdateAuthor();

            }
            else if (act == "del")
            {
                BAuthor.AuthorCode = Request.QueryString["code"];
                msgBox.Message = BAuthor.DeleteAuthor();
            }
            Response.Redirect("~/GUI/Setup/Author.aspx?act=list");
        }