public Assetmovedetail CreateAssetmovedetail(Assetmovedetail info)
 {
     try
     {
         Management.BeginTransaction();
         Management.CreateAssetmovedetail(info);
         Management.Commit();
     }
     catch
     {
         Management.Rollback();
         throw;
     }
     return info;
 }
        public Assetmovedetail CreateAssetmovedetail(Assetmovedetail info)
        {
            try
            {
                string sqlCommand = @"INSERT INTO ""ASSETMOVEDETAIL"" (""DETAILID"",""ASSETMOVEID"",""ASSETNO"",""PLANMOVEDATE"",""ACTUALMOVEDATE"",""MOVEDCONTENT"") VALUES (:Detailid,:Assetmoveid,:Assetno,:Planmovedate,:Actualmovedate,:Movedcontent)";
                this.Database.AddInParameter(":Detailid", info.Detailid);//DBType:VARCHAR2
                this.Database.AddInParameter(":Assetmoveid", info.Assetmoveid);//DBType:VARCHAR2
                this.Database.AddInParameter(":Assetno", info.Assetno);//DBType:VARCHAR2
                this.Database.AddInParameter(":Planmovedate", info.Planmovedate);//DBType:DATE
                this.Database.AddInParameter(":Actualmovedate", info.Actualmovedate);//DBType:DATE
                this.Database.AddInParameter(":Movedcontent", info.Movedcontent);//DBType:NVARCHAR2
                this.Database.ExecuteNonQuery(sqlCommand);

            }
            finally
            {
                this.Database.ClearParameter();
            }
            return info;
        }
 public Assetmovedetail UpdateAssetmovedetailByDetailid(Assetmovedetail info)
 {
     try
     {
         this.Database.AddInParameter(":Detailid", info.Detailid);//DBType:VARCHAR2
         this.Database.AddInParameter(":Assetmoveid", info.Assetmoveid);//DBType:VARCHAR2
         this.Database.AddInParameter(":Assetno", info.Assetno);//DBType:VARCHAR2
         this.Database.AddInParameter(":Planmovedate", info.Planmovedate);//DBType:DATE
         this.Database.AddInParameter(":Actualmovedate", info.Actualmovedate);//DBType:DATE
         this.Database.AddInParameter(":Movedcontent", info.Movedcontent);//DBType:NVARCHAR2
         string sqlCommand = @"UPDATE ""ASSETMOVEDETAIL"" SET  ""ASSETMOVEID""=:Assetmoveid , ""ASSETNO""=:Assetno , ""PLANMOVEDATE""=:Planmovedate , ""ACTUALMOVEDATE""=:Actualmovedate , ""MOVEDCONTENT""=:Movedcontent 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 (Details.Where(p => p.Assetno == assetNo).Count() == 0) { assetNos.Add(assetNo); }
         }
         var assetInfos = AssetService.RetrieveAssetByAssetno(assetNos);
         if (assetInfos.Count > 0)
         {
             foreach (var entity in assetInfos)
             {
                 var data = new Assetmovedetail();
                 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;//合同明细编号
                 Details.Add(data);
             }
             LoadDetailList();
         }
     }
 }