Esempio n. 1
0
        public void BindKeys(string WebCode)
        {
            DataTable dt = KPI_WebKeyDal.GetKeyList(WebCode);

            gvData.DataSource = dt;
            gvData.DataBind();
        }
Esempio n. 2
0
        public void KPI_SubWeb_Edit(HttpContext context)
        {
            string KeyID = context.Request["KeyID"];

            if (KeyID == "")
            {
                context.Response.Write("{\"status\":\"没有对象!\"}");
                return;
            }

            //string WebCode = context.Request["WebCode"];
            //string ECCode = context.Request["ECCode"];
            //string ECName = context.Request["ECName"];
            //string KeyEngunit = context.Request["KeyEngunit"];
            //string KeyCalcType = context.Request["KeyCalcType"];
            string KeyIndex  = context.Request["KeyIndex"];
            int    iKeyIndex = 0;

            if (!int.TryParse(KeyIndex, out iKeyIndex))
            {
                context.Response.Write("{\"status\":\"序号数字不合法!\"}");
                return;
            }

            //if (KPI_WebKeyDal.KeyExists(ECCode, WebCode))
            //{
            //    context.Response.Write("{\"status\":\"该指标已存在!\"}");
            //    return;
            //}

            KPI_WebKeyEntity kwk = new KPI_WebKeyEntity();

            //
            kwk.KeyID = KeyID;
            //kwk.ECID = KPI_ECTagDal.GetECIDByCode(ECCode);
            //kwk.ECCode = ECCode;
            //kwk.ECName = ECName;
            //kwk.WebCode = WebCode;
            //kwk.KeyEngunit = KeyEngunit;
            //kwk.KeyCalcType = int.Parse(KeyCalcType);
            kwk.KeyIndex   = iKeyIndex;
            kwk.KeyIsValid = 1;

            //kwk.KeyNote = "";
            //kwk.KeyCreateTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
            kwk.KeyModifyTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");

            if (KPI_WebKeyDal.Update(kwk))
            {
                context.Response.Write("{\"status\":\"ok\"}");
            }
            else
            {
                context.Response.Write("{\"status\":\"修改失败!\"}");
                return;
            }
        }
Esempio n. 3
0
        void BindGrid()
        {
            lblInfor2.Text = "" + WebCode;

            gvTable = KPI_WebKeyDal.GetDisplayForSort(WebCode);

            gvData.DataSource = gvTable;

            gvData.DataBind();
        }
Esempio n. 4
0
        public void KPI_SubWeb_Del(HttpContext context)
        {
            string KeyID = context.Request["KeyID"];

            if (KPI_WebKeyDal.DeleteKey(KeyID))
            {
                context.Response.Write("{\"status\":\"ok\"}");
            }
            else
            {
                context.Response.Write("{\"status\":\"删除失败!\"}");
            }
        }
Esempio n. 5
0
        public void KPI_SubWeb_Add(HttpContext context)
        {
            //KeyID,WebCode,ECCode,ECName,KeyEngunit,KeyCalcType,KeyIndex
            string KeyID       = Guid.NewGuid().ToString();
            string WebCode     = context.Request["WebCode"];
            string ECCode      = context.Request["ECCode"];
            string ECName      = context.Request["ECName"];
            string KeyEngunit  = context.Request["KeyEngunit"];
            string KeyCalcType = context.Request["KeyCalcType"];
            string KeyIndex    = context.Request["KeyIndex"];
            int    iKeyIndex   = 0;

            if (!int.TryParse(KeyIndex, out iKeyIndex))
            {
                context.Response.Write("{\"status\":\"序号数字不合法!\"}");
                return;
            }

            if (KPI_WebKeyDal.KeyExists(ECCode, WebCode))
            {
                context.Response.Write("{\"status\":\"该指标已存在!\"}");
                return;
            }

            KPI_WebKeyEntity kwk = new KPI_WebKeyEntity();

            //
            kwk.KeyID       = KeyID;
            kwk.ECID        = ECTagDal.GetECIDByCode(ECCode);
            kwk.ECCode      = ECCode;
            kwk.ECName      = ECName;
            kwk.WebCode     = WebCode;
            kwk.KeyEngunit  = KeyEngunit;
            kwk.KeyCalcType = int.Parse(KeyCalcType);
            kwk.KeyIndex    = iKeyIndex;
            kwk.KeyIsValid  = 1;

            kwk.KeyNote       = "";
            kwk.KeyCreateTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
            kwk.KeyModifyTime = kwk.KeyCreateTime;

            if (KPI_WebKeyDal.Insert(kwk))
            {
                context.Response.Write("{\"status\":\"ok\"}");
            }
            else
            {
                context.Response.Write("{\"status\":\"添加失败!\"}");
                return;
            }
        }
Esempio n. 6
0
        /// <summary>
        /// 机组信息
        /// </summary>
        void BindValue()
        {
            if (WebCode == "")
            {
                return;
            }

            DateTime StartTime = DateTime.Now;
            DateTime EndTime   = DateTime.Now;

            //都是 日期的形式
            if (!DateTime.TryParse(txt_ST.Value, out StartTime) ||
                !DateTime.TryParse(txt_ET.Value, out EndTime) ||
                StartTime >= EndTime)
            {
                MessageBox.popupClientMessage(this.Page, "时间格式不正确 或 时间范围不正确!");
                return;
            }

            //加 1小时
            StartTime = StartTime.AddHours(1);
            EndTime   = EndTime.AddHours(1);

            string UnitID = ddlUnit.SelectedValue;
            //WebCode


            //得分、得分率、合格率、最大值、最小值、算数平均值、加权平均值、累计值、累计除法
            string calctype = KPI_WebKeyDal.GetCalcType(WebCode);

            DataTable dtValue = ECSSArchiveDal.GetForShiftValue(UnitID, WebCode, calctype, StartTime, EndTime);

            DataTable dtGD = ConvertToTable(dtValue, calctype);

            //第1列为名称,必须为0;
            totalvalue = new double[dtGD.Columns.Count];
            //初始化
            for (int x = 0; x < totalvalue.Length; x++)
            {
                totalvalue[x] = 0;
            }

            gvData.DataSource = dtGD;
            gvData.DataBind();
        }
Esempio n. 7
0
        protected void btnApply_Click(object sender, EventArgs e)
        {
            if (gvTable.Rows.Count <= 0)
            {
                return;
            }

            for (int i = 0; i < gvTable.Rows.Count; i++)
            {
                KPI_WebKeyEntity csE = new KPI_WebKeyEntity();
                csE.KeyID    = gvTable.Rows[i]["KeyID"].ToString();
                csE.KeyIndex = (10 + i);

                KPI_WebKeyDal.Update(csE);
            }

            MessageBox.popupClientMessage(this.Page, "排序成功!", "call();");
        }
Esempio n. 8
0
        /// <summary>
        /// 机组信息
        /// </summary>
        void BindValue()
        {
            if (WebCode == "")
            {
                return;
            }

            DateTime StartTime = DateTime.Now;
            DateTime EndTime   = DateTime.Now;

            //都是 日期的形式
            if (!DateTime.TryParse(txt_ST.Value, out StartTime) ||
                !DateTime.TryParse(txt_ET.Value, out EndTime) ||
                StartTime >= EndTime)
            {
                MessageBox.popupClientMessage(this.Page, "时间格式不正确 或 时间范围不正确!");
                return;
            }

            //加 1小时
            StartTime = StartTime.AddHours(1);
            EndTime   = EndTime.AddHours(1);


            string shiftname = ddlShift.SelectedItem.Text;

            if (shiftname == "全部")
            {
                shiftname = "";
            }
            //WebCode

            //得分、得分率、合格率、最大值、最小值、算数平均值、加权平均值、累计值、累计除法
            string calctype = KPI_WebKeyDal.GetCalcType(WebCode);

            DataTable dtValue = ECSSArchiveDal.GetForUnitValue(shiftname, WebCode, calctype, StartTime, EndTime);

            DataTable dtGD = ConvertToTable(dtValue, calctype);

            gvData.DataSource = dtGD;
            gvData.DataBind();
        }