public bool Delete_Core_DistributorDealMasters(int masterDealId, int userId)
        {
            Core_DistributorDealMasters result = ent.Core_DistributorDealMasters.Where(x => x.DistributorDealMasterId == masterDealId).FirstOrDefault();

            ent.DeleteObject(result);
            ent.SaveChanges();
            // ent.Core_SaveChangesOnDistributorMasterDeal(masterDealId, userId, "D", false);
            return(true);
        }
        public void AddDistributorDealMaster(MasterBranchDealviewModel model, int productId)
        {
            Core_DistributorDealMasters datamodel = new Core_DistributorDealMasters
            {
                DistributorDealName = model.DistributorCode + "-" + model.DealName,
                ProductId           = productId,
                DistributorId       = model.BranchOfficeId,
                CreatedBy           = model.CreatedBy,
                CreatedDate         = DateTime.Now,
            };

            ent.AddToCore_DistributorDealMasters(datamodel);
            ent.SaveChanges();
        }