Esempio n. 1
0
 private void Bangding(int assetID)
 {
     AssetUseState at = new AssetUseState();
     at = AssetUseState.Find(assetID);
     this.txtName.Text = at.AssetCurrentUseStateName;
     this.txtRemark.Text = at.AssetCurrentUseStateRemark;
 }
Esempio n. 2
0
        protected void dbStaffList_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            string StyleID = dgAssetType.DataKeys[e.Item.ItemIndex].ToString();
            AssetUseState at = new AssetUseState();
            at.ID = int.Parse(StyleID);
            at.Delete();

            Bangding();
        }
Esempio n. 3
0
        private void Bangding()
        {
            AssetUseState at = new AssetUseState();
            AssetUseState[] atArrary = AssetUseState.FindAll();

            DataTable dt = Converter.ConvertToDataTable(atArrary);
            dt.Columns[0].ColumnName = "ID";
            dt.Columns[1].ColumnName = "Name";
            dt.Columns[2].ColumnName = "Remark";

            this.dgAssetType.DataSource = dt;
            this.dgAssetType.DataBind();
        }
Esempio n. 4
0
        protected void cmdSubmit_Click(object sender, EventArgs e)
        {
            AssetUseState at = new AssetUseState();
            //  at.ID = this.lblAssetID.Text ==""?0:int.Parse(this.lblAssetID.Text);
            at.AssetCurrentUseStateName = this.txtName.Text;
            at.AssetCurrentUseStateRemark = this.txtRemark.Text;

            if (this.lblAssetID.Text == "")
            {
                at.Save();
                Response.Write("<script language=javascript>alert('设备使用状态保存完毕!');</script>");
            }
            else
            {
                at.ID = int.Parse(this.lblAssetID.Text);
                at.Update();
                Response.Write("<script language=javascript>alert('设备使用状态更新完毕!');</script>");
            }
        }