protected void Page_Load(object sender, EventArgs e) { if (base.Request["pc"] == null) { this.JS.Text = "alert('参数错误!');history.go(-1);"; return; } if (!base.IsPostBack) { userManageDb userManageDb = new userManageDb(); this.TxtRecordPerson.Text = userManageDb.GetUserName(this.Session["yhdm"].ToString()); this.ViewState["TaskBookCode"] = Guid.NewGuid().ToString(); this.ViewState["UserCode"] = userManageDb.GetCurrentUserInfo().UserCode; TaskBookAction.DeleteTempResource(this.ViewState["UserCode"].ToString()); this.ProjectCode = new Guid(base.Request["pc"]); this.HdnProjectCode.Value = this.ProjectCode.ToString(); this.DbConstructDate.Text = DateTime.Now.ToShortDateString(); this.BtnPickWBS.Attributes["onclick"] = "javascript:return OpenPickWBS('" + this.ProjectCode.ToString() + "');"; this.TaskBind(new DataTable()); } this.RecordCode = this.ViewState["TaskBookCode"].ToString(); this.FileLink1.MID = 29; this.FileLink1.FID = this.RecordCode; this.FileLink1.Type = 1; }
protected void Page_Load(object sender, EventArgs e) { if (base.Request["pc"] == null || base.Request["tc"] == null || base.Request["bc"] == null) { this.JS.Text = "alert('参数错误!');window.close()"; return; } this.ProjectCode = new Guid(base.Request["pc"]); this.TaskCode = base.Request["tc"].ToString(); this.ViewState["TaskBookCode"] = base.Request["bc"].ToString(); if (!this.Page.IsPostBack) { this.ViewState["UserCode"] = base.UserCode; TaskBookAction.DeleteTempResource(this.ViewState["UserCode"].ToString()); DataTable dataTable = this.tba.TaskBookResourceList(this.ProjectCode.ToString(), this.TaskCode.ToString(), this.ViewState["TaskBookCode"].ToString()); dataTable.Columns.Add("Amount", typeof(decimal)); this.Session["TEMPRESOURCE"] = dataTable; this.GridBind(dataTable.DefaultView); } this.btn_Add.Attributes["onclick"] = "if( !pickResource()) { return false;}"; if (base.Request.QueryString["optype"] != null) { this.btnSave.Visible = false; this.display = "display:none"; } }
private void TableUnit() { DataTable dataTable = (DataTable)this.Session["TEMPRESOURCE"]; DataTable tempResource = TaskBookAction.GetTempResource(this.ViewState["UserCode"].ToString()); tempResource.Columns.Add("Amount", typeof(decimal)); tempResource.Columns.Add("TotalPrice", typeof(decimal)); if (dataTable.Rows.Count == 0) { this.Session["TEMPRESOURCE"] = tempResource; } else { for (int i = 0; i < tempResource.Rows.Count; i++) { bool flag = true; for (int j = 0; j < dataTable.Rows.Count; j++) { if (dataTable.Rows[j]["ResourceCode"].ToString().Trim() == tempResource.Rows[i]["ResourceCode"].ToString().Trim()) { flag = false; break; } } if (flag) { dataTable.ImportRow(tempResource.Rows[i]); } } this.Session["TEMPRESOURCE"] = dataTable; } this.GridBind(((DataTable)this.Session["TEMPRESOURCE"]).DefaultView); }
private void DGrdResource_ItemDataBound(object sender, DataGridItemEventArgs e) { if (e.Item.ItemIndex > -1) { e.Item.Cells[0].Text = Convert.ToString(e.Item.ItemIndex + 1); e.Item.Attributes["onclick"] = "OnRecord(this);clickRow('" + e.Item.Cells[0].Text + "');"; e.Item.Attributes["onmouseover"] = "doMouseOver(this);"; e.Item.Attributes["onmouseout"] = "doMouseOut(this);"; if (((TextBox)e.Item.Cells[5].Controls[1]).Text.Trim() == "") { ((TextBox)e.Item.Cells[5].Controls[1]).Text = "0"; } if (((TextBox)e.Item.Cells[6].Controls[1]).Text.Trim() == "") { ((TextBox)e.Item.Cells[6].Controls[1]).Text = "0"; } ((TextBox)e.Item.Cells[5].Controls[1]).Attributes["onblur"] = "checkDecimal(this);"; ((TextBox)e.Item.Cells[6].Controls[1]).Attributes["onblur"] = "checkDecimal(this);"; e.Item.Cells[7].Text = TaskBookAction.GetResourceStyle(e.Item.Cells[1].Text.Trim()); TextBox textBox = (TextBox)e.Item.FindControl("TxtAmount"); TextBox textBox2 = (TextBox)e.Item.FindControl("TxtPrice"); TextBox textBox3 = (TextBox)e.Item.FindControl("TxtTotal"); textBox3.Text = Convert.ToString(decimal.Round(decimal.Parse(textBox.Text) * decimal.Parse(textBox2.Text), 2)); textBox.Attributes.Add("onblur", string.Concat(new string[] { "checkDecimal(this);getMoney('", textBox.ClientID, "','", textBox2.ClientID, "','", textBox3.ClientID, "');test(this);" })); textBox2.Attributes.Add("onblur", string.Concat(new string[] { "checkDecimal(this);getMoney('", textBox.ClientID, "','", textBox2.ClientID, "','", textBox3.ClientID, "');test(this);" })); } }
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(); } } } } } } }
protected void Page_Load(object sender, EventArgs e) { this.RecordCode = base.Request["tbc"].ToString().Trim(); this.FileLink1.MID = 29; this.FileLink1.FID = this.RecordCode; this.FileLink1.Type = 1; if (!base.IsPostBack) { if (base.Request["pc"] == null || base.Request["tbc"] == null) { this.JS.Text = "alert('参数错误!');history.go(-1);"; return; } this.ProjectCode = new Guid(base.Request["pc"]); this.HdnProjectCode.Value = this.ProjectCode.ToString(); this.TaskBillCode = base.Request["tbc"].ToString().Trim(); this.TaskBind(); this.ViewState["UserCode"] = base.UserCode; TaskBookAction.DeleteTempResource(this.ViewState["UserCode"].ToString()); this.BtnPickWBS.Attributes["onclick"] = "javascript:return OpenPickWBS('" + this.ProjectCode.ToString() + "');"; DataTable taskBook = this.tba.GetTaskBook2(this.ProjectCode, this.TaskBillCode); this.DataGrid_Bind(taskBook); } }