protected void btnSubmit_Click(object sender, EventArgs e) { if (Session["UserCode"] == null) { msg.MessageTextMode = AKP.Web.Controls.Common.MessageMode.Error; msg.Text = "برای ارسال پرسش لازم است ابتدا در سایت عضو شوید"; return; } string Question = txtQuestion.Text; if (string.IsNullOrEmpty(Question)) { msg.MessageTextMode = AKP.Web.Controls.Common.MessageMode.Error; msg.Text = "لطفا سوال را وارد کنید"; return; } int UserCode = Convert.ToInt32(Session["UserCode"]); BOLQuestions QuestionsBOL = new BOLQuestions(); bool Result = QuestionsBOL.Insert(Question, UserCode); if (Result) { msg.MessageTextMode = AKP.Web.Controls.Common.MessageMode.OK; msg.Text = "سوال شما با موفقیت ثبت شد"; } else { msg.MessageTextMode = AKP.Web.Controls.Common.MessageMode.Error; msg.Text = "بروز خطا در ثبت سوال"; } }
protected void Page_Load(object sender, EventArgs e) { #region Tab Pages //if (!NewMode) // ShowDetails(); //else //{ // RadMultiPage1.SelectedIndex = 0; // tsQuestions.Tabs[0].Selected = true; //} #endregion BOLClass = new BOLQuestions(); lblSysName.Text = BOLClass.PageLable; if ((Code == null) && (!NewMode)) { return; } if (!Page.IsPostBack) { //if (!NewMode) ShowDetails(); #region Fill Combo cboHCQuestionStatusCode.DataSource = new BOLHardCode().GetHCDataTable("HCQuestionStatuses"); #endregion if (!NewMode) { LoadData((int)Code); } } }
protected void Page_Load(object sender, EventArgs e) { BOLQuestions QuestionsBOL = new BOLQuestions(); rptQuestions.DataSource = QuestionsBOL.GetQuestions(); rptQuestions.DataBind(); }