public void BindKeys() { DataTable dt = AVGDal.GetKeyList(); gvData.DataSource = dt; gvData.DataBind(); }
public void KPI_Average_Del(HttpContext context) { string KeyID = context.Request["KeyID"]; if (AVGDal.DeleteKey(KeyID)) { context.Response.Write("{\"status\":\"ok\"}"); } else { context.Response.Write("{\"status\":\"删除失败!\"}"); } }
public void KPI_Average_Edit(HttpContext context) { //KeyID,ECCode,ECName,KeyEngunit,KeyTarget1,KeyTarget2,KeyDesign,KeyDiffMoney,KeyOptMoney,KeyIndex string KeyID = context.Request["KeyID"]; if (KeyID == "") { context.Response.Write("{\"status\":\"没有对象!\"}"); return; } //string ECCode = context.Request["ECCode"]; //string ECName = context.Request["ECName"]; //string KeyEngunit = context.Request["KeyEngunit"]; //string KeyTarget1 = context.Request["KeyTarget1"]; //string KeyTarget2 = context.Request["KeyTarget2"]; string KeyDesign = context.Request["KeyDesign"]; string KeyDiffMoney = context.Request["KeyDiffMoney"]; string KeyOptMoney = context.Request["KeyOptMoney"]; string KeyIndex = context.Request["KeyIndex"]; double dKeyDiffMoney = 0; double dKeyOptMoney = 0; int iKeyIndex = 0; if (!int.TryParse(KeyIndex, out iKeyIndex)) { context.Response.Write("{\"status\":\"序号数字不合法!\"}"); return; } if (!double.TryParse(KeyDiffMoney, out dKeyDiffMoney)) { context.Response.Write("{\"status\":\"偏差奖金数字不合法!\"}"); return; } if (!double.TryParse(KeyOptMoney, out dKeyOptMoney)) { context.Response.Write("{\"status\":\"最优奖金数字不合法!\"}"); return; } AVGEntity kwk = new AVGEntity(); // kwk.KeyID = KeyID; //kwk.ECID = KPI_ECTagDal.GetECIDByCode(ECCode); //kwk.ECCode = ECCode; //kwk.ECName = ECName; //kwk.KeyEngunit = KeyEngunit; //kwk.KeyTarget1 = KeyTarget1 == "NOTAG" ? "" : KeyTarget1; //kwk.KeyTarget2 = KeyTarget2 == "NOTAG" ? "" : KeyTarget2; kwk.KeyDesign = KeyDesign; kwk.KeyDIffMoney = dKeyDiffMoney; kwk.KeyOptMoney = dKeyOptMoney; kwk.KeyIndex = iKeyIndex; if (AVGDal.Update(kwk)) { context.Response.Write("{\"status\":\"ok\"}"); } else { context.Response.Write("{\"status\":\"修改失败!\"}"); return; } }
public void KPI_Average_Add(HttpContext context) { //KeyID,ECCode,ECName,KeyEngunit,KeyTarget1,KeyTarget2,KeyDesign,KeyDiffMoney,KeyOptMoney,KeyIndex string KeyID = Guid.NewGuid().ToString(); string ECCode = context.Request["ECCode"]; string ECName = context.Request["ECName"]; string KeyEngunit = context.Request["KeyEngunit"]; string KeyTarget1 = context.Request["KeyTarget1"]; string KeyTarget2 = context.Request["KeyTarget2"]; string KeyDesign = context.Request["KeyDesign"]; string KeyDiffMoney = context.Request["KeyDiffMoney"]; string KeyOptMoney = context.Request["KeyOptMoney"]; string KeyIndex = context.Request["KeyIndex"]; double dKeyDiffMoney = 0; double dKeyOptMoney = 0; int iKeyIndex = 0; if (!int.TryParse(KeyIndex, out iKeyIndex)) { context.Response.Write("{\"status\":\"序号数字不合法!\"}"); return; } if (!double.TryParse(KeyDiffMoney, out dKeyDiffMoney)) { context.Response.Write("{\"status\":\"偏差奖金数字不合法!\"}"); return; } if (!double.TryParse(KeyOptMoney, out dKeyOptMoney)) { context.Response.Write("{\"status\":\"最优奖金数字不合法!\"}"); return; } if (AVGDal.KeyExists(ECCode)) { context.Response.Write("{\"status\":\"该指标已存在!\"}"); return; } AVGEntity kwk = new AVGEntity(); // kwk.KeyID = Guid.NewGuid().ToString(); kwk.ECID = ECTagDal.GetECIDByCode(ECCode); kwk.ECCode = ECCode; kwk.ECName = ECName; kwk.KeyEngunit = KeyEngunit; kwk.KeyTarget1 = KeyTarget1 == "NOTAG" ? "" : KeyTarget1; kwk.KeyTarget2 = KeyTarget2 == "NOTAG" ? "" : KeyTarget2; kwk.KeyDesign = KeyDesign; kwk.KeyDIffMoney = dKeyDiffMoney; kwk.KeyOptMoney = dKeyOptMoney; kwk.KeyIndex = iKeyIndex; if (AVGDal.Insert(kwk)) { context.Response.Write("{\"status\":\"ok\"}"); } else { context.Response.Write("{\"status\":\"添加失败!\"}"); return; } }