public int InsertAllottedQuantity(AllotedQuantityDTO allottedQty)
 {
     allotedquantity allottedQuantityEntity = new allotedquantity();
     AutoMapper.Mapper.Map(allottedQty, allottedQuantityEntity);
     ESalesUnityContainer.Container.Resolve<IGenericRepository<allotedquantity>>().Save(allottedQuantityEntity);
     return allottedQuantityEntity.Alloted_Id;
 }
     private void Fixupallotedquantity(allotedquantity previousValue)
     {
         if (previousValue != null && previousValue.customermaterialmaps.Contains(this))
         {
             previousValue.customermaterialmaps.Remove(this);
         }
 
         if (allotedquantity != null)
         {
             if (!allotedquantity.customermaterialmaps.Contains(this))
             {
                 allotedquantity.customermaterialmaps.Add(this);
             }
             if (Cust_Mat_AllotedQuantityId != allotedquantity.Alloted_Id)
             {
                 Cust_Mat_AllotedQuantityId = allotedquantity.Alloted_Id;
             }
         }
     }