protected void Page_Load(object sender, EventArgs e) { if (base.Request["pc"] == null || base.Request["t"] == null || base.Request["m"] == null) { this.RegisterStartupScript("错误提示", "<script>alert('参数错误!');</script>"); return; } this.ProjectCode = new Guid(base.Request["pc"].ToString()); this.StartDate = Convert.ToDateTime(base.Request["m"].ToString()); base.DealType = (OpType)Enum.Parse(typeof(OpType), base.Request["t"].ToString()); if (base.Request["IsExam"] != null) { this.IsExamine = base.Request["IsExam"].ToString().Trim(); } if (base.DealType == OpType.Other) { this.BtnSave.Enabled = false; } if (!this.Page.IsPostBack) { if (this.intCount == 0) { this.ProductValueAct.updateProductValueDetail(this.ProjectCode, this.StartDate); bool flag = this.ProductValueAct.IsProductValueExamine(this.ProjectCode, this.StartDate); if (flag) { this.BtnSave.Enabled = false; this.BtnExamine.Enabled = false; } } this.intCount = 1; this.Lb_title.Attributes["align"] = "left"; this.Lb_title.Text = base.Request["m"].ToString() + "产值计划"; string projectNameOfCode = PrjInfoAction.GetProjectNameOfCode(this.ProjectCode.ToString()); if (projectNameOfCode != null) { this.Lb_title.Text = projectNameOfCode + " " + this.Lb_title.Text; } else { this.Lb_title.Text = this.Lb_title.Text; } } this._ScheduleCodeList = this.hdnScheduleCodeList.Value.Split(new char[] { '^' }); this.Init_theSchedule(); this.tblScheduleView_Create(true); this.BtnExit.Attributes["onclick"] = "javascript:return OpenProduceValue('" + this.ProjectCode + "');"; }
private void DoAlertMsg(ArrayList TaskInfos) { string[] strArray = new string[] { ConfigurationSettings.AppSettings["Artificial consumption"], ConfigurationSettings.AppSettings["Material consumption"], ConfigurationSettings.AppSettings["Equipment consumption"] }; UserInfo currentUserInfo = userManageDb.GetCurrentUserInfo(); for (int i = 0; i < TaskInfos.Count; i++) { ConstructTaskBook book = (ConstructTaskBook)TaskInfos[i]; for (int j = 0; j < strArray.Length; j++) { AlertPoint point = new AlertPoint(strArray[j]); if (point.Options[2].IsSelected) { SchedulePlanAction action = new SchedulePlanAction(); new ResourceItemAction(); AlertMessage message = new AlertMessage(); if (currentUserInfo != null) { message.ManInput = currentUserInfo.UserCode; } message.MenAlertTo = point.YHDMsOfPeopleAlertTo; message.TimeInput = DateTime.Now; message.TimeOutput = DateTime.Now; message.TimeOver = DateTime.Now.AddDays(point.ValidTimeLong); message.PresentimentID = point.pkID; message.PrjCode = this.ProjectCode.ToString(); DataTable table = TaskBookAction.DoAlert(this.ProjectCode, book.TaskCode, j + 1, book.TaskBookCode); if (table.Rows.Count > 0) { foreach (DataRow row in table.Rows) { decimal num3 = (decimal.Parse(row["ResBudget"].ToString()) == 0M) ? 0M : (decimal.Parse(row["ResConsum"].ToString()) / decimal.Parse(row["ResBudget"].ToString())); decimal num4 = (decimal.Parse(row["Quantity"].ToString()) == 0M) ? 0M : (decimal.Parse(row["Complete"].ToString()) / decimal.Parse(row["Quantity"].ToString())); if (num3 > num4) { message.Message = string.Concat(new object[] { PrjInfoAction.GetProjectNameOfCode(this.ProjectCode.ToString()), " ", action.GetTaskName(this.ProjectCode, book.TaskCode), " ", row["ResourceName"].ToString(), "消耗比例超过工程完成比例(", decimal.Round(num3 * 100M, 2), "%/", decimal.Round(num4 * 100M, 2), "%)." }); message.Send(); } } } } } } }