public ActionResult Update() { getAllLists obj = new getAllLists(); ViewBag.Cities = obj.getCities(); ViewBag.Countaries = obj.getCountaries(); ViewBag.Degrees = obj.getDegrees(); ViewBag.Institutes = obj.getInstitutes(); BasicInfo b = new BasicInfo(); ExpInfo e1 = new ExpInfo(); ExtraInfo e2 = new ExtraInfo(); ViewBag.isBasicInfoExist = b.isBasicInfoFound(uid); if (ViewBag.isBasicInfoExist) { ViewBag.allBasicInfo = b.getBasicInfo(uid); } ViewBag.isExpInfoExist = e1.isExpInfoFound(uid); if (ViewBag.isExpInfoExist) { ViewBag.allExpInfo = e1.getExpInfo(uid); ViewBag.allPreExp = e1.getPreviousHistory(uid); } ViewBag.isExtraInfoExist = e2.isExtraInfoFound(uid); if (ViewBag.isExtraInfoExist) { ViewBag.allExraInfo = e2.getExtraInfo(uid); } UserInfo u = new UserInfo(); ViewBag.UserInfo = u.getUserInfo(uid); return(View()); }
public ActionResult Expinfo() { string skills = Request["skills"]; int minsalary = Convert.ToInt32(Request["minsalary"]); string expsum = Request["expsum"]; string expyrs = Request["expyrs"]; string cemployer = Request["currentemp"]; string cdes = Request["currentdes"]; string expcorg = Request["exporg"]; string respcjob = Request["respcjob"]; string prevemp = Request["prevemp"]; string prevdes = Request["prevdes"]; string prevexporg = Request["prevexporg"]; string respprevjob = Request["respprevjob"]; string date = Request["dolj"]; DateTime dolj = Convert.ToDateTime(date); ExpInfo obj = new ExpInfo(); obj.addExpInfo(skills, minsalary, expsum, expyrs, cemployer, cdes, expcorg, respcjob, 1, prevemp, prevdes, prevexporg, respprevjob, dolj); getAllLists obj2 = new getAllLists(); ViewBag.Cities = obj2.getCities(); ViewBag.Countaries = obj2.getCountaries(); ViewBag.Degrees = obj2.getDegrees(); ViewBag.Institutes = obj2.getInstitutes(); return(View("Create")); }
public ActionResult UpdateExpinfo() { JobResumeExp er = new JobResumeExp(); er.skills = Request["skills"]; er.minsalary = Convert.ToInt32(Request["minsalary"]); er.expsummary = Request["expsum"]; er.expyrs = Request["expyrs"]; er.cemployer = Request["currentemp"]; er.cdes = Request["currentdes"]; er.expcorg = Request["exporg"]; er.rescjob = Request["respcjob"]; er.userId = uid; PreviousHistory ph = new PreviousHistory(); ph.pemployer = Request["prevemp"]; ph.pdes = Request["prevdes"]; ph.expporg = Request["prevexporg"]; ph.resppjob = Request["respprevjob"]; string date = Request["dolj"]; ph.dateofleaving = Convert.ToDateTime(date); ph.userid = uid; ExpInfo obj = new ExpInfo(); obj.updateExpInfo(er, ph); getAllLists obj2 = new getAllLists(); ViewBag.Cities = obj2.getCities(); ViewBag.Countaries = obj2.getCountaries(); ViewBag.Degrees = obj2.getDegrees(); ViewBag.Institutes = obj2.getInstitutes(); BasicInfo b = new BasicInfo(); ExpInfo e1 = new ExpInfo(); ExtraInfo e2 = new ExtraInfo(); ViewBag.isBasicInfoExist = b.isBasicInfoFound(uid); if (ViewBag.isBasicInfoExist) { ViewBag.allBasicInfo = b.getBasicInfo(uid); } ViewBag.isExpInfoExist = e1.isExpInfoFound(uid); if (ViewBag.isExpInfoExist) { ViewBag.allExpInfo = e1.getExpInfo(uid); ViewBag.allPreExp = e1.getPreviousHistory(uid); } ViewBag.isExtraInfoExist = e2.isExtraInfoFound(uid); if (ViewBag.isExtraInfoExist) { ViewBag.allExraInfo = e2.getExtraInfo(uid); } UserInfo u = new UserInfo(); ViewBag.UserInfo = u.getUserInfo(uid); return(View("Update")); }
public ActionResult DeleteConfirmed(int id) { ExpInfo expInfo = DataManager.expInfoContextDb.ExpInfoes.Find(id); DataManager.expInfoContextDb.ExpInfoes.Remove(expInfo); DataManager.expInfoContextDb.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ExpNo,StartTime,EndTime,ExpResultCount,Status")] ExpInfo expInfo) { if (ModelState.IsValid) { DataManager.expInfoContextDb.Entry(expInfo).State = EntityState.Modified; DataManager.expInfoContextDb.SaveChanges(); return(RedirectToAction("Index")); } return(View(expInfo)); }
public ActionResult Create([Bind(Include = "ExpNo,StartTime,EndTime,ExpResultCount,Status")] ExpInfo expInfo) { if (ModelState.IsValid) { DataManager.expInfoContextDb.ExpInfoes.Add(expInfo); DataManager.expInfoContextDb.SaveChanges(); return(RedirectToAction("Index")); } return(View(expInfo)); }
private ExpInfo AddExpInfo(ExpInfo expInfo) { ExpInfo result = null; if (ModelState.IsValid) { result = DataManager.expInfoContextDb.ExpInfoes.Add(expInfo); DataManager.expInfoContextDb.SaveChanges(); } return(result); }
public int CalculateLevel(UInt64 totalExp, int maxLevel, out UInt64 remainExp, out UInt64 nextExp) { int level = 1; UInt64 remainTotalExp = totalExp; ExpInfo row = null; nextExp = 0; for ( ; level <= maxLevel; level++) { if (setting.ContainsKey(level)) { row = setting[level]; } if (row != null) { nextExp = (UInt64)(row.needExp + (row.levelCoefficient * level)); if (nextExp <= 0) { continue; } if (setting[level].repeat) { // 繰り返し設定が見つかったらその設定でループ計算して終了 while (remainTotalExp >= nextExp) { if (maxLevel <= level) { break; } remainTotalExp -= nextExp; level++; nextExp = (UInt64)(row.needExp + (row.levelCoefficient * level)); } break; // finish for loop } else { if (remainTotalExp >= nextExp) { remainTotalExp -= nextExp; } else { break; // finish for loop } } } } remainExp = remainTotalExp; return(level); }
public ActionResult UpdateExtrainfo() { JobResumeExtra er = new JobResumeExtra(); er.extraactivities = Request["extraact"]; er.otherinterests = Request["othrint"]; er.namep1 = Request["refperson1"]; er.affp1 = Request["affperson1"]; er.php1 = Request["phref1"]; er.emailp1 = Request["refemail1"]; er.namep2 = Request["refperson2"]; er.affp2 = Request["affperson2"]; er.php2 = Request["phref2"]; er.emailp2 = Request["refemail2"]; er.userId = uid; ExtraInfo obj = new ExtraInfo(); obj.updateExtraInfo(er); getAllLists obj3 = new getAllLists(); ViewBag.Cities = obj3.getCities(); ViewBag.Countaries = obj3.getCountaries(); ViewBag.Degrees = obj3.getDegrees(); ViewBag.Institutes = obj3.getInstitutes(); BasicInfo b = new BasicInfo(); ExpInfo e1 = new ExpInfo(); ExtraInfo e2 = new ExtraInfo(); ViewBag.isBasicInfoExist = b.isBasicInfoFound(uid); if (ViewBag.isBasicInfoExist) { ViewBag.allBasicInfo = b.getBasicInfo(uid); } ViewBag.isExpInfoExist = e1.isExpInfoFound(uid); if (ViewBag.isExpInfoExist) { ViewBag.allExpInfo = e1.getExpInfo(uid); ViewBag.allPreExp = e1.getPreviousHistory(uid); } ViewBag.isExtraInfoExist = e2.isExtraInfoFound(uid); if (ViewBag.isExtraInfoExist) { ViewBag.allExraInfo = e2.getExtraInfo(uid); } UserInfo u = new UserInfo(); ViewBag.UserInfo = u.getUserInfo(uid); return(View("Update")); }
// GET: ExpInfo/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ExpInfo expInfo = DataManager.expInfoContextDb.ExpInfoes.Find(id); if (expInfo == null) { return(HttpNotFound()); } return(View(expInfo)); }
// GET: ExpInfo/Chart/5 public ActionResult Chart(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ExpInfo expInfo = DataManager.expInfoContextDb.ExpInfoes.Find(id); if (expInfo == null) { return(HttpNotFound()); } IEnumerable <ExpInfoDetail> list = DataManager.expInfoDetailContext.ExpInfoDetails.ToList().Where(detail => detail.ExpNo == id.Value); list = list.OrderBy(o => o.CollectedTime).ToList(); if (list == null || list.Count() <= 0) { return(View(new List <ExpInfoDetail>())); } return(View(list)); }
// GET: Resume public ActionResult Create() { getAllLists obj = new getAllLists(); ViewBag.Cities = obj.getCities(); ViewBag.Countaries = obj.getCountaries(); ViewBag.Degrees = obj.getDegrees(); ViewBag.Institutes = obj.getInstitutes(); BasicInfo b = new BasicInfo(); ExpInfo e1 = new ExpInfo(); ExtraInfo e2 = new ExtraInfo(); ViewBag.isBasicInfoExist = b.isBasicInfoFound(uid); ViewBag.isExpInfoExist = e1.isExpInfoFound(uid); ViewBag.isExtraInfoExist = e2.isExtraInfoFound(uid); UserInfo u = new UserInfo(); ViewBag.UserInfo = u.getUserInfo(uid); return(View()); }
public static void Initialize() { ExpList = new DataHash(); using (var sr = new StreamReader(@"ExpList.csv")) { string[] header = null; while (!sr.EndOfStream) { // 1行を読み込む string line = sr.ReadLine(); // タブで区切る var temp = line.Split(','); if (temp.Length < 23) { continue; } // ヘッダー行かどうかを判別する if (temp[0] == "No.") { // ヘッダー行なので記憶しておく header = temp; } else { // データ行なのでデータを生成しつつ代入する string key = temp[0]; var temp2 = new ExpInfo(); for (int i = 0; i < header.Length; ++i) { temp2[header[i]] = temp[i]; } ExpList[key] = temp2; } } } return; }
// Token: 0x0600003B RID: 59 RVA: 0x000056A4 File Offset: 0x000038A4 protected override void View() { this.examinfo = DbHelper.ExecuteModel <ExamInfo>(this.examid); if (this.examinfo.id == 0) { this.ShowErr("对不起,该试卷不存在或已被删除。"); } else { this.sortid = this.examinfo.sortid; this.sortinfo = SortBll.GetSortInfo(this.sortid); if (this.sortinfo.id == 0) { this.ShowErr("对不起,该栏目不存在或已被删除。"); } else { this.expinfo = DbHelper.ExecuteModel <ExpInfo>(this.id); if (this.ispost) { if (this.action == "add") { this.expinfo = FPRequest.GetModel <ExpInfo>(this.expinfo); this.expinfo.examid = this.examid; DbHelper.ExecuteInsert <ExpInfo>(this.expinfo); } else if (this.action == "default") { ExpInfo expInfo = new ExpInfo(); expInfo.examid = this.examid; expInfo.scorelower = 0; expInfo.scoreupper = 60; expInfo.exp = 0; expInfo.comment = "您的成绩不及格,加油哦"; DbHelper.ExecuteInsert <ExpInfo>(expInfo); expInfo.scorelower = 60; expInfo.scoreupper = 70; expInfo.exp = 1; expInfo.comment = "您的成绩免强及格,仍需努力哦"; DbHelper.ExecuteInsert <ExpInfo>(expInfo); expInfo.scorelower = 70; expInfo.scoreupper = 80; expInfo.exp = 2; expInfo.comment = "您的成绩中等水平,努力更上一台价"; DbHelper.ExecuteInsert <ExpInfo>(expInfo); expInfo.scorelower = 80; expInfo.scoreupper = 90; expInfo.exp = 3; expInfo.comment = "您的成绩中上水平,努力保持"; DbHelper.ExecuteInsert <ExpInfo>(expInfo); expInfo.scorelower = 90; expInfo.scoreupper = 100; expInfo.exp = 4; expInfo.comment = "您的成绩不错,不要骄傲"; DbHelper.ExecuteInsert <ExpInfo>(expInfo); } else if (this.action == "update") { this.expinfo = FPRequest.GetModel <ExpInfo>(this.expinfo, "exp_"); DbHelper.ExecuteUpdate <ExpInfo>(this.expinfo); } else if (this.action == "delete") { DbHelper.ExecuteDelete <ExpInfo>(FPRequest.GetString("eid")); } base.Response.Redirect(this.pagename + "?examid=" + this.examid); } SqlParam sqlParam = DbHelper.MakeAndWhere("examid", this.examid); this.explist = DbHelper.ExecuteList <ExpInfo>(OrderBy.ASC, new SqlParam[] { sqlParam }); base.SaveRightURL(); } } }
public ActionResult CreateBasicinfo() { JobResumeBasic br = new JobResumeBasic(); BasicInfo obj = new BasicInfo(); string fname = Request["fname"]; string lname = Request["lname"]; string email = Request["email"]; br.mname = Request["mname"]; br.image = Request["image"]; string date = Request["dob"]; br.dob = Convert.ToDateTime(date); br.gender = Request["gender"]; br.ph1 = Request["ph1"]; br.ph2 = Request["ph2"]; br.address = Request["address"]; string city = Request["city"]; br.city = obj.getCityId(city); string country = Request["country"]; br.country = obj.getCountryId(country); br.objective = Request["objective"]; br.depofint = Request["depoi"]; br.desofint = Request["desoi"]; date = Request["joiningdate"]; br.joiningdate = Convert.ToDateTime(date); string lastdegree = Request["lastdegree"]; br.lastdegree = obj.getDegreeId(lastdegree); string lastinstitute = Request["lastinstitute"]; br.lastinstitute = obj.getInstituteId(lastinstitute); br.perflastdegree = Request["lastperform"]; string scndlastdegree = Request["scndlastdegree"]; br.scndlastdegree = obj.getDegreeId(scndlastdegree); string scndlastinstitute = Request["scndlastinstitute"]; br.scndlastinstitute = obj.getInstituteId(scndlastinstitute); br.perfscndlastdegree = Request["scndlastperform"]; br.addqualification = Request["addqualification"]; br.userId = uid; obj.addBasicInfo(br); getAllLists obj1 = new getAllLists(); ViewBag.Cities = obj1.getCities(); ViewBag.Countaries = obj1.getCountaries(); ViewBag.Degrees = obj1.getDegrees(); ViewBag.Institutes = obj1.getInstitutes(); BasicInfo b = new BasicInfo(); ExpInfo e1 = new ExpInfo(); ExtraInfo e2 = new ExtraInfo(); ViewBag.isBasicInfoExist = b.isBasicInfoFound(uid); ViewBag.isExpInfoExist = e1.isExpInfoFound(uid); ViewBag.isExtraInfoExist = e2.isExtraInfoFound(uid); UserInfo u = new UserInfo(); ViewBag.UserInfo = u.getUserInfo(uid); return(View("Create")); }
// public void AddSetting(int level, ExpInfo expInfo) { setting.Add(level, expInfo); }
// Token: 0x060000B8 RID: 184 RVA: 0x00011E2C File Offset: 0x0001002C protected override void View() { if (this.ispost) { if (!this.isperm) { this.ShowErrMsg("对不起,您没有权限阅卷。"); return; } this.examresult = ExamBll.GetExamResult(this.resultid); if (this.examresult.id == 0) { this.ShowErrMsg("对不起,该考试不存在或已被删除。"); return; } int status = this.examresult.status; this.examresult.status = 2; this.examresult.exnote = FPRequest.GetString("exnote"); if (DbHelper.ExecuteUpdate <ExamResult>(this.examresult) <= 0) { this.ShowErrMsg("保存出现错误。"); return; } List <ExamResultTopic> examResultTopicList = ExamBll.GetExamResultTopicList(this.resultid); int num = 0; double score = this.examresult.score; this.examresult.score = 0.0; this.examresult.score1 = 0.0; this.examresult.score2 = 0.0; this.examresult.wrongs = 0; foreach (ExamResultTopic examResultTopic in examResultTopicList) { if (examResultTopic.questions == 0) { num++; } else { int[] array = FPUtils.SplitInt(examResultTopic.questionlist); string[] array2 = FPUtils.SplitString(examResultTopic.answerlist, "§", array.Length); string[] array3 = FPUtils.SplitString(examResultTopic.scorelist, "|", array.Length); examResultTopicList[num].scorelist = ""; examResultTopicList[num].correctlist = ""; examResultTopicList[num].score = 0.0; int num2 = 0; foreach (ExamQuestion examQuestion in QuestionBll.GetQuestionList(examResultTopic.questionlist)) { string a = array2[num2]; if (examResultTopicList[num].scorelist != "") { ExamResultTopic examResultTopic2 = examResultTopicList[num]; examResultTopic2.scorelist += "|"; } double num3 = 0.0; if (examQuestion.type == 1 || examQuestion.type == 2) { num3 = (double)FPRequest.GetFloat("score_" + examQuestion.id); this.examresult.score1 += num3; } else if (examQuestion.type == 3) { num3 = (double)FPRequest.GetFloat("score_" + examQuestion.id); this.examresult.score1 += num3; } else if (examQuestion.type == 4) { num3 = (double)FPRequest.GetFloat("score_" + examQuestion.id); this.examresult.score1 += num3; } else if (examQuestion.type == 5) { num3 = (double)FPRequest.GetFloat("score_" + examQuestion.id); this.examresult.score2 += num3; } else if (examQuestion.type == 6) { num3 = (double)FPRequest.GetFloat("score_" + examQuestion.id); this.examresult.score2 += num3; } this.examresult.score += num3; examResultTopicList[num].score += num3; ExamResultTopic examResultTopic3 = examResultTopicList[num]; examResultTopic3.scorelist += num3.ToString(); if (examResultTopicList[num].correctlist != "") { ExamResultTopic examResultTopic4 = examResultTopicList[num]; examResultTopic4.correctlist += "|"; } bool iswrong = false; if (num3 >= examResultTopic.perscore * 0.6) { ExamResultTopic examResultTopic5 = examResultTopicList[num]; examResultTopic5.correctlist += "1"; } else { ExamResultTopic examResultTopic6 = examResultTopicList[num]; examResultTopic6.correctlist += "0"; examResultTopicList[num].wrongs++; this.examresult.wrongs++; if (a == "") { this.examresult.unanswer++; } iswrong = true; } SortInfo sortInfo = SortBll.GetSortInfo(examQuestion.sortid); ExamBll.UpdateExamLog(sortInfo, this.examresult.uid, examQuestion, iswrong); num2++; } DbHelper.ExecuteUpdate <ExamResultTopic>(examResultTopicList[num]); num++; } } ExpInfo examExpByScore = ExamBll.GetExamExpByScore(this.examresult.score, this.examresult.examid); StringBuilder stringBuilder = new StringBuilder(); if (status == 0) { stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamResult] SET [score1]={1},[score2]={2},[score]={3},[wrongs]={4},[exp]={5} WHERE [id]={6}|", new object[] { DbConfigs.Prefix, this.examresult.score1, this.examresult.score2, this.examresult.score, this.examresult.wrongs, examExpByScore.exp, this.examresult.id }); stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamInfo] SET [exams]=[exams]+1,[score]=[score]+{1} WHERE [id]={2}", DbConfigs.Prefix, this.examresult.score, this.examresult.examid); } else { stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamResult] SET [score1]={1},[score2]={2},[score]={3},[exp]={4} WHERE [id]={5}|", new object[] { DbConfigs.Prefix, this.examresult.score1, this.examresult.score2, this.examresult.score, examExpByScore.exp, this.examresult.id }); stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamInfo] SET [score]=[score]-{1} WHERE [id]={2}|", DbConfigs.Prefix, score, this.examresult.examid); stringBuilder.AppendFormat("UPDATE [{0}Exam_ExamInfo] SET [score]=[score]+{1} WHERE [id]={2}", DbConfigs.Prefix, this.examresult.score, this.examresult.examid); stringBuilder.AppendFormat("UPDATE [{0}WMS_UserInfo] SET [exp]=[exp]-{1} WHERE [id]={2}", DbConfigs.Prefix, this.examresult.exp, this.examresult.uid); } this.msg = DbHelper.ExecuteSql(stringBuilder.ToString()); UserBll.UpdateUserExp(this.examresult.uid, examExpByScore.exp); if (this.msg != "") { this.ShowErrMsg(this.msg); return; } } Hashtable hashtable = new Hashtable(); hashtable["error"] = 0; hashtable["message"] = ""; base.Response.AddHeader("Content-Type", "text/html; charset=UTF-8"); base.Response.Write(JsonMapper.ToJson(hashtable)); base.Response.End(); }
//是否是二元操作符 private bool IsBinaryOperator(int token) { return(ExpInfo.OpPrec(token) != -1 ? true : false); }
private int Prec(int token) { return(ExpInfo.OpPrec(token)); //返回操作符的优先级数 }
public ExpInfo GetExpInfo() { return(ExpInfo.FromLevelExp(Level, Experience)); }