protected void btnAddWeb_Click(object sender, EventArgs e) { int index = KPI_WebDal.WebIDCounts(); KPI_WebEntity gwe = new KPI_WebEntity(); gwe.WebID = PageControl.GetGuid(); gwe.WebCode = "InputCode"; gwe.WebDesc = "Input Description"; gwe.WebType = 0; gwe.WebNote = ""; gwe.WebCreateTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss"); gwe.WebModifyTime = gwe.WebCreateTime; if (KPI_WebDal.Insert(gwe)) { gvWeb.EditIndex = index; BindWebs(); //MessageBox.popupClientMessage(this.Page, "添加成功!", "call();"); } else { MessageBox.popupClientMessage(this.Page, "添加失败!", "call();"); } return; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //指标信息 if (Request.QueryString["webcode"] != null) { WebCode = Request.QueryString["webcode"].ToString(); lblInfor.Text = "报表名称: " + KPI_WebDal.GetWebDesc(WebCode); } else { WebCode = ""; } ////机组信息 DataTable dt = KPI_UnitDal.GetUnits(""); foreach (DataRow dr in dt.Rows) { ddlUnit.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString())); } // txt_ST.Value = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"); txt_ET.Value = DateTime.Now.ToString("yyyy-MM-dd"); BindValue(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // if (Request.QueryString["webcode"] != null) { string webcode = Request.QueryString["webcode"].ToString(); string webid = KPI_WebDal.GetWebID(webcode); lblWebID.Text = webid; } else { lblWebID.Text = ""; } // txt_Day.Value = DateTime.Now.AddDays(-1).ToLocalTime().ToString("yyyy-MM-dd"); lblQueryDay.Text = txt_Day.Value; // LoadReport(); } }
/// <summary> /// /// </summary> public void BindWebs() { //绑定参数 DataTable dt = KPI_WebDal.GetAllWebList(); gvData.DataSource = dt; gvData.DataBind(); }
/// <summary> /// /// </summary> public void BindWebs() { //绑定参数 DataTable dtShift = KPI_WebDal.GetWebListbyType("0"); gvData.DataSource = dtShift; gvData.DataBind(); DataTable dtUnit = KPI_WebDal.GetWebListbyType("1"); gvData1.DataSource = dtUnit; gvData1.DataBind(); }
public void BindKeys(string webid) { string WebName = KPI_WebDal.GetKeyName(webid); lblInfor.Text = WebName; WebID = webid; //DataTable dt = KPI_KeyDal.GetKeyList(webid); //gvKey.DataSource = dt; //gvKey.DataBind(); }
public void KPI_Web_Del(HttpContext context) { string WebCode = context.Request["WebCode"]; if (KPI_WebDal.DeleteWebCode(WebCode)) { context.Response.Write("{\"status\":\"ok\"}"); } else { context.Response.Write("{\"status\":\"删除失败!\"}"); } }
protected void gvWeb_RowUpdating(object sender, GridViewUpdateEventArgs e) { string sID = ((HtmlInputHidden)(gvWeb.Rows[e.RowIndex].Cells[0].FindControl("webid"))).Value.ToString().Trim(); string sCode = ((TextBox)(gvWeb.Rows[e.RowIndex].Cells[1].Controls[0])).Text.ToString().Trim(); string sDesc = ((TextBox)(gvWeb.Rows[e.RowIndex].Cells[2].Controls[0])).Text.ToString().Trim(); string sType = ((DropDownList)(gvWeb.Rows[e.RowIndex].Cells[3].FindControl("ddlType"))).SelectedValue; string sNote = ((TextBox)(gvWeb.Rows[e.RowIndex].Cells[4].Controls[0])).Text.ToString().Trim(); if (sCode == "") { MessageBox.popupClientMessage(this.Page, "代码不能为空!", "call();"); return; } //名称是否重复 if (KPI_WebDal.WebCodeExists(sCode, sID)) { MessageBox.popupClientMessage(this.Page, "已存在相同的代码!"); return; } //更新 KPI_WebEntity ote = new KPI_WebEntity(); ote.WebID = sID; ote.WebCode = sCode; ote.WebDesc = sDesc; ote.WebType = int.Parse(sType); ote.WebNote = sNote; ote.WebModifyTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss"); if (KPI_WebDal.Update(ote)) { MessageBox.popupClientMessage(this.Page, "编辑成功!", "call();"); } else { MessageBox.popupClientMessage(this.Page, "编辑错误!", "call();"); } gvWeb.EditIndex = -1; BindWebs(); }
public void KPI_Web_Edit(HttpContext context) { string sID = context.Request["WebID"]; if (sID == "") { context.Response.Write("{\"status\":\"没有对象!\"}"); return; } //string sCode = context.Request["WebCode"]; string sDesc = context.Request["WebDesc"]; string sType = context.Request["WebType"]; string sNote = context.Request["Note"]; //if (sCode == "") //{ // context.Response.Write("{\"status\":\"代码不能为空!\"}"); // return; //} ////名称是否重复 //if (KPI_WebDal.WebCodeExists(sCode, sID)) //{ // context.Response.Write("{\"status\":\"已存在相同的代码!\"}"); // return; //} //更新 KPI_WebEntity ote = new KPI_WebEntity(); ote.WebID = sID; //ote.WebCode = sCode; ote.WebDesc = sDesc; ote.WebType = int.Parse(sType); ote.WebNote = sNote; ote.WebModifyTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss"); if (KPI_WebDal.Update(ote)) { context.Response.Write("{\"status\":\"ok\"}"); } else { context.Response.Write("{\"status\":\"修改失败!\"}"); } }
void BindGrid() { //string WebID = ViewState["webid"].ToString(); if (WebID.Equals("")) { return; } lblInfor.Text = "当前集合名称为:" + KPI_WebDal.GetKeyName(WebID); //gvTable = KPI_KeyDal.GetKeyList(WebID); //gvKey.DataSource = gvTable; //gvKey.DataBind(); }
void BindGrid() { string WebID = ViewState["webid"].ToString(); string WebName = KPI_WebDal.GetKeyName(WebID); lblInfor.Text = "当前操作集为:" + WebName; // //gvTable = KPI_KeyDal.GetSearchListNot(WebID); //cbxKey.DataSource = gvTable; //cbxKey.DataTextField = "Name"; //cbxKey.DataValueField = "ID"; //cbxKey.DataBind(); }
public void KPI_Web_Add(HttpContext context) { string sID = PageControl.GetGuid(); string sCode = context.Request["WebCode"]; string sDesc = context.Request["WebDesc"]; string sType = context.Request["WebType"]; string sNote = context.Request["WebNote"]; if (sCode == "") { context.Response.Write("{\"status\":\"代码不能为空!\"}"); return; } //名称是否重复 if (KPI_WebDal.WebCodeExists(sCode, sID)) { context.Response.Write("{\"status\":\"已存在相同的代码!\"}"); return; } //更新 KPI_WebEntity ote = new KPI_WebEntity(); ote.WebID = sID; ote.WebCode = sCode; ote.WebDesc = sDesc; ote.WebType = int.Parse(sType); ote.WebNote = sNote; ote.WebCreateTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss"); ote.WebModifyTime = ote.WebCreateTime; if (KPI_WebDal.Insert(ote)) { context.Response.Write("{\"status\":\"ok\"}"); return; } else { context.Response.Write("{\"status\":\"添加失败!\"}"); return; } }
/// <summary> /// /// </summary> public void BindWebs() { //绑定参数 DataTable dt = KPI_WebDal.GetWebList(); gvWeb.DataSource = dt; gvWeb.DataBind(); if (dt.Rows.Count > 0) { WebID = dt.Rows[0]["WebID"].ToString(); } else { WebID = ""; } BindKeys(WebID); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // if (Request.QueryString["webcode"] != null) { string webcode = Request.QueryString["webcode"].ToString(); string webid = KPI_WebDal.GetWebID(webcode); lblWebID.Text = webid; } else { lblWebID.Text = ""; } // txt_Day.Value = DateTime.Now.AddDays(-1).ToLocalTime().ToString("yyyy-MM-dd"); lblQueryDay.Text = txt_Day.Value; // LoadReport(); // //this.btnKPIName.Attributes.Add("onclick", "javascript:OpenOvertimeDlog('add',550,550)"); // //this.ddlStartHour.Items.Clear(); //this.ddlEndHour.Items.Clear(); //for (int i = 0; i <= 23; i++) //{ // string item = (i.ToString().Length == 1 ? "0" + i.ToString() : i.ToString()); // this.ddlStartHour.Items.Add(new ListItem(item, item + ":00")); // this.ddlEndHour.Items.Add(new ListItem(item, item + ":00")); //} ////绑定机组 //this.ddlUnitEntity.Items.Clear(); //this.ddlUnitEntity.DataSource = this.odsUnitName; //this.ddlUnitEntity.DataValueField = "ENTITY"; //this.ddlUnitEntity.DataTextField = "DESCRIBE"; //this.ddlUnitEntity.DataBind(); //指标名称 //DataView dw = (DataView)odsKPITag.Select(); //dtKPI = dw.Table; //cbxKPIName.DataValueField = "tagdefid"; //cbxKPIName.DataTextField = "DESCRIPTION"; //记录选中 //string strCondition = ""; //dtKPI.Columns.Add("tagselected", typeof(System.Int32)); //for (int i = 0; i < dtKPI.Rows.Count; i++) //{ // if (i < 10) // { // dtKPI.Rows[i]["tagselected"] = 1; // strCondition += dtKPI.Rows[i]["tagdefid"].ToString() + ","; // } // else // { // dtKPI.Rows[i]["tagselected"] = 0; // } //} //////////////////////////////////////////////////////////////////// //lblCondition.Text = strCondition; //tbStartDate.Text = DateTime.Now.AddDays(-1).Date.ToString("yyyy-MM-dd"); //tbStartDate.Attributes.Add("onfocus", "JavaScript:document.getElementById('Calendardiv').style.display = 'block'"); //tbEndDate.Text = DateTime.Now.Date.ToString("yyyy-MM-dd"); //tbEndDate.Attributes.Add("onfocus", "JavaScript:document.getElementById('Calendardiv2').style.display = 'block'"); /////////////////////////////////////////////////// //默认全选 //LoadDate(); } //string strTip = "请选择指标..."; //for (int j = 0; j < dtKPI.Rows.Count; j++) //{ // if (dtKPI.Rows[j]["tagselected"].ToString() == "1") // { // strTip = dtKPI.Rows[j]["DESCRIPTION"].ToString() + "..."; // break; // } //} //btnKPIName.Text = strTip; }