Example #1
0
 public static LIB_Author GetLIB_AuthorByAuthorID(int AuthorID)
 {
     LIB_Author lIB_Author = new LIB_Author();
     SqlLIB_AuthorProvider sqlLIB_AuthorProvider = new SqlLIB_AuthorProvider();
     lIB_Author = sqlLIB_AuthorProvider.GetLIB_AuthorByAuthorID(AuthorID);
     return lIB_Author;
 }
Example #2
0
 private void showLIB_AuthorData()
 {
     LIB_Author lIB_Author  = new LIB_Author ();
      	lIB_Author = LIB_AuthorManager.GetLIB_AuthorByAuthorID(Int32.Parse(Request.QueryString["ID"]));
      	txtAuthorName.Text =lIB_Author.AuthorName.ToString();
      	txtAddress.Text =lIB_Author.Address.ToString();
      	txtEmail.Text =lIB_Author.Email.ToString();
      	txtPhone.Text =lIB_Author.Phone.ToString();
      	txtMobile.Text =lIB_Author.Mobile.ToString();
      	txtCountry.Text =lIB_Author.Country.ToString();
 }
Example #3
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
     LIB_Author lIB_Author = new LIB_Author ();
     lIB_Author.AuthorID=  int.Parse(Request.QueryString["ID"].ToString());
     lIB_Author.AuthorName=  txtAuthorName.Text;
     lIB_Author.Address=  txtAddress.Text;
     lIB_Author.Email=  txtEmail.Text;
     lIB_Author.Phone=  txtPhone.Text;
     lIB_Author.Mobile=  txtMobile.Text;
     lIB_Author.Country=  txtCountry.Text;
     lIB_Author.AddedBy=  Profile.card_id;
     lIB_Author.AddedDate=  DateTime.Now;
     lIB_Author.ModifiedBy=  Profile.card_id;
     lIB_Author.ModifiedDate=  DateTime.Now;
     bool  resutl =LIB_AuthorManager.UpdateLIB_Author(lIB_Author);
     }catch(Exception ex){}Response.Redirect("AdminDisplayLIB_Author.aspx");
 }
Example #4
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
     LIB_Author lIB_Author = new LIB_Author ();
     //	lIB_Author.AuthorID=  int.Parse(ddlAuthorID.SelectedValue);
     lIB_Author.AuthorName=  txtAuthorName.Text;
     lIB_Author.Address=  txtAddress.Text;
     lIB_Author.Email=  txtEmail.Text;
     lIB_Author.Phone=  txtPhone.Text;
     lIB_Author.Mobile=  txtMobile.Text;
     lIB_Author.Country=  txtCountry.Text;
     lIB_Author.AddedBy=  Profile.card_id;
     lIB_Author.AddedDate=  DateTime.Now;
     lIB_Author.ModifiedBy=  Profile.card_id;
     lIB_Author.ModifiedDate=  DateTime.Now;
     int resutl =LIB_AuthorManager.InsertLIB_Author(lIB_Author);
     }catch(Exception ex){}Response.Redirect("AdminDisplayLIB_Author.aspx");
 }
Example #5
0
 public static bool UpdateLIB_Author(LIB_Author lIB_Author)
 {
     SqlLIB_AuthorProvider sqlLIB_AuthorProvider = new SqlLIB_AuthorProvider();
     return sqlLIB_AuthorProvider.UpdateLIB_Author(lIB_Author);
 }
Example #6
0
 public static int InsertLIB_Author(LIB_Author lIB_Author)
 {
     SqlLIB_AuthorProvider sqlLIB_AuthorProvider = new SqlLIB_AuthorProvider();
     return sqlLIB_AuthorProvider.InsertLIB_Author(lIB_Author);
 }
Example #7
0
    public bool UpdateLIB_Author(LIB_Author lIB_Author)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("UpdateLIB_Author", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@AuthorID", SqlDbType.Int).Value = lIB_Author.AuthorID;
            cmd.Parameters.Add("@AuthorName", SqlDbType.NVarChar).Value = lIB_Author.AuthorName;
            cmd.Parameters.Add("@Address", SqlDbType.NVarChar).Value = lIB_Author.Address;
            cmd.Parameters.Add("@Email", SqlDbType.NVarChar).Value = lIB_Author.Email;
            cmd.Parameters.Add("@Phone", SqlDbType.NVarChar).Value = lIB_Author.Phone;
            cmd.Parameters.Add("@Mobile", SqlDbType.NVarChar).Value = lIB_Author.Mobile;
            cmd.Parameters.Add("@Country", SqlDbType.NVarChar).Value = lIB_Author.Country;
            cmd.Parameters.Add("@ModifiedBy", SqlDbType.NVarChar).Value = lIB_Author.ModifiedBy;
            cmd.Parameters.Add("@ModifiedDate", SqlDbType.DateTime).Value = lIB_Author.ModifiedDate;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return result == 1;
        }
    }
Example #8
0
    public LIB_Author GetLIB_AuthorFromReader(IDataReader reader)
    {
        try
        {
            LIB_Author lIB_Author = new LIB_Author
                (

                     DataAccessObject.IsNULL<int>(reader["AuthorID"]),
                     DataAccessObject.IsNULL<string>(reader["AuthorName"]),
                     DataAccessObject.IsNULL<string>(reader["Address"]),
                     DataAccessObject.IsNULL<string>(reader["Email"]),
                     DataAccessObject.IsNULL<string>(reader["Phone"]),
                     DataAccessObject.IsNULL<string>(reader["Mobile"]),
                     DataAccessObject.IsNULL<string>(reader["Country"]),
                     DataAccessObject.IsNULL<string>(reader["AddedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["AddedDate"]),
                     DataAccessObject.IsNULL<string>(reader["ModifiedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["ModifiedDate"])
                );
             return lIB_Author;
        }
        catch(Exception ex)
        {
            return null;
        }
    }