/// <summary>
        /// 编辑数据
        /// </summary>
        /// <returns></returns>
        bool Update()
        {
            string plantid = ViewState["plantid"].ToString();

            KPI_PlantEntity mEntity = new KPI_PlantEntity();

            mEntity.PlantID = plantid;
            mEntity.PlantCode = txt_PlantCode.Value.Trim();
            mEntity.PlantName = txt_PlantName.Value.Trim();
            mEntity.PlantDesc = txt_PlantDesc.Value.Trim();
            mEntity.PlantIndex = int.Parse(txt_PlantIndex.Value.Trim());
            mEntity.PlantIsValid = int.Parse(ddl_PlantIsValid.Value);
            mEntity.PlantAddress = txt_PlantAddress.Value.Trim();
            mEntity.PlantNote = txt_PlantNote.Value.Trim();

            //mEntity.PlantCreateTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
            mEntity.PlantModifyTime = mEntity.PlantCreateTime;

            return KPI_PlantDal.Update(mEntity);
        }
        /// <summary>
        /// 插入数据
        /// </summary>
        /// <returns></returns>
        bool Insert()
        {
            string plantid = PageControl.GetGuid();

            KPI_PlantEntity mEntity = new KPI_PlantEntity();

            mEntity.PlantID = plantid;
            mEntity.PlantCode = txt_PlantCode.Value.Trim();
            mEntity.PlantName = txt_PlantName.Value.Trim();
            mEntity.PlantDesc = txt_PlantDesc.Value.Trim();
            mEntity.PlantIndex = int.Parse(txt_PlantIndex.Value.Trim());
            mEntity.PlantIsValid = int.Parse(ddl_PlantIsValid.Value);
            mEntity.PlantAddress = txt_PlantAddress.Value.Trim();
            mEntity.PlantNote = txt_PlantNote.Value.Trim();

            mEntity.PlantCreateTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
            mEntity.PlantModifyTime = mEntity.PlantCreateTime;

            return KPI_PlantDal.Insert(mEntity);
        }