private Faq ReceiveHtml() { Faq faq = new Faq(); faq.FaqID = (hddFaqID.Value != "") ? Convert.ToInt32(hddFaqID.Value) : 0; faq.Question = txtQuestion.Text; faq.Answer = txtRadAnswer.Html; faq.PostDate = txtRadPostDate.SelectedDate.Value; faq.Status = Convert.ToBoolean(rdbStatus.SelectedValue); faq.Language = Language.language; return faq; }
private ETO.Faq ReceiveHtml() { ETO.Faq faq = new ETO.Faq(); faq.Name = txt_TennguoiDung.Value; faq.Question = ttr_NoiDung.Value; faq.Answer = ""; faq.PostDate = DateTime.Now; faq.Status = true; faq.Language = Language.language; faq.Email = txt_Email.Value; return faq; }
public void CreateFaq(Faq faq) { using (SqlConnection connection = base.GetConnection()) { SqlCommand command = new SqlCommand("_FaqUpdate", connection) { CommandType = CommandType.StoredProcedure }; command.Parameters.AddWithValue("@Type", 0); command.Parameters.AddWithValue("@FaqID", 0); command.Parameters.AddWithValue("@Question", faq.Question); command.Parameters.AddWithValue("@Answer", faq.Answer); command.Parameters.AddWithValue("@PostDate", faq.PostDate); command.Parameters.AddWithValue("@Status", faq.Status); command.Parameters.AddWithValue("@Language",faq.Language); connection.Open(); if (command.ExecuteNonQuery() <= 0) { throw new DataAccessException("Khong them moi duoc faq"); } command.Dispose(); } }
public void CreateFaq(Faq faq) { new FaqDAO().CreateFaq(faq); }
public void UpdateFaq(Faq faq) { new FaqDAO().UpdateFaq(faq); }