//刪除 public ActionResult DeleteCard(string Name) { DBmessage dBmessage = new DBmessage(); dBmessage.DeletrCardByName(Name); return(RedirectToAction("Index")); }
public DBmessage UpdateVerifyAccount(int UserID, int VerifyAccount) { SqlConnection newcon = new SqlConnection(DBMan.EsamConnection); SqlCommand newcmd = new SqlCommand("UserUpdateVirifyAccount", newcon); newcmd.CommandType = CommandType.StoredProcedure; SqlParameter _UserID = new SqlParameter("@UserID", SqlDbType.Int); DBMan.SetParameterValue(_UserID, UserID); SqlParameter _VerifyAccount = new SqlParameter("@VerifyAccount", SqlDbType.Int); DBMan.SetParameterValue(_VerifyAccount, VerifyAccount); newcmd.Parameters.Add(_UserID); newcmd.Parameters.Add(_VerifyAccount); newcmd.Parameters.Add(DBMan.RetunParam); newcon.Open(); newcmd.ExecuteNonQuery(); newcon.Close(); DBmessage ResultMessage = new DBmessage(Convert.ToInt32(newcmd.Parameters[DBMan.ReturnValue].Value)); return(ResultMessage); }
protected void btnStep3_Click(object sender, EventArgs e) { DBmessage dbm = new DBmessage(DBMessageType.Error, SystemMessage_DBMessage.NotRegisterOnePersonFullInfo); PaperInfoMan_Business paperInfoMan = new PaperInfoMan_Business(); List<PaperWriter> paperWriters = new List<PaperWriter>(); string[] names = hfFirstName.Value.Split(','); string[] lastnames = hflastName.Value.Split(','); string[] incharge = hfIncharge.Value.Split(','); for (int i = 0; i < names.Length - 1; i++) { if (names[i] != string.Empty && lastnames[i] != string.Empty) paperWriters.Add(new PaperWriter() { Fname = names[i], Lname = lastnames[i], Responsibility = new PaperWriterResponsibility(Resposibility(incharge[i])) }); } int paperID = System.Convert.ToInt32(FormBase.UrlDecode(Request[RequestMSG.PaperID])); if (paperWriters.Count > 0) dbm = paperInfoMan.ReviseByAuthor_Step2(paperWriters, paperID); if (dbm.Type == DBMessageType.Sucsess) { FormBase.SendRequest(ServerDirectory.Paper + "/ReviseByAuthor_Step3.aspx", new string[] { RequestMSG.PaperID }, new string[] { paperID.ToString() }); } else ShowNotify(dbm); }
protected void btnFinish_Click(object sender, EventArgs e) { string[] names = hfFirstName.Value.Split(','); string[] lastnames = hflastName.Value.Split(','); string[] mails = hfEmail.Value.Split(','); PaperInfoMan_Business paperInfoMan = new PaperInfoMan_Business(); List <User_cls> referees = new List <User_cls>(); for (int i = 0; i < names.Length - 1; i++) { if (names[i] != string.Empty && lastnames[i] != string.Empty && mails[i] != string.Empty) { referees.Add(new User_cls() { Fname = names[i], Lname = lastnames[i], Email = mails[i] }); } } int paperID = System.Convert.ToInt32(FormBase.UrlDecode(Request[RequestMSG.SubmitOnline])); DBmessage dbm = paperInfoMan.RegisterPaper_Step4(referees, paperID); if (dbm.Type == DBMessageType.Sucsess) { FormBase.SendRequest(ServerDirectory.Paper + "/PaperListAuthor.aspx", new string[] { RequestMSG.Msg, RequestMSG.Type }, new string[] { dbm.Message, dbm.Type.ToString() }); } else { ShowNotify(dbm); } }
//更新 public ActionResult EdidCard(int id) { DBmessage dBmessage = new DBmessage(); Card card = dBmessage.GetCardsById(id); return(View(card)); }
protected void btnChangePassword_Click(object sender, EventArgs e) { UserInfoMan_Business userInfoMan = new UserInfoMan_Business(); DBmessage dbm = userInfoMan.ChangePassWordByUser(txtbOldPassWord.Text, txtbNewPass.Text); ShowNotify(dbm); }
//return content public ActionResult HelloContent(string hi) { ViewData["data"] = "Hello world"; DBmessage dBmessage = new DBmessage(); return(Content("eqwiofhuiwenj")); }
protected void btnChangeAvatar_Click(object sender, EventArgs e) { try { HttpPostedFile Avatar = fuAvatar.PostedFile; string[] validType = { ".jpg", ".jpeg", ".png", ".bmp", ".gif" }; byte[] userImage = null; if (Avatar != null) { userImage = FileOperations.getFile(Avatar, ServerDirectory.UploadPhysical, validType); } else if (ViewState[RequestMSG.UserImage] != null) { userImage = (byte[])ViewState[RequestMSG.UserImage]; } // UserInfoMan_Business userInfoMan = new UserInfoMan_Business(); DBmessage dbm = userInfoMan.EditUserProfileImage(userImage); ShowNotify(dbm); } catch (MyException ex) { ShowNotify(ex); } catch (Exception ex) { ShowNotify(ex); } }
protected void btnUserRegister_Click(object sender, EventArgs e) { UserInfoMan_Business userInfoMan = new UserInfoMan_Business(); DBmessage dbm = userInfoMan.RegisterAuthor(txtbName.Text, txtbLastName.Text, txtbAffiliations.Text, txtbPhoneNumber.Text, txtbFax.Text, txtbEmail.Text, txtbNationalCode.Text , txtbFieldsOfInterest.Text, txtbBirthDate.Text, txtbEducation.Text, Convert.ToInt32(ddlGender.SelectedValue)); ShowNotify(dbm); }
public ActionResult CheckboxGet(Card card) { DBmessage dBmessage = new DBmessage(); dBmessage.UpDataSchedule(card); return(RedirectToAction("Index")); }
public ActionResult EdidCard(Card card) { DBmessage dBmessage = new DBmessage(); dBmessage.UpDataCard(card); return(RedirectToAction("Index")); }
//查詢 public ActionResult Index() { DBmessage dBmessage = new DBmessage(); List <Card> cards = dBmessage.GetCards(); ViewBag.cards = cards; return(View()); }
protected void btnRejectByChefEditor_Click(object sender, EventArgs e) { int paperID = Convert.ToInt32(Request[RequestMSG.ID]); PaperInfoMan_Business paperInfoMan = new PaperInfoMan_Business(); DBmessage dbm = paperInfoMan.RejectByChefEditor(paperID); ShowNotify(dbm); }
protected void btnEditPassword_Click(object sender, EventArgs e) { int userID = Convert.ToInt32(Request[RequestMSG.UsrID]); UserInfoMan_Business userInfoMan = new UserInfoMan_Business(); DBmessage dbm = userInfoMan.ChangePassWordByAdmin(userID, txtbPass.Text); ShowNotify(dbm); }
protected void btnRevise_Click(object sender, EventArgs e) { int paperID = Convert.ToInt32(Request[RequestMSG.ID]); PaperInfoMan_Business paperInfoMan = new PaperInfoMan_Business(); DBmessage msg = paperInfoMan.ReviseByEditor(paperID, txtbReviseComment.InnerText); ShowNotify(msg); }
public ActionResult EdidCard(string id, string name) { DBmessage dBmessage = new DBmessage(); dBmessage.EditCardFunction(id, name); return(RedirectToAction("Index")); }
protected void btnAcceptByChefEditor_Click(object sender, EventArgs e) { int paperID = Convert.ToInt32(Request[RequestMSG.ID]); PaperInfoMan_Business paperInfoMan = new PaperInfoMan_Business(); DBmessage dbm = paperInfoMan.AcceptByChefEditor(paperID, Convert.ToInt32(ddlEvaluationForm.SelectedValue)); FillInfo(); ShowNotify(dbm); }
protected void btnRoleRegister_Click(object sender, EventArgs e) { int userID = Convert.ToInt32(Session[RequestMSG.UsrID]); UserInfoMan_Business userInfoMan = new UserInfoMan_Business(); DBmessage dbm = userInfoMan.RegisterRole(userID, chbCheffEditor.Checked, chbEditor.Checked, chbAuthor.Checked, chbReferee.Checked, chbLanguageEditor.Checked, chbSyntaxEditor.Checked); ShowNotify(dbm); }
protected void btnAcceptArbitration_Click(object sender, EventArgs e) { int paperID = Convert.ToInt32(Request[RequestMSG.ID]); PaperInfoMan_Business paperInfoMan = new PaperInfoMan_Business(); DBmessage dbm = paperInfoMan.AcceptByReferee(paperID); FillInfo(); ShowNotify(dbm); }
protected void btnFinalApproval_Click(object sender, EventArgs e) { int paperID = Convert.ToInt32(Request[RequestMSG.ID]); PaperInfoMan_Business paperInfoMan = new PaperInfoMan_Business(); DBmessage dbm = paperInfoMan.TechnicalApproval(paperID); ShowNotify(dbm); FillInfo(); }
public DBmessage RegisterUser(User_cls user) { User_cls_Service servic = new User_cls_Service(); DBmessage result = servic.Register(user); if (result.Type == DBMessageType.Sucsess) { result.Parameter["UserID"] = user.UserID; } return(result); }
public DBmessage Register(User_cls user) { SqlConnection newcon = new SqlConnection(DBMan.EsamConnection); SqlCommand newcmd = new SqlCommand("UserRegister", newcon); newcmd.CommandType = CommandType.StoredProcedure; SqlParameter _userid = new SqlParameter("@UsrID", SqlDbType.Int); _userid.Direction = ParameterDirection.Output; SqlParameter _username = new SqlParameter("@UserName", SqlDbType.NVarChar, 100); DBMan.SetParameterValue(_username, user.Username); SqlParameter _password = new SqlParameter("@Password", SqlDbType.NVarChar, 100); DBMan.SetParameterValue(_password, user.Password); SqlParameter _name = new SqlParameter("@Fname", SqlDbType.NVarChar, 50); DBMan.SetParameterValue(_name, user.Fname); SqlParameter _family = new SqlParameter("@Lname", SqlDbType.NVarChar, 50); DBMan.SetParameterValue(_family, user.Lname); SqlParameter _email = new SqlParameter("@Email", SqlDbType.VarChar, 50); DBMan.SetParameterValue(_email, user.Email); //SqlParameter _CreateBy = new SqlParameter("@CreateBy", SqlDbType.Int); //DBMan.SetParameterValue(_CreateBy, user.CreateBy); newcmd.Parameters.Add(_userid); newcmd.Parameters.Add(_username); newcmd.Parameters.Add(_password); newcmd.Parameters.Add(_name); newcmd.Parameters.Add(_family); newcmd.Parameters.Add(_email); //newcmd.Parameters.Add(_CreateBy); newcmd.Parameters.Add(DBMan.RetunParam); newcon.Open(); newcmd.ExecuteNonQuery(); newcon.Close(); user.UserID = Convert.ToInt32(newcmd.Parameters[_userid.ParameterName].Value); DBmessage ResultMessage = new DBmessage(Convert.ToInt32(newcmd.Parameters[DBMan.ReturnValue].Value)); return(ResultMessage); }
public ActionResult CreateCard(Card card) { DBmessage dbmessage = new DBmessage(); try { dbmessage.NewCard(card); } catch (Exception e) { Console.WriteLine(e.ToString()); } return(RedirectToAction("Index")); }
protected void Submit_Click(object sender, EventArgs e) { int paperID = Convert.ToInt32(Request[RequestMSG.PaperID]); string[] OptionalQuestionsAnswer = hfOptions.Value.Split(','); string[] temp; for (int i = 0; i < evaluation.Count; i++) { if (evaluation[i] is WrittenQuestions) { WrittenQuestions written = (WrittenQuestions)evaluation[i]; written.Answertext = Request.Form["writtenAnswer" + i]; } else if (evaluation[i] is NumericQuestion) { NumericQuestion numeric = (NumericQuestion)evaluation[i]; numeric.Score = Convert.ToInt32(Request.Form["numericAnswer" + i]); } else if (evaluation[i] is Multiple_ChoiceQuestions) { Multiple_ChoiceQuestions optional = (Multiple_ChoiceQuestions)evaluation[i]; bool ExistOption = false; for (int j = 0; j < OptionalQuestionsAnswer.Length; j++) { temp = OptionalQuestionsAnswer[j].Split('_'); if (temp[0] == i.ToString()) { ExistOption = optional.SelectAnswerItem(Convert.ToInt32(temp[1])); if (!ExistOption) { throw new MyException(QuestionEvaluation_Message.SuchAnOptionIsNotAvailable, 101, ""); } ExistOption = false; } } } } PaperInfoMan_Business paperInfoMan = new PaperInfoMan_Business(); List <string> files = new List <string>(); DBmessage dbm = paperInfoMan.SetPointToPaperByReferee(paperID, files, evaluation); if (dbm.Type == DBMessageType.Sucsess) { Response.Redirect(ServerDirectory.Paper + "/PaperInformation.aspx?" + RequestMSG.ID + "=" + paperID); } else { ShowNotify(dbm); } }
protected void btnStep2_Click(object sender, EventArgs e) { int paperID = Convert.ToInt32(Request[RequestMSG.PaperID]); PaperInfoMan_Business paperInfoMan = new PaperInfoMan_Business(); DBmessage dbm = paperInfoMan.ReviseByAuthor_Step1(paperID, txtbAbstract.Text, txtbKeyWord.Text, txtbFeildPaper.Text); if (dbm.Type == DBMessageType.Sucsess) { FormBase.SendRequest(ServerDirectory.Paper + "/ReviseByAuthor_Step2.aspx", new string[] { RequestMSG.PaperID }, new string[] { paperID.ToString() }); } else { ShowNotify(dbm); } }
protected void btnStep2_Click(object sender, EventArgs e) { PaperInfoMan_Business paperInfoMan = new PaperInfoMan_Business(); DBmessage dbm = paperInfoMan.RegisterPaper_Step1(txtbTitle.Text, txtbAbstract.Text, txtbKeyWord.Text, txtbFeildPaper.Text); Paper paper = (Paper)dbm.Parameter["paper"]; if (dbm.Type == DBMessageType.Sucsess) { FormBase.SendRequest(ServerDirectory.Paper + "/SubmitOnline_Step2.aspx", new string[] { RequestMSG.SubmitOnline }, new string[] { paper.ID.ToString() }); } else { ShowNotify(dbm); } }
protected void Page_Load(object sender, EventArgs e) { AuthorVerification(); FillGridView(); if(Request[RequestMSG.Msg] != null && Request[RequestMSG.Msg] != string.Empty && Request[RequestMSG.Type] != null && Request[RequestMSG.Type] != string.Empty) { DBMessageType type = DBMessageType.NoShow; if (DBMessageType.Sucsess.ToString() == FormBase.UrlDecode(Request[RequestMSG.Type].ToString())) type = DBMessageType.Sucsess; if (DBMessageType.Error.ToString() == FormBase.UrlDecode(Request[RequestMSG.Type].ToString())) type = DBMessageType.Error; DBmessage dbm = new DBmessage(type, FormBase.UrlDecode(Request[RequestMSG.Msg].ToString())); ShowNotify(dbm); } }
protected void btnUserEdit_Click(object sender, EventArgs e) { int userID = Convert.ToInt32(Request[RequestMSG.UsrID]); UserInfoMan_Business userInfoMan = new UserInfoMan_Business(); DBmessage dbm = userInfoMan.EditUser(userID, txtbEmail.Text, txtbName.Text, txtbLastName.Text, txtbAffiliations.Text, txtbPhoneNumber.Text, txtbFax.Text, txtbNationalCode.Text, txtbFieldsOfInterest.Text, txtbBirthDate.Text, txtbEducation.Text, Convert.ToInt32(ddlGender.SelectedValue)); if (dbm.Type == DBMessageType.Sucsess) { Response.Redirect(ServerDirectory.User + "/UserEdit_Step2.aspx?" + RequestMSG.UsrID + "=" + userID); } else { ShowNotify(dbm); } }
protected void btnUserRegister_Click(object sender, EventArgs e) { UserInfoMan_Business userInfoMan = new UserInfoMan_Business(); DBmessage dbm = userInfoMan.RegisterUser(txtbName.Text, txtbLastName.Text, txtbAffiliations.Text, txtbPhoneNumber.Text, txtbFax.Text, txtbEmail.Text, txtbNationalCode.Text, txtbFieldsOfInterest.Text, txtbBirthDate.Text, txtbEducation.Text, Convert.ToInt32(ddlGender.SelectedValue)); if (dbm.Type == DBMessageType.Sucsess) { Session[RequestMSG.UsrID] = dbm.Parameter[RequestMSG.UsrID]; Response.Redirect(ServerDirectory.User + "/UserRegistration_Step2.aspx"); } else { ShowNotify(dbm); } }
protected void lnkbDelete_Click(object sender, EventArgs e) { int paperID = Convert.ToInt32(Request[RequestMSG.ID]); LinkButton lnkb = (LinkButton)sender; int refereeID = 0; if (lnkb != null) { refereeID = Convert.ToInt32(lnkb.CommandArgument); } PaperInfoMan_Business paperInfoMan = new PaperInfoMan_Business(); DBmessage dbm = paperInfoMan.RemoveReferee(paperID, refereeID); ShowNotify(dbm); FillInfo(); }
protected void btnStep3_Click(object sender, EventArgs e) { try { DBmessage dbm = new DBmessage(DBMessageType.Error, SystemMessage_DBMessage.NotRegisterOnePersonFullInfo); PaperInfoMan_Business paperInfoMan = new PaperInfoMan_Business(); List <PaperWriter> paperWriters = new List <PaperWriter>(); string[] names = hfFirstName.Value.Split(','); string[] lastnames = hflastName.Value.Split(','); string[] incharge = hfIncharge.Value.Split(','); for (int i = 0; i < names.Length - 1; i++) { if (names[i] != string.Empty && lastnames[i] != string.Empty) { paperWriters.Add(new PaperWriter() { Fname = names[i], Lname = lastnames[i], Responsibility = new PaperWriterResponsibility(Resposibility(incharge[i])) }); } } int paperID = System.Convert.ToInt32(FormBase.UrlDecode(Request[RequestMSG.SubmitOnline])); if (paperWriters.Count > 0) { dbm = paperInfoMan.RegisterPaper_Step2(paperWriters, paperID); } if (dbm.Type == DBMessageType.Sucsess) { FormBase.SendRequest(ServerDirectory.Paper + "/SubmitOnline_Step3.aspx", new string[] { RequestMSG.SubmitOnline }, new string[] { paperID.ToString() }); } else { ShowNotify(dbm); } } catch (MyException myEx) { ShowNotify(myEx); } catch (Exception ex) { ShowNotify(ex); } }
public ActionResult signup(CustomRegModel model) { TempData["JS"] = null; if (!ModelState.IsValid) { return(RedirectToAction("signup")); } UserInfoMan_Logic logic = new UserInfoMan_Logic(); User_cls user; userauthorizeMan_Logic userauthorize = new userauthorizeMan_Logic(); userauthorize.Logoutwithoutredirect(); user = Convert(model); DBmessage resultuserregister = logic.RegisterUser(user); if (resultuserregister.Type == DBMessageType.Sucsess) { user.UserID = (int)resultuserregister.Parameter[0]; if (user.UserID != 0) { TempData["uid"] = user.UserID.ToString(); return(RedirectToAction("confirm")); } //else //{ // //Error Message... // //return RedirectToAction("confirm"); //} } else { TempData["JS"] = resultuserregister.Message; return(RedirectToAction("signup")); } return(RedirectToAction("signup")); }