Exemple #1
0
 private void Bangding(int assetID)
 {
     AssetType at = new AssetType();
     at = AssetType.Find(assetID);
     this.txtAssetTypeName.Text = at.AssetTypeName;
     this.txtRemark.Text = at.AssetTypeRemark;
 }
        protected void dbStaffList_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            string StyleID = dgAssetType.DataKeys[e.Item.ItemIndex].ToString();
            AssetType at = new AssetType();
            at.ID = int.Parse(StyleID);
            at.Delete();

            Bangding();
        }
        private void Bangding()
        {
            AssetType at = new AssetType();
            AssetType[] atArrary = AssetType.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();
        }
Exemple #4
0
 public void SaveOrUpdate()
 {
     AssetType at = new AssetType();
        at = AssetType.Find(this.ID);//.Find(this.PlanObjectType, this.PlanPeriodType, this.PlanYear, this.PlanPeriod, this.PlanCreator);
        if (at != null)
        {
        at.AssetTypeName = this.AssetTypeName;
        at.AssetTypeRemark = this.AssetTypeRemark;
        at.Update();
        }
        else
        {
        this.Save();
        }
 }
Exemple #5
0
        protected void cmdSubmit_Click(object sender, EventArgs e)
        {
            AssetType at = new AssetType();
              //  at.ID = this.lblAssetID.Text ==""?0:int.Parse(this.lblAssetID.Text);
            at.AssetTypeName = this.txtAssetTypeName.Text;
            at.AssetTypeRemark = 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>");
            }
        }