private void DGv_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int id = (int)dGv.Rows[e.RowIndex].Cells[0].Value;

            author_update_delete = db.AuthorsInfo.Find(id);
            txtName.Text         = author_update_delete.AuthorName;
            txtSurname.Text      = author_update_delete.AuthorSurname;
            CmbCity.Text         = author_update_delete.City.CityName;
            CmbCountry.Text      = author_update_delete.City.Country.CountryName;
            BtnVisible(false);
        }
예제 #2
0
 public decimal Update(AuthorsInfo pInfo)
 {
     try
     {
         Author_DA _obj_da = new Author_DA();
         return(_obj_da.Update(pInfo));
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
         return(ErrorCode.Error);
     }
 }
        private void CheckInput()
        {
            string name      = txtName.Text.Trim();
            string surname   = txtSurname.Text.Trim();
            int?   countryId = (CmbCountry.SelectedItem as ComboClass).Id;

            if (name == "" || surname == "" || countryId == null)
            {
                MessageBox.Show("Don't empty ", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else
            {
                authorInput = new AuthorsInfo {
                    AuthorName = name, AuthorSurname = surname, CityId = countryId
                };
            }
        }
예제 #4
0
 public void CreateAuthor(AuthorsDetailsInput authorInfo)
 {
     if (authorInfo.Name != null && authorInfo.Lastname != null)
     {
         var book = _regRepository.BooksDetails.Where(x => x.Id == authorInfo.BookId).FirstOrDefault();
         if (book.AuthorsInfo == null)
         {
             AuthorsInfo author = new AuthorsInfo();
             author.Name         = authorInfo.Name;
             author.Lastname     = authorInfo.Lastname;
             author.BirthCountry = authorInfo.BirthCountry;
             author.BirthDate    = authorInfo.BirthDate;
             author.DeathDate    = authorInfo.DeathDate;
             author.DateTime     = DateTime.Now;
             book.AuthorsInfo    = author;
             _regRepository.SaveChanges();
         }
     }
 }
예제 #5
0
 public decimal Update(AuthorsInfo pInfo)
 {
     try
     {
         OracleParameter paramReturn = new OracleParameter("p_return", OracleDbType.Decimal, ParameterDirection.Output);
         OracleHelper.ExecuteNonQuery(Configuration.connectionString, CommandType.StoredProcedure, "pkg_authors.proc_authors_update",
                                      new OracleParameter("p_author_id", OracleDbType.Decimal, pInfo.Author_Id, ParameterDirection.Input),
                                      new OracleParameter("p_case_code", OracleDbType.Decimal, pInfo.Case_Code, ParameterDirection.Input),
                                      new OracleParameter("p_author_name", OracleDbType.Varchar2, pInfo.Author_Name, ParameterDirection.Input),
                                      new OracleParameter("p_author_address", OracleDbType.Varchar2, pInfo.Author_Address, ParameterDirection.Input),
                                      new OracleParameter("p_author_phone", OracleDbType.Varchar2, pInfo.Author_Phone, ParameterDirection.Input),
                                      new OracleParameter("p_author_fax", OracleDbType.Varchar2, pInfo.Author_Fax, ParameterDirection.Input),
                                      new OracleParameter("p_author_email", OracleDbType.Varchar2, pInfo.Author_Email, ParameterDirection.Input),
                                      new OracleParameter("p_author_country", OracleDbType.Decimal, pInfo.Author_Country, ParameterDirection.Input),
                                      paramReturn);
         var result = Convert.ToDecimal(paramReturn.Value.ToString());
         return(result);
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
         return(ErrorCode.Error);
     }
 }