public void SaveBranchDeal(BranchOfficeManagementModel modelTosave, int BranchOfficeId, int ProductId, int CreatedBy) { Air_AdminBranchDealAssociations datamodel = new Air_AdminBranchDealAssociations(); datamodel.BranchOfficeId = BranchOfficeId; datamodel.ProductId = ProductId; if (ProductId == 1) { datamodel.DealMasterId = modelTosave.MasterDealIdOfAirlines; } else if (ProductId == 2) { datamodel.DealMasterId = modelTosave.MasterDealIdOfHotel; } else if (ProductId == 3) { datamodel.DealMasterId = modelTosave.MasterDealIdOfMobile; } else if (ProductId == 4) { datamodel.DealMasterId = modelTosave.MasterDealIdOfBus; } datamodel.CreatedBy = CreatedBy; datamodel.CreatedDate = DateTime.Now; entityModel.AddToAir_AdminBranchDealAssociations(datamodel); entityModel.SaveChanges(); }
public void UpdateBranchDeal(BranchOfficeManagementModel model, int ProductID, int BranchOfficeId) { Air_AdminBranchDealAssociations tu = entityModel.Air_AdminBranchDealAssociations.Where(u => u.BranchOfficeId == BranchOfficeId && u.ProductId == ProductID).FirstOrDefault(); if (tu != null) { if (ProductID == 1) { tu.DealMasterId = model.MasterDealIdOfAirlines; } else if (ProductID == 2) { tu.DealMasterId = model.MasterDealIdOfHotel; } else if (ProductID == 3) { tu.DealMasterId = model.MasterDealIdOfMobile; } else if (ProductID == 4) { tu.DealMasterId = model.MasterDealIdOfBus; } entityModel.ApplyCurrentValues(tu.EntityKey.EntitySetName, tu); entityModel.SaveChanges(); } }
public void DeleteBranchDistributorAgentSettingDeal(int id, int productid) { if (entityModel.Air_AdminBranchDealAssociations.Where(x => x.BranchOfficeId == id && x.ProductId == productid).Count() > 0) { Air_AdminBranchDealAssociations datatodelete = entityModel.Air_AdminBranchDealAssociations.First(m => m.BranchOfficeId == id && m.ProductId == productid); entityModel.DeleteObject(datatodelete); entityModel.SaveChanges(); } }
public bool CheckIFDealExistForBranch(int BranchOfficeId, int productid) { Air_AdminBranchDealAssociations deal = entityModel.Air_AdminBranchDealAssociations.Where(u => u.BranchOfficeId == BranchOfficeId && u.ProductId == productid).FirstOrDefault(); if (deal != null) { return(true); } else { return(false); } }
public void SaveBranchDistributorAgentSettingDeal(AgentSettingModel modelTosave, int agentid, int ProductId, int CreatedBy) { Air_AdminBranchDealAssociations datamodel = new Air_AdminBranchDealAssociations(); datamodel.BranchOfficeId = agentid; datamodel.ProductId = ProductId; if (ProductId == 1) { datamodel.DealMasterId = modelTosave.MasterDealIdOfAirlines; } else if (ProductId == 2) { datamodel.DealMasterId = modelTosave.MasterDealIdOfHotel; } datamodel.CreatedBy = CreatedBy; datamodel.CreatedDate = DateTime.Now; entityModel.AddToAir_AdminBranchDealAssociations(datamodel); entityModel.SaveChanges(); }
public void UpdateBranchDistributorAgentSettingDeal(AgentSettingModel model, int ProductID, int AgentId) { Air_AdminBranchDealAssociations tu = entityModel.Air_AdminBranchDealAssociations.Where(u => u.BranchOfficeId == AgentId && u.ProductId == ProductID).FirstOrDefault(); if (tu != null) { if (ProductID == 1) { tu.DealMasterId = model.MasterDealIdOfAirlines; } else if (ProductID == 2) { tu.DealMasterId = model.MasterDealIdOfHotel; } entityModel.ApplyCurrentValues(tu.EntityKey.EntitySetName, tu); entityModel.SaveChanges(); } }