Esempio n. 1
0
        public override bool Update(TransactionManager transactionManager, MaterialPurchas entity)
        {
            SqlDatabase database = new SqlDatabase(this._connectionString);
            DbCommand   command  = StoredProcedureProvider.GetCommandWrapper(database, "dbo.MaterialPurchas_Update", this._useStoredProcedure);

            database.AddInParameter(command, "@MaterialPurchasID", DbType.Int32, entity.MaterialPurchasID);
            database.AddInParameter(command, "@MaterialPurchasCode", DbType.AnsiString, entity.MaterialPurchasCode);
            database.AddInParameter(command, "@PurchasUnitCode", DbType.AnsiString, entity.PurchasUnitCode);
            database.AddInParameter(command, "@PurchasDate", DbType.DateTime, entity.PurchasDate.HasValue ? ((object)entity.PurchasDate) : ((object)DBNull.Value));
            database.AddInParameter(command, "@ProjectCode", DbType.AnsiString, entity.ProjectCode);
            database.AddInParameter(command, "@Title", DbType.AnsiString, entity.Title);
            database.AddInParameter(command, "@Description", DbType.AnsiString, entity.Description);
            database.AddInParameter(command, "@FollowUserCode", DbType.AnsiString, entity.FollowUserCode);
            database.AddInParameter(command, "@Status", DbType.AnsiString, entity.Status);
            int num = 0;

            if (transactionManager != null)
            {
                num = Utility.ExecuteNonQuery(transactionManager, command);
            }
            else
            {
                num = Utility.ExecuteNonQuery(database, command);
            }
            if (DataRepository.Provider.EnableEntityTracking)
            {
                EntityManager.StopTracking(entity.EntityTrackingKey);
            }
            entity.AcceptChanges();
            return(Convert.ToBoolean(num));
        }
Esempio n. 2
0
 public MaterialPurchasDtlBase()
 {
     this.inTxn = false;
     this._materialPurchasIDSource = null;
     this._site      = null;
     this.entityData = new MaterialPurchasDtlEntityData();
     this.backupData = null;
 }
Esempio n. 3
0
        public static MaterialPurchas CreateMaterialPurchas(string materialPurchasMaterialPurchasCode, string materialPurchasPurchasUnitCode, DateTime?materialPurchasPurchasDate, string materialPurchasProjectCode, string materialPurchasTitle, string materialPurchasDescription, string materialPurchasFollowUserCode, string materialPurchasStatus)
        {
            MaterialPurchas purchas = new MaterialPurchas();

            purchas.MaterialPurchasCode = materialPurchasMaterialPurchasCode;
            purchas.PurchasUnitCode     = materialPurchasPurchasUnitCode;
            purchas.PurchasDate         = materialPurchasPurchasDate;
            purchas.ProjectCode         = materialPurchasProjectCode;
            purchas.Title          = materialPurchasTitle;
            purchas.Description    = materialPurchasDescription;
            purchas.FollowUserCode = materialPurchasFollowUserCode;
            purchas.Status         = materialPurchasStatus;
            return(purchas);
        }
Esempio n. 4
0
 public MaterialPurchasDtlBase(int?materialPurchasDtlMaterialPurchasID, string materialPurchasDtlTypeStandard, string materialPurchasDtlUnit, decimal?materialPurchasDtlNumber, DateTime?materialPurchasDtlNeedDate, DateTime?materialPurchasDtlSignDate, string materialPurchasDtlSearchPriceDtl, decimal?materialPurchasDtlFinalPrice)
 {
     this.inTxn = false;
     this._materialPurchasIDSource = null;
     this._site             = null;
     this.entityData        = new MaterialPurchasDtlEntityData();
     this.backupData        = null;
     this.MaterialPurchasID = materialPurchasDtlMaterialPurchasID;
     this.TypeStandard      = materialPurchasDtlTypeStandard;
     this.Unit           = materialPurchasDtlUnit;
     this.Number         = materialPurchasDtlNumber;
     this.NeedDate       = materialPurchasDtlNeedDate;
     this.SignDate       = materialPurchasDtlSignDate;
     this.SearchPriceDtl = materialPurchasDtlSearchPriceDtl;
     this.FinalPrice     = materialPurchasDtlFinalPrice;
 }
Esempio n. 5
0
        public virtual MaterialPurchas Copy()
        {
            MaterialPurchas purchas = new MaterialPurchas();

            purchas.MaterialPurchasID   = this.MaterialPurchasID;
            purchas.MaterialPurchasCode = this.MaterialPurchasCode;
            purchas.PurchasUnitCode     = this.PurchasUnitCode;
            purchas.PurchasDate         = this.PurchasDate;
            purchas.ProjectCode         = this.ProjectCode;
            purchas.Title          = this.Title;
            purchas.Description    = this.Description;
            purchas.FollowUserCode = this.FollowUserCode;
            purchas.Status         = this.Status;
            purchas.AcceptChanges();
            return(purchas);
        }
 internal override void DeepLoad(TransactionManager transactionManager, MaterialPurchasDtl entity, bool deep, DeepLoadType deepLoadType, Type[] childTypes, ChildEntityTypesList innerList)
 {
     if ((entity != null) && (base.CanDeepLoad(entity, "MaterialPurchas", "MaterialPurchasIDSource", deepLoadType, innerList) && (entity.MaterialPurchasIDSource == null)))
     {
         object[] pkItems           = new object[1];
         int?     materialPurchasID = entity.MaterialPurchasID;
         pkItems[0] = materialPurchasID.HasValue ? materialPurchasID.GetValueOrDefault() : 0;
         MaterialPurchas purchas = EntityManager.LocateEntity <MaterialPurchas>(EntityLocator.ConstructKeyFromPkItems(typeof(MaterialPurchas), pkItems), DataRepository.Provider.EnableEntityTracking);
         if (purchas != null)
         {
             entity.MaterialPurchasIDSource = purchas;
         }
         else
         {
             materialPurchasID = entity.MaterialPurchasID;
             entity.MaterialPurchasIDSource = DataRepository.MaterialPurchasProvider.GetByMaterialPurchasID(materialPurchasID.HasValue ? materialPurchasID.GetValueOrDefault() : 0);
         }
         if (deep && (entity.MaterialPurchasIDSource != null))
         {
             DataRepository.MaterialPurchasProvider.DeepLoad(transactionManager, entity.MaterialPurchasIDSource, deep, deepLoadType, childTypes, innerList);
         }
     }
 }