public Assetremovedetail CreateAssetremovedetail(Assetremovedetail info)
 {
     try
     {
         Management.BeginTransaction();
         Management.CreateAssetremovedetail(info);
         Management.Commit();
     }
     catch
     {
         Management.Rollback();
         throw;
     }
     return info;
 }
        public Assetremovedetail CreateAssetremovedetail(Assetremovedetail info)
        {
            try
            {
                string sqlCommand = @"INSERT INTO ""ASSETREMOVEDETAIL"" (""DETAILID"",""ASSETREMOVEID"",""ASSETNO"",""PLANREMOVEDATE"",""ACTUALREMOVEDATE"",""REMOVEDCONTENT"") VALUES (:Detailid,:Assetremoveid,:Assetno,:Planremovedate,:Actualremovedate,:Removedcontent)";
                this.Database.AddInParameter(":Detailid", info.Detailid);//DBType:VARCHAR2
                this.Database.AddInParameter(":Assetremoveid", info.Assetremoveid);//DBType:VARCHAR2
                this.Database.AddInParameter(":Assetno", info.Assetno);//DBType:VARCHAR2
                this.Database.AddInParameter(":Planremovedate", info.Planremovedate);//DBType:DATE
                this.Database.AddInParameter(":Actualremovedate", info.Actualremovedate);//DBType:DATE
                this.Database.AddInParameter(":Removedcontent", info.Removedcontent);//DBType:NVARCHAR2
                this.Database.ExecuteNonQuery(sqlCommand);

            }
            finally
            {
                this.Database.ClearParameter();
            }
            return info;
        }
 public Assetremovedetail UpdateAssetremovedetailByDetailid(Assetremovedetail info)
 {
     try
     {
         this.Database.AddInParameter(":Detailid", info.Detailid);//DBType:VARCHAR2
         this.Database.AddInParameter(":Assetremoveid", info.Assetremoveid);//DBType:VARCHAR2
         this.Database.AddInParameter(":Assetno", info.Assetno);//DBType:VARCHAR2
         this.Database.AddInParameter(":Planremovedate", info.Planremovedate);//DBType:DATE
         this.Database.AddInParameter(":Actualremovedate", info.Actualremovedate);//DBType:DATE
         this.Database.AddInParameter(":Removedcontent", info.Removedcontent);//DBType:NVARCHAR2
         string sqlCommand = @"UPDATE ""ASSETREMOVEDETAIL"" SET  ""ASSETREMOVEID""=:Assetremoveid , ""ASSETNO""=:Assetno , ""PLANREMOVEDATE""=:Planremovedate , ""ACTUALREMOVEDATE""=:Actualremovedate , ""REMOVEDCONTENT""=:Removedcontent WHERE  ""DETAILID""=:Detailid";
         this.Database.ExecuteNonQuery(sqlCommand);
     }
     finally
     {
         this.Database.ClearParameter();
     }
     return info;
 }
 protected void ucSelectedMultiAssets_SelectAssetChange(object sender, EventArgs e)
 {
     if (ucSelectedMultiAssets.AssetIds.Count > 0)
     {
         //更新设备列表
         var assetNos = new List<string>();
         foreach (var assetNo in ucSelectedMultiAssets.AssetIds)
         {
             if (RemoveDetail.Where(p => p.Assetno == assetNo).Count() == 0) { assetNos.Add(assetNo); }
         }
         var assetInfos = AssetService.RetrieveAssetByAssetno(assetNos);
         if (assetInfos.Count > 0)
         {
             foreach (var entity in assetInfos)
             {
                 Assetremovedetail data = new Assetremovedetail();
                 data.Detailid = Guid.NewGuid().ToString("N");
                 data.Assetno = entity.Assetno;//设备编号
                 data.Assetcategoryid = entity.Assetcategoryid;//设备类别
                 data.Assetname = entity.Assetname;//设备名称
                 //data.Storage = entity.Storage;//存放地点
                 data.State = entity.State;//设备状态
                 //data.Depreciationyear = entity.Depreciationyear;//折旧年限
                 data.Unitprice = entity.Unitprice;//单价
                 data.Brand = entity.Brand;//品牌
                 //data.Managemode = entity.Managemode;//管理模式,托管:0自管:1
                 data.Financecategory = entity.Financecategory;//财务类别(A帐:0B帐:1)
                 //data.Supplierid = entity.Supplierid;//供应商
                 data.Purchasedate = entity.Purchasedate;//购入日期
                 //data.Expireddate = entity.Expireddate;//折旧到期日期
                 //data.Assetspecification = entity.Assetspecification;//设备规格
                 //data.Storageflag = entity.Storageflag;//存放地点标识来源
                 //data.Subcompany = entity.Subcompany;//分公司
                 //data.Contractid = entity.Contractid;//合同编号
                 //data.Contractdetailid = entity.Contractdetailid;//合同明细编号
                 RemoveDetail.Add(data);
             }
             BindDetails();
         }
     }
 }