Beispiel #1
0
 private void grd_ModuleList_ItemDataBound(object sender, DataGridItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.EditItem)
     {
         DataRowView dataRowView = (DataRowView)e.Item.DataItem;
         if (dataRowView["SetUpFlowState"].ToString() == "1" && dataRowView["PrjState"].ToString() != "17" && dataRowView["ISDISPLAY"].ToString() != "0" && dataRowView["PrjState"].ToString() != "1" && dataRowView["PrjState"].ToString() != "2" && dataRowView["PrjState"].ToString() != "3" && dataRowView["PrjState"].ToString() != "4" && dataRowView["PrjState"].ToString() != "6" && dataRowView["PrjState"].ToString() != "14" && dataRowView["PrjState"].ToString() != "15" && dataRowView["PrjState"].ToString() != "16" && dataRowView["PrjState"].ToString() != "18")
         {
             if (dataRowView["TypeCode"].ToString() == "00")
             {
                 e.Item.Attributes["onclick"] = "clickRow(this,'',false,'','');";
             }
             else
             {
                 e.Item.Attributes["onclick"] = string.Concat(new string[]
                 {
                     "clickRow(this,'",
                     dataRowView["TypeCode"].ToString(),
                     "',",
                     ((int)dataRowView["i_childnum"] == 0) ? "true" : "false",
                     ",'",
                     dataRowView["prjguid"].ToString(),
                     "','",
                     dataRowView["prjname"].ToString(),
                     "');"
                 });
             }
         }
         else
         {
             e.Item.Attributes["onclick"] = "clickRow(this,'',false,'','','0');";
         }
         e.Item.Attributes["isMainContract"] = ((HiddenField)e.Item.FindControl("hfldIsMainContract")).Value;
         e.Item.Attributes["prjName"]        = ((HiddenField)e.Item.FindControl("hdfPrjName")).Value;
         e.Item.Attributes["id"]             = dataRowView["budgetcode"].ToString();
         e.Item.Attributes["prjState"]       = dataRowView["PrjState"].ToString();
         e.Item.Attributes["setUpFlowState"] = dataRowView["SetUpFlowState"].ToString();
         e.Item.Attributes["ISDISPLAY"]      = dataRowView["ISDISPLAY"].ToString();
         if (dataRowView["SetUpFlowState"].ToString() == "1" && dataRowView["PrjState"].ToString() != "17" && dataRowView["ISDISPLAY"].ToString() != "0" && dataRowView["PrjState"].ToString() != "1" && dataRowView["PrjState"].ToString() != "2" && dataRowView["PrjState"].ToString() != "3" && dataRowView["PrjState"].ToString() != "4" && dataRowView["PrjState"].ToString() != "6" && dataRowView["PrjState"].ToString() != "14" && dataRowView["PrjState"].ToString() != "15" && dataRowView["PrjState"].ToString() != "16" && dataRowView["PrjState"].ToString() != "18")
         {
             e.Item.Attributes["ondblclick"] = string.Concat(new string[]
             {
                 "dbClickRow(this,'",
                 dataRowView["prjguid"].ToString(),
                 "','",
                 dataRowView["prjname"].ToString(),
                 "',",
                 ((int)dataRowView["i_childnum"] == 0) ? "true" : "false",
                 ")"
             });
         }
         e.Item.Cells[9].Text = "";
         if (ConfigHelper.Get("IsNewProject") == "0")
         {
             if (dataRowView["PrjState"].ToString() == "4")
             {
                 e.Item.Cells[9].Text = "在建";
             }
             if (dataRowView["PrjState"].ToString() == "-1")
             {
                 e.Item.Cells[9].ForeColor = Color.Blue;
                 e.Item.Cells[9].Text      = "在建";
             }
             if (dataRowView["PrjState"].ToString() == "0")
             {
                 e.Item.Cells[9].Text = "";
             }
             if (dataRowView["TypeCode"].ToString() == "00")
             {
                 e.Item.Attributes["onclick"] = "clickRow(this,'',false,'','','');";
             }
             else
             {
                 e.Item.Attributes["onclick"] = string.Concat(new string[]
                 {
                     "clickRow(this,'",
                     dataRowView["TypeCode"].ToString(),
                     "',",
                     ((int)dataRowView["i_childnum"] == 0) ? "true" : "false",
                     ",'",
                     dataRowView["prjguid"].ToString(),
                     "','",
                     dataRowView["prjname"].ToString(),
                     "','",
                     dataRowView["prjCode"].ToString(),
                     "');"
                 });
             }
             e.Item.Attributes["ondblclick"] = string.Concat(new string[]
             {
                 "dbClickRow(this,'",
                 dataRowView["prjguid"].ToString(),
                 "','",
                 dataRowView["prjname"].ToString(),
                 "','",
                 dataRowView["prjCode"].ToString(),
                 "',",
                 ((int)dataRowView["i_childnum"] == 0) ? "true" : "false",
                 ")"
             });
         }
         else
         {
             try
             {
                 int code = System.Convert.ToInt32(dataRowView["PrjState"]);
                 e.Item.Cells[9].Text = TypeList.GetNameByCode(code);
             }
             catch
             {
             }
         }
         if (dataRowView["TypeCode"].ToString().Length > 5)
         {
             e.Item.Cells[2].Text = dataRowView["TypeCode"].ToString().Substring(0, 5) + "<font color=\"#ff0000\">" + dataRowView["TypeCode"].ToString().Substring(5, dataRowView["TypeCode"].ToString().Length - 5) + "</font>";
         }
         e.Item.Cells[3].ToolTip = e.Item.Cells[3].Text;
         e.Item.Cells[3].Text    = StringUtility.GetStr(dataRowView["prjName"].ToString(), 0, 12);
         e.Item.Cells[4].ToolTip = e.Item.Cells[4].Text;
         e.Item.Cells[4].Text    = StringUtility.GetStr(dataRowView["Owner"].ToString(), 0, 6);
         e.Item.Cells[8].ToolTip = e.Item.Cells[8].Text;
         e.Item.Cells[8].Text    = StringUtility.GetStr(dataRowView["PrjPlace"].ToString(), 0, 6);
         e.Item.Attributes["id"] = dataRowView["prjGuid"].ToString();
         string text = base.Request["prjCode"].ToString();
         if (text != "")
         {
             string[] array = text.Split(new char[]
             {
                 ','
             });
             string[] array2 = array;
             for (int i = 0; i < array2.Length; i++)
             {
                 string text2 = array2[i];
                 if (text2 == dataRowView["prjGuid"].ToString() && text2 != "")
                 {
                     CheckBox checkBox = e.Item.FindControl("CheckBox1") as CheckBox;
                     checkBox.Checked = true;
                     HiddenField expr_AE6 = this.hdCode;
                     expr_AE6.Value = expr_AE6.Value + "," + text2;
                     HiddenField expr_B03 = this.hdName;
                     expr_B03.Value = expr_B03.Value + dataRowView["prjName"] + ",";
                 }
             }
         }
     }
 }
	private void grd_ModuleList_ItemDataBound(object sender, DataGridItemEventArgs e)
	{
		if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.EditItem)
		{
			DataRowView dataRowView = (DataRowView)e.Item.DataItem;
			if (dataRowView["SetUpFlowState"].ToString() == "1" && dataRowView["PrjState"].ToString() != "17" && dataRowView["PrjState"].ToString() != "1" && dataRowView["PrjState"].ToString() != "2" && dataRowView["PrjState"].ToString() != "3" && dataRowView["PrjState"].ToString() != "4" && dataRowView["PrjState"].ToString() != "6" && dataRowView["PrjState"].ToString() != "14" && dataRowView["PrjState"].ToString() != "15" && dataRowView["PrjState"].ToString() != "16" && dataRowView["PrjState"].ToString() != "18")
			{
				if (dataRowView["TypeCode"].ToString() == "00")
				{
					e.Item.Attributes["onclick"] = "clickRow(this,'',false,'','','','','','','','');";
				}
				else
				{
					e.Item.Attributes["onclick"] = string.Concat(new string[]
					{
						"clickRow(this,'",
						dataRowView["TypeCode"].ToString(),
						"',",
						((int)dataRowView["i_childnum"] == 0) ? "true" : "false",
						",'",
						dataRowView["prjguid"].ToString(),
						"','",
						dataRowView["prjname"].ToString(),
						"','",
						dataRowView["prjCode"].ToString(),
						"','",
						dataRowView["PrjFundWorkable"].ToString(),
						"','",
						dataRowView["ForecastProfitRate"].ToString(),
						"','",
						dataRowView["QualityClassName"].ToString(),
						"','",
						dataRowView["PrjFundInfo"].ToString(),
						"','",
						dataRowView["CodeName"].ToString(),
						"');"
					});
				}
			}
			else
			{
				e.Item.Attributes["onclick"] = "clickRow(this,'',false,'','','','','','','','','0');";
			}
			e.Item.Attributes["isMainContract"] = ((HiddenField)e.Item.FindControl("hfldIsMainContract")).Value;
			e.Item.Attributes["id"] = dataRowView["budgetcode"].ToString();
			if (dataRowView["SetUpFlowState"].ToString() == "1" && dataRowView["PrjState"].ToString() != "17" && dataRowView["PrjState"].ToString() != "1" && dataRowView["PrjState"].ToString() != "2" && dataRowView["PrjState"].ToString() != "3" && dataRowView["PrjState"].ToString() != "4" && dataRowView["PrjState"].ToString() != "6" && dataRowView["PrjState"].ToString() != "14" && dataRowView["PrjState"].ToString() != "15" && dataRowView["PrjState"].ToString() != "16" && dataRowView["PrjState"].ToString() != "18")
			{
				e.Item.Attributes["ondblclick"] = string.Concat(new string[]
				{
					"dbClickRow(this,'",
					dataRowView["prjguid"].ToString(),
					"','",
					dataRowView["prjname"].ToString(),
					"','",
					dataRowView["prjCode"].ToString(),
					"','",
					dataRowView["PrjFundWorkable"].ToString(),
					"','",
					dataRowView["ForecastProfitRate"].ToString(),
					"','",
					dataRowView["QualityClassName"].ToString(),
					"','",
					dataRowView["PrjFundInfo"].ToString(),
					"','",
					dataRowView["CodeName"].ToString(),
					"',",
					((int)dataRowView["i_childnum"] == 0) ? "true" : "false",
					")"
				});
			}
			e.Item.Cells[8].Text = "";
			if (ConfigHelper.Get("IsNewProject") == "0")
			{
				if (dataRowView["PrjState"].ToString() == "4")
				{
					e.Item.Cells[8].Text = "在建";
				}
				if (dataRowView["PrjState"].ToString() == "-1")
				{
					e.Item.Cells[8].ForeColor = Color.Blue;
					e.Item.Cells[8].Text = "在建";
				}
				if (dataRowView["PrjState"].ToString() == "0")
				{
					e.Item.Cells[8].Text = "";
				}
				if (dataRowView["TypeCode"].ToString() == "00")
				{
					e.Item.Attributes["onclick"] = "clickRow(this,'',false,'','','');";
				}
				else
				{
					e.Item.Attributes["onclick"] = string.Concat(new string[]
					{
						"clickRow(this,'",
						dataRowView["TypeCode"].ToString(),
						"',",
						((int)dataRowView["i_childnum"] == 0) ? "true" : "false",
						",'",
						dataRowView["prjguid"].ToString(),
						"','",
						dataRowView["prjname"].ToString(),
						"','",
						dataRowView["prjCode"].ToString(),
						"','",
						dataRowView["PrjFundWorkable"].ToString(),
						"','",
						dataRowView["ForecastProfitRate"].ToString(),
						"','",
						dataRowView["QualityClassName"].ToString(),
						"','",
						dataRowView["PrjFundInfo"].ToString(),
						"','",
						dataRowView["CodeName"].ToString(),
						"');"
					});
				}
				e.Item.Attributes["ondblclick"] = string.Concat(new string[]
				{
					"dbClickRow(this,'",
					dataRowView["prjguid"].ToString(),
					"','",
					dataRowView["prjname"].ToString(),
					"','",
					dataRowView["prjCode"].ToString(),
					"','",
					dataRowView["PrjFundWorkable"].ToString(),
					"','",
					dataRowView["ForecastProfitRate"].ToString(),
					"','",
					dataRowView["QualityClassName"].ToString(),
					"','",
					dataRowView["PrjFundInfo"].ToString(),
					"','",
					dataRowView["CodeName"].ToString(),
					"',",
					((int)dataRowView["i_childnum"] == 0) ? "true" : "false",
					")"
				});
			}
			else
			{
				try
				{
					int code = System.Convert.ToInt32(dataRowView["PrjState"]);
					e.Item.Cells[8].Text = TypeList.GetNameByCode(code);
				}
				catch
				{
				}
			}
			if (dataRowView["TypeCode"].ToString().Length > 5)
			{
				e.Item.Cells[1].Text = dataRowView["TypeCode"].ToString().Substring(0, 5) + "<font color=\"#ff0000\">" + dataRowView["TypeCode"].ToString().Substring(5, dataRowView["TypeCode"].ToString().Length - 5) + "</font>";
			}
			e.Item.Cells[3].Text = StringUtility.GetStr(dataRowView["Owner"].ToString(), 0, 6);
			e.Item.Cells[7].Text = StringUtility.GetStr(dataRowView["PrjPlace"].ToString(), 0, 6);
			e.Item.Attributes["id"] = dataRowView["prjGuid"].ToString();
		}
	}
Beispiel #3
0
 private void grd_ModuleList_ItemDataBound(object sender, DataGridItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.EditItem)
     {
         DataRowView dataRowView = (DataRowView)e.Item.DataItem;
         if (dataRowView["TypeCode"].ToString() == "00")
         {
             e.Item.Attributes["onclick"] = "clickRow(this,'',false,'','');";
         }
         else
         {
             e.Item.Attributes["onclick"] = string.Concat(new string[]
             {
                 "clickRow(this,'",
                 dataRowView["TypeCode"].ToString(),
                 "',",
                 ((int)dataRowView["i_childnum"] == 0) ? "true" : "false",
                 ",'",
                 dataRowView["prjguid"].ToString(),
                 "','",
                 dataRowView["prjname"].ToString(),
                 "');"
             });
         }
         e.Item.Attributes["onmouseover"] = "overRow(this);";
         e.Item.Attributes["onmouseout"]  = "outRow(this);";
         e.Item.Style.Add("display", dataRowView["display"].ToString());
         e.Item.Attributes["id"]         = dataRowView["budgetcode"].ToString();
         e.Item.Attributes["ondblclick"] = string.Concat(new string[]
         {
             "dbClickRow(this,'",
             dataRowView["prjguid"].ToString(),
             "','",
             dataRowView["prjname"].ToString(),
             "',",
             ((int)dataRowView["i_childnum"] == 0) ? "true" : "false",
             ")"
         });
         if (ConfigHelper.Get("IsNewProject") == "0")
         {
             if (dataRowView["PrjState"].ToString() == "4")
             {
                 e.Item.Cells[8].Text = "在建";
             }
             if (dataRowView["PrjState"].ToString() == "-1")
             {
                 e.Item.Cells[8].ForeColor = Color.Blue;
                 e.Item.Cells[8].Text      = "在建";
             }
             if (dataRowView["PrjState"].ToString() == "0")
             {
                 e.Item.Cells[8].Text = "";
             }
         }
         else
         {
             try
             {
                 int code = System.Convert.ToInt32(dataRowView["PrjState"]);
                 e.Item.Cells[8].Text = TypeList.GetNameByCode(code);
             }
             catch
             {
             }
         }
         if (dataRowView["TypeCode"].ToString().Length > 5)
         {
             e.Item.Cells[1].Text = dataRowView["TypeCode"].ToString().Substring(0, 5) + "<font color=\"#ff0000\">" + dataRowView["TypeCode"].ToString().Substring(5, dataRowView["TypeCode"].ToString().Length - 5) + "</font>";
         }
         e.Item.Cells[3].Text = StringUtility.GetStr(dataRowView["Owner"].ToString(), 0, 6);
         e.Item.Cells[7].Text = StringUtility.GetStr(dataRowView["PrjPlace"].ToString(), 0, 6);
         HyperLink hyperLink = (HyperLink)e.Item.Cells[2].Controls[0];
         hyperLink.Text = StringUtility.GetStr(hyperLink.Text);
         hyperLink.Style.Add("onMouseOver", "document.getElementById('btnEdit').Color='red'");
         hyperLink.NavigateUrl = "#";
         hyperLink.NavigateUrl = "../EPC/Pm/PrjInfo/PrjInfoView.aspx?typecode=" + dataRowView["TypeCode"].ToString();
     }
 }