예제 #1
0
 public ActionResult New(IssueLevel issueLevel)
 {
     if (ModelState.IsValid)
     {
         //判断用户名不能重复
         if (base.genericMgr.FindAll<long>(codeDuiplicateVerifyStatement, new object[] { issueLevel.Code })[0] > 0)
         {
             base.SaveErrorMessage(Resources.ISS.IssueLevel.Errors_Existing_IssueLevel, issueLevel.Code);
         }
         else
         {
             base.genericMgr.Create(issueLevel);
             SaveSuccessMessage(Resources.ISS.IssueLevel.IssueLevel_Added);
             return RedirectToAction("Edit/" + issueLevel.Code);
         }
     }
     return View(issueLevel);
 }
        public ActionResult Edit(IssueTypeToMaster issueTypeTo)
        {
            if (!string.IsNullOrWhiteSpace(issueTypeTo.IssueTypeCode))
            {
                ViewBag.IssueTypeCode = issueTypeTo.IssueTypeCode;
                IssueType issueType = new IssueType();//this.genericMgr.FindById<IssueType>(issueTypeTo.IssueTypeCode);
                issueType.Code = issueTypeTo.IssueTypeCode;
                issueTypeTo.IssueType = issueType;
                ModelState.Remove("IssueType");
            }
            if (!string.IsNullOrWhiteSpace(issueTypeTo.IssueLevelCode))
            {
                ViewBag.IssueLevelCode = issueTypeTo.IssueLevelCode;
                IssueLevel issueLevel = new IssueLevel();//this.genericMgr.FindById<IssueLevel>(issueTypeTo.IssueLevelCode);
                issueLevel.Code = issueTypeTo.IssueLevelCode;
                issueTypeTo.IssueLevel = issueLevel;
                ModelState.Remove("IssueLevel");
            }
            if (ModelState.IsValid)
            {
                genericMgr.UpdateWithTrim(issueTypeTo);
                SaveSuccessMessage(Resources.ISS.IssueTypeToMaster.IssueTypeToMaster_Updated);
            }

            return View(issueTypeTo);
        }
        public ActionResult New(IssueTypeToMaster issueTypeTo)
        {

            if (!string.IsNullOrWhiteSpace(issueTypeTo.IssueTypeCode))
            {
                ViewBag.IssueTypeCode = issueTypeTo.IssueTypeCode;
                IssueType issueType = new IssueType();//this.genericMgr.FindById<IssueType>(issueTypeTo.IssueTypeCode);
                issueType.Code = issueTypeTo.IssueTypeCode;
                issueTypeTo.IssueType = issueType;
                ModelState.Remove("IssueType");
            }
            if (!string.IsNullOrWhiteSpace(issueTypeTo.IssueLevelCode))
            {
                ViewBag.IssueLevelCode = issueTypeTo.IssueLevelCode;
                IssueLevel issueLevel = new IssueLevel();//this.genericMgr.FindById<IssueLevel>(issueTypeTo.IssueLevelCode);
                issueLevel.Code = issueTypeTo.IssueLevelCode;
                issueTypeTo.IssueLevel = issueLevel;
                ModelState.Remove("IssueLevel");
            }
            if (ModelState.IsValid)
            {
                //判断用户名不能重复
                if (this.genericMgr.FindAll<long>(codeDuiplicateVerifyStatement, new object[] { issueTypeTo.Code })[0] > 0)
                {
                    base.SaveErrorMessage(Resources.ISS.IssueTypeToMaster.Errors_Existing_IssueTypeToMaster, issueTypeTo.Code);
                }
                else
                {
                    genericMgr.CreateWithTrim(issueTypeTo);
                    SaveSuccessMessage(Resources.ISS.IssueTypeToMaster.IssueTypeToMaster_Added);
                    return RedirectToAction("Edit/" + issueTypeTo.Code);
                }
            }
            ViewBag.Code = issueTypeTo.Code;
            return View(issueTypeTo);
        }
예제 #4
0
        public ActionResult _IssueLevelDropDownList(string controlName, string controlId, string selectedValue, bool? includeBlankOption, string blankOptionDescription, string blankOptionValue, bool? enable)
        {
            ViewBag.ControlName = controlName;
            ViewBag.ControlId = controlId;
            //ViewBag.SelectedValue = selectedValue;
            ViewBag.Enable = enable;
            IList<IssueLevel> issueLevelList = base.genericMgr.FindAll<IssueLevel>("from IssueLevel as il");
            if (issueLevelList == null)
            {
                issueLevelList = new List<IssueLevel>();
            }

            if (includeBlankOption.HasValue && includeBlankOption.Value)
            {
                IssueLevel blankIssueLevel = new IssueLevel();
                blankIssueLevel.Code = blankOptionValue;
                blankIssueLevel.Description = blankOptionDescription;

                issueLevelList.Insert(0, blankIssueLevel);
            }
            return PartialView(new SelectList(issueLevelList, "Code", "Description", selectedValue));
        }
예제 #5
0
        public bool IsSended(IssueMaster issue, IssueLevel issueLevel)
        {
            string hql = "select count(*) from IssueDetail where IsActive = true and IssueCode =? and Level = ? and (EmailStatus !=0 or SMSStatus !=0 )";

            IList<long> count = this.genericMgr.FindAll<long>(hql, new object[] { issue.Code, issueLevel.Code });

            if (count != null && count.Count > 0 && count[0] > 0)
            {
                return true;
            }
            return false;
        }
예제 #6
0
        private void SendMailAndSMS(IssueMaster issue, IssueLevel level, IList<IssueDetail> issueDetailList)
        {
            try
            {
                if (issueDetailList == null || issueDetailList.Count == 0)
                {
                    throw new BusinessException(Resources.ISS.IssueMaster.EmailListIsNull);
                }

                SendEmail(issue, level.Code, ref issueDetailList);

                SendSMS(issue, level.Code, ref issueDetailList);


                foreach (IssueDetail issueDetail in issueDetailList)
                {
                    if (issueDetail.SMSStatus != com.Sconit.CodeMaster.SendStatus.Fail)
                    {
                        issueDetail.SMSStatus = com.Sconit.CodeMaster.SendStatus.Success;
                        issueLogMgr.LogInfo(issue.Code, issueDetail, issue.Content);
                    }
                    issueDetail.SMSCount = issueDetail.SMSCount + 1;

                    if (issueDetail.EmailStatus != com.Sconit.CodeMaster.SendStatus.Fail)
                    {
                        issueDetail.EmailStatus = com.Sconit.CodeMaster.SendStatus.Success;
                        issueLogMgr.LogInfo(issue.Code, issueDetail, issue.Content);
                    }
                    issueDetail.EmailCount = issueDetail.EmailCount + 1;

                    this.genericMgr.Update(issueDetail);
                }
            }
            catch (Exception e)
            {
                issueLogMgr.LogError(issue.Code, e.Message);
            }
        }
예제 #7
0
        public ActionResult Edit(IssueLevel issueLevel)
        {
            if (ModelState.IsValid)
            {
                base.genericMgr.Update(issueLevel);
                SaveSuccessMessage(Resources.ISS.IssueLevel.IssueLevel_Updated);
            }

            return View(issueLevel);
        }