/// <summary>
        /// Save And Update Truck Make
        /// </summary>
        /// <param name="truckMakeDetail"></param>
        /// <returns></returns>
        public int SaveAndUpdateTruckMake(TruckMakeDTO truckMakeDetail)
        {
            truckmake truckmakeEntity = new truckmake();
            AutoMapper.Mapper.Map(truckMakeDetail, truckmakeEntity);

            if (truckMakeDetail.TruckMake_Id == 0)
            {
                ESalesUnityContainer.Container.Resolve<IGenericRepository<truckmake>>().Save(truckmakeEntity);
            }
            else
            {
                ESalesUnityContainer.Container.Resolve<IGenericRepository<truckmake>>().Update(truckmakeEntity);
            }

            //return the value
            return truckmakeEntity.TruckMake_Id;
        }
示例#2
0
     private void Fixuptruckmake(truckmake previousValue)
     {
         if (previousValue != null && previousValue.truckdetails.Contains(this))
         {
             previousValue.truckdetails.Remove(this);
         }
 
         if (truckmake != null)
         {
             if (!truckmake.truckdetails.Contains(this))
             {
                 truckmake.truckdetails.Add(this);
             }
             if (Truck_Make != truckmake.TruckMake_Id)
             {
                 Truck_Make = truckmake.TruckMake_Id;
             }
         }
     }
     private void Fixuptruckmake(truckmake previousValue)
     {
         if (previousValue != null && previousValue.standalonetrucks.Contains(this))
         {
             previousValue.standalonetrucks.Remove(this);
         }
 
         if (truckmake != null)
         {
             if (!truckmake.standalonetrucks.Contains(this))
             {
                 truckmake.standalonetrucks.Add(this);
             }
             if (StandaloneTruck_Make != truckmake.TruckMake_Id)
             {
                 StandaloneTruck_Make = truckmake.TruckMake_Id;
             }
         }
     }