public ActionResult Index() { ViewData["account"] = sessionService.GetAccount(); string nowYear = DateTime.Now.ToLocalTime().ToString("yyyy"); string command = string.Format("select * from Exemplar where SealedTime like '%{0}%' and Status = '4';", nowYear); var exemplars = server.Find2SQL(command); return(View(exemplars)); }
// 修改密码 public void ChangePassword(string oldpwd, string newpwd) { Account account = sessionService.GetAccount(); if (passwordService.ComparePassword(oldpwd, account.PassWord)) { account.PassWord = passwordService.CreateDbPassword(newpwd); Commit(); } else { throw new Exception("旧密码错误!"); } }
// 提交审核 public string SubmitCheck(Dictionary <string, string> dict) { Account account = sessionService.GetAccount(); string err = "成功"; foreach (var d in dict) { Exemplar exemplar = GetOne(d.Key); if (d.Value == "") // OK { exemplar.Status = 3; exemplar.Verifier = account.Id.UserName; exemplar.VerResult = "OK"; exemplar.BackReason = ""; } else // NG { exemplar.Status = 1; exemplar.NGDes = d.Value; exemplar.Verifier = account.Id.UserName; exemplar.VerResult = "NG"; exemplar.BackReason = ""; try { var sender = mailServer.FindSender(); Tools.SendMail(exemplar, sender.MailAddre, sender.PassWord, mailServer); // 发送邮件 } catch (Exception e) { err = e.Message; } } } Commit(); return(err); }
// 完善自动赋值的字段 public ExemplarCommand Auto() { exemplar.ExemManager = sessionService.GetAccount().Id.UserName; exemplar.SignDate = DateTime.Now.ToLocalTime(); return(this); }