示例#1
0
 private void ShowInfo(int Id)
 {
     ESMonitor.BLL.Stats   bll   = new ESMonitor.BLL.Stats();
     ESMonitor.Model.Stats model = bll.GetModel(Id);
     this.lblId.Text           = model.Id.ToString();
     this.lblStatCode.Text     = model.StatCode;
     this.lblStatName.Text     = model.StatName;
     this.lblChargeMan.Text    = model.ChargeMan;
     this.lblTelepone.Text     = model.Telepone;
     this.lblLongitude.Text    = model.Longitude.ToString();
     this.lblDepartment.Text   = model.Department;
     this.lblAdress.Text       = model.Adress;
     this.lblCountry.Text      = model.Country;
     this.lblStreet.Text       = model.Street;
     this.lblSquare.Text       = model.Square.ToString();
     this.lblProStartTime.Text = model.ProStartTime.ToString();
     this.lblStage.Text        = model.Stage.ToString();
 }
示例#2
0
        protected void GetDevs()
        {
            string  statId   = Request.Params["sid"];
            string  strWhere = "StatId =" + statId;
            DataSet ds       = bll.GetList(strWhere);

            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    ListItem item = new ListItem {
                        Text = dr["DevCode"].ToString(), Value = dr["Id"].ToString()
                    };
                    controlPreset.Items.Add(item);
                }
                devId.Value   = controlPreset.SelectedValue;
                devCode.Value = Server.UrlEncode(controlPreset.SelectedItem.Text);
            }
            ESMonitor.BLL.Stats bllstat = new ESMonitor.BLL.Stats();
            statName = bllstat.GetModel(int.Parse(statId)).StatName;
            DevName  = controlPreset.SelectedItem.Text;
        }
示例#3
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtStatCode.Text.Trim().Length == 0)
            {
                strErr += "StatCode不能为空!\\n";
            }
            if (this.txtStatName.Text.Trim().Length == 0)
            {
                strErr += "StatName不能为空!\\n";
            }
            if (this.txtChargeMan.Text.Trim().Length == 0)
            {
                strErr += "ChargeMan不能为空!\\n";
            }
            if (this.txtTelepone.Text.Trim().Length == 0)
            {
                strErr += "Telepone不能为空!\\n";
            }
            if (!PageValidate.IsDecimal(txtLongitude.Text))
            {
                strErr += "Longitude格式错误!\\n";
            }
            if (this.txtDepartment.Text.Trim().Length == 0)
            {
                strErr += "Department不能为空!\\n";
            }
            if (this.txtAdress.Text.Trim().Length == 0)
            {
                strErr += "Adress不能为空!\\n";
            }
            if (this.txtCountry.Text.Trim().Length == 0)
            {
                strErr += "Country不能为空!\\n";
            }
            if (this.txtStreet.Text.Trim().Length == 0)
            {
                strErr += "Street不能为空!\\n";
            }
            if (!PageValidate.IsDecimal(txtSquare.Text))
            {
                strErr += "Square格式错误!\\n";
            }
            if (!PageValidate.IsDateTime(txtProStartTime.Text))
            {
                strErr += "ProStartTime格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtStage.Text))
            {
                strErr += "Stage格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int      Id           = int.Parse(this.lblId.Text);
            string   StatCode     = this.txtStatCode.Text;
            string   StatName     = this.txtStatName.Text;
            string   ChargeMan    = this.txtChargeMan.Text;
            string   Telepone     = this.txtTelepone.Text;
            decimal  Longitude    = decimal.Parse(this.txtLongitude.Text);
            string   Department   = this.txtDepartment.Text;
            string   Adress       = this.txtAdress.Text;
            string   Country      = this.txtCountry.Text;
            string   Street       = this.txtStreet.Text;
            decimal  Square       = decimal.Parse(this.txtSquare.Text);
            DateTime ProStartTime = DateTime.Parse(this.txtProStartTime.Text);
            int      Stage        = int.Parse(this.txtStage.Text);


            ESMonitor.Model.Stats model = new ESMonitor.Model.Stats();
            model.Id           = Id;
            model.StatCode     = StatCode;
            model.StatName     = StatName;
            model.ChargeMan    = ChargeMan;
            model.Telepone     = Telepone;
            model.Longitude    = Longitude;
            model.Department   = Department;
            model.Adress       = Adress;
            model.Country      = Country;
            model.Street       = Street;
            model.Square       = Square;
            model.ProStartTime = ProStartTime;
            model.Stage        = Stage;

            ESMonitor.BLL.Stats bll = new ESMonitor.BLL.Stats();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }