protected void Page_Load(object sender, EventArgs e) { string pagename = Path.GetFileName(Request.PhysicalPath); if (Session["admin"] != null) { string action = Request.QueryString["action"]; id = int.Parse(Request.QueryString["Questionid"]); DBFunctions db = new DBFunctions(); Support_tbl st = new Support_tbl(); st = db.loadQuestion(id); if (!IsPostBack) { SenderQuestion.Text = st.Question; answerText.Text = st.Answer; date.Text = st.Date.ToString(); } userid = st.UserID.Value; } else { Response.Redirect("Login.aspx?Redirecturl=" + pagename); } }
protected void AnswerBtn_Click(object sender, EventArgs e) { DBFunctions db = new DBFunctions(); // Program_tbl prgram = new Program_tbl { ID = id, ProgramName = ProgrammeNametxt.Text, SecondChoice = int.Parse(dropdownSecondChoise.SelectedValue), HasCampus = int.Parse(dropdownCampus.SelectedValue), ApplicationFee = txtApplicationFee.Text, FormNumber = txtFormNum.Text, ProgrameType = dropdownPrograms.SelectedValue, HasJambData = int.Parse(dropdownJamb.SelectedValue), HasBioDataSection = int.Parse(dropdownBioData.SelectedValue), HasPreviousRecord = int.Parse(dropdownPreviousRecord.SelectedValue), HasCBTSchedule = int.Parse(dropdownCbtSchedule.SelectedValue), HasOlevelResult = int.Parse(dropdownOlevel.SelectedValue), Enable = true, DeptID = int.Parse(DropDownDept.SelectedValue), CutoffPoints = Cuttofpointstxt.Text, DateCreated = DateTime.Now.Date, AcceptenceFee = txtAcceptenceFee.Text, FormCh = txtFormCh.Text }; Support_tbl answer = new Support_tbl { ID = id,UserID=userid, Question = SenderQuestion.Text, Answer=answerText.Text,Date=DateTime.Now,Status=1 }; db.updatequestion(answer); Response.Redirect("AskedQuestions.aspx"); }
protected void QuestionBtn_Click(object sender, EventArgs e) { DBFunctions db = new DBFunctions(); DatabaseFunctions d = new DatabaseFunctions(); Support_tbl spt = new Support_tbl { UserID = d.GetCandidateID(UserID), Question = SenderQuestion.Text, Date = DateTime.Now, Status = 0 }; db.addQuestion(spt); Response.Redirect("AskQuestion.aspx"); }
protected void AnswerBtn_Click(object sender, EventArgs e) { DBFunctions db = new DBFunctions(); // Program_tbl prgram = new Program_tbl { ID = id, ProgramName = ProgrammeNametxt.Text, SecondChoice = int.Parse(dropdownSecondChoise.SelectedValue), HasCampus = int.Parse(dropdownCampus.SelectedValue), ApplicationFee = txtApplicationFee.Text, FormNumber = txtFormNum.Text, ProgrameType = dropdownPrograms.SelectedValue, HasJambData = int.Parse(dropdownJamb.SelectedValue), HasBioDataSection = int.Parse(dropdownBioData.SelectedValue), HasPreviousRecord = int.Parse(dropdownPreviousRecord.SelectedValue), HasCBTSchedule = int.Parse(dropdownCbtSchedule.SelectedValue), HasOlevelResult = int.Parse(dropdownOlevel.SelectedValue), Enable = true, DeptID = int.Parse(DropDownDept.SelectedValue), CutoffPoints = Cuttofpointstxt.Text, DateCreated = DateTime.Now.Date, AcceptenceFee = txtAcceptenceFee.Text, FormCh = txtFormCh.Text }; Support_tbl answer = new Support_tbl { ID = id, UserID = userid, Question = SenderQuestion.Text, Answer = answerText.Text, Date = DateTime.Now, Status = 1 }; db.updatequestion(answer); Response.Redirect("AskedQuestions.aspx"); }
protected void Page_Load(object sender, EventArgs e) { string action = Request.QueryString["action"]; id = int.Parse(Request.QueryString["Questionid"]); if (!IsPostBack) { DBFunctions db = new DBFunctions(); Support_tbl st = new Support_tbl(); st=db.loadQuestion(id); SenderQuestion.Text = st.Question; answer.Text = st.Answer; date.Text = st.Date.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { string action = Request.QueryString["action"]; id = int.Parse(Request.QueryString["Questionid"]); if (!IsPostBack) { DBFunctions db = new DBFunctions(); Support_tbl st = new Support_tbl(); st = db.loadQuestion(id); SenderQuestion.Text = st.Question; answer.Text = st.Answer; date.Text = st.Date.ToString(); } }
protected void QuestionBtn_Click(object sender, EventArgs e) { DBFunctions db = new DBFunctions(); DatabaseFunctions d = new DatabaseFunctions(); Support_tbl spt = new Support_tbl { UserID = d.GetCandidateID(UserID), Question = SenderQuestion.Text, Date = DateTime.Now,Status=0 }; db.addQuestion(spt); Response.Redirect("AskQuestion.aspx"); }
public void addQuestion(Support_tbl DStable) { using (db = new CollegeERPDBEntities()) { db.Support_tbl.Add(DStable); db.SaveChanges(); } AdminMails_tbl mail = new AdminMails_tbl { SenderID = DStable.UserID, Message = DStable.Question + "<br><br><br><a class='btn btn-primary' href='AnswerQuestion.aspx?Questionid=" + DStable.ID + "&action=update'>Answer Question</a>", Status = 0,Date=DateTime.Now,Subject="Question" }; addadminmail(mail); }
public void updatequestion(Support_tbl ques) { db = new CollegeERPDBEntities(); db.Support_tbl.Attach(ques); // var progrm = db.Program_tbl.Where(x => x.ID == id).FirstOrDefault(); db.Entry(ques).State = EntityState.Modified; db.SaveChanges(); Mails_tbl mail = new Mails_tbl { RecieverID =ques.UserID, Date = DateTime.Now.Date, Message =ques.Answer, Status = 0, Subject = "Admin Answer" }; addmail(mail); }