示例#1
0
        internal int UpdateCleanseMatchExclusions(CleanseMatchExclusionsEntity obj)
        {
            int result = 0;

            try
            {
                var dict = obj.ToDictionary();
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "dnb.UpdateCleanseMatchExclusions";
                for (int index = 1; index <= 5; index++)
                {
                    object Id       = dict["CleanseMatchExclusionId" + index];
                    object IsActive = dict["Active" + index];
                    object Tags     = dict["Tags" + index];
                    sproc.StoredProceduresParameter.Add(GetParam("@CleanseMatchExclusionId", Convert.ToString(Id), SQLServerDatatype.IntDataType));
                    sproc.StoredProceduresParameter.Add(GetParam("@Active", Convert.ToString(IsActive), SQLServerDatatype.BitDataType));
                    sproc.StoredProceduresParameter.Add(GetParam("@Tags", Convert.ToString(Tags), SQLServerDatatype.VarcharDataType));
                    result = Convert.ToInt32(sql.ExecuteScalar(CommandType.StoredProcedure, sproc));
                    sproc  = new StoredProcedureEntity();
                    sproc.StoredProcedureName = "dnb.UpdateCleanseMatchExclusions";
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(result);
        }
        public void CleanseMatchExclusions(string ExcludeNonHeadQuarters, string Tags1, string ExcludeNonMarketable, string Tags2, string ExcludeOutofBusiness, string Tags3, string ExcludeUndeliverable, string Tags4, string ExcludeUnreachable, string Tags5)
        {
            //set properties of Cleanse Match Exclusions
            CleanseMatchExclusionsEntity obj = new CleanseMatchExclusionsEntity();

            obj.CleanseMatchExclusionId1 = 1;
            obj.Active1 = Convert.ToBoolean(ExcludeNonHeadQuarters);
            obj.Tags1   = Tags1;
            obj.CleanseMatchExclusionId2 = 2;
            obj.Active2 = Convert.ToBoolean(ExcludeNonMarketable);
            obj.Tags2   = Tags2;
            obj.CleanseMatchExclusionId3 = 3;
            obj.Active3 = Convert.ToBoolean(ExcludeOutofBusiness);
            obj.Tags3   = Tags3;

            obj.CleanseMatchExclusionId4 = 4;
            obj.Active4 = Convert.ToBoolean(ExcludeUndeliverable);
            obj.Tags4   = Tags4;

            obj.CleanseMatchExclusionId5 = 5;
            obj.Active5 = Convert.ToBoolean(ExcludeUnreachable);
            obj.Tags5   = Tags5;
            //update CleanseMatchExclusions Setting
            CleanseMatchExclusionsFacade CMEfac = new CleanseMatchExclusionsFacade(this.CurrentClient.ApplicationDBConnectionString);

            CMEfac.UpdateCleanseMatchExclusions(obj);
        }
        public ActionResult Index(int?page, int?sortby, int?sortorder, int?pagevalue)
        {
            CleanseMatchSettingsModel model = new CleanseMatchSettingsModel();
            SettingFacade             fac   = new SettingFacade(this.CurrentClient.ApplicationDBConnectionString);

            #region set properties of CleanseMatchExclusions

            CleanseMatchExclusionsFacade  CMEfac = new CleanseMatchExclusionsFacade(this.CurrentClient.ApplicationDBConnectionString);
            List <CleanseMatchExclusions> list   = CMEfac.GetAllCleanseMatchExclusions();

            CleanseMatchExclusionsEntity oCleanseMatchExclusionsEntity = new CleanseMatchExclusionsEntity();
            //set properties of CleanseMatchExclusions
            oCleanseMatchExclusionsEntity.CleanseMatchExclusionId1 = list[0].CleanseMatchExclusionId;
            oCleanseMatchExclusionsEntity.CleanseMatchExclusionId2 = list[1].CleanseMatchExclusionId;
            oCleanseMatchExclusionsEntity.CleanseMatchExclusionId3 = list[2].CleanseMatchExclusionId;
            oCleanseMatchExclusionsEntity.CleanseMatchExclusionId4 = list[3].CleanseMatchExclusionId;
            oCleanseMatchExclusionsEntity.CleanseMatchExclusionId5 = list[4].CleanseMatchExclusionId;
            oCleanseMatchExclusionsEntity.Exclusion1    = list[0].Exclusion;
            oCleanseMatchExclusionsEntity.Exclusion2    = list[1].Exclusion;
            oCleanseMatchExclusionsEntity.Exclusion3    = list[2].Exclusion;
            oCleanseMatchExclusionsEntity.Exclusion4    = list[3].Exclusion;
            oCleanseMatchExclusionsEntity.Exclusion5    = list[4].Exclusion;
            oCleanseMatchExclusionsEntity.Exclusion_DP1 = list[0].Exclusion;
            oCleanseMatchExclusionsEntity.Exclusion_DP2 = list[1].Exclusion;
            oCleanseMatchExclusionsEntity.Exclusion_DP3 = list[2].Exclusion;
            oCleanseMatchExclusionsEntity.Exclusion_DP4 = list[3].Exclusion;
            oCleanseMatchExclusionsEntity.Exclusion_DP5 = list[4].Exclusion;
            oCleanseMatchExclusionsEntity.Active1       = list[0].Active;
            oCleanseMatchExclusionsEntity.Active2       = list[1].Active;
            oCleanseMatchExclusionsEntity.Active3       = list[2].Active;
            oCleanseMatchExclusionsEntity.Active4       = list[3].Active;
            oCleanseMatchExclusionsEntity.Active5       = list[4].Active;
            oCleanseMatchExclusionsEntity.Tags1         = list[0].Tags;
            oCleanseMatchExclusionsEntity.Tags2         = list[1].Tags;
            oCleanseMatchExclusionsEntity.Tags3         = list[2].Tags;
            oCleanseMatchExclusionsEntity.Tags4         = list[3].Tags;
            oCleanseMatchExclusionsEntity.Tags5         = list[4].Tags;

            model.oCleanseMatchExclusionsEntity = new CleanseMatchExclusionsEntity();
            model.oCleanseMatchExclusionsEntity = oCleanseMatchExclusionsEntity;
            #endregion

            #region set properties of AutoAcceptanceDirective
            AutoAcceptanceDirectivesFacade  AADfac         = new AutoAcceptanceDirectivesFacade(this.CurrentClient.ApplicationDBConnectionString);
            List <AutoAcceptanceDirectives> listdirectives = AADfac.GetAllAutoAcceptanceDirectives();
            AutoAcceptanceDirectivesEntity  oAutoAcceptanceDirectivesEntity = new AutoAcceptanceDirectivesEntity();
            //set properties of AutoAcceptanceDirective
            oAutoAcceptanceDirectivesEntity.AutoAcceptanceDirectiveId1 = listdirectives[0].AutoAcceptanceDirectiveId;
            oAutoAcceptanceDirectivesEntity.AutoAcceptanceDirectiveId2 = listdirectives[1].AutoAcceptanceDirectiveId;
            oAutoAcceptanceDirectivesEntity.AutoAcceptanceDirectiveId3 = listdirectives[2].AutoAcceptanceDirectiveId;
            oAutoAcceptanceDirectivesEntity.Directive1 = listdirectives[0].Directive;
            oAutoAcceptanceDirectivesEntity.Directive2 = listdirectives[1].Directive;
            oAutoAcceptanceDirectivesEntity.Directive3 = listdirectives[2].Directive;
            oAutoAcceptanceDirectivesEntity.Active1    = listdirectives[0].Active;
            oAutoAcceptanceDirectivesEntity.Active2    = listdirectives[1].Active;
            oAutoAcceptanceDirectivesEntity.Active3    = listdirectives[2].Active;
            oAutoAcceptanceDirectivesEntity.Tags1      = listdirectives[0].Tags;
            oAutoAcceptanceDirectivesEntity.Tags2      = listdirectives[1].Tags;
            oAutoAcceptanceDirectivesEntity.Tags3      = listdirectives[2].Tags;

            model.oAutoAcceptanceDirectivesEntity = new AutoAcceptanceDirectivesEntity();
            model.oAutoAcceptanceDirectivesEntity = oAutoAcceptanceDirectivesEntity;
            #endregion


            #region Auto-Acceptance
            //Auto - Acceptance Pagination
            int pageNumber = (page ?? 1);
            if (!(sortby.HasValue && sortby.Value > 0))
            {
                sortby = 1;
            }

            if (!(sortorder.HasValue && sortorder.Value > 0))
            {
                sortorder = 2;
            }

            int sortParam        = int.Parse(sortby.ToString() + sortorder.ToString());
            int totalCount       = 0;
            int currentPageIndex = page.HasValue ? page.Value : 1;
            int pageSize         = pagevalue.HasValue ? pagevalue.Value : 10;

            #region Set Viewbag

            ViewBag.SortBy        = sortby;
            ViewBag.SortOrder     = sortorder;
            ViewBag.pageno        = currentPageIndex;
            ViewBag.pagevalue     = pageSize;
            TempData["pageno"]    = currentPageIndex;
            TempData["pagevalue"] = pageSize;
            string finalsortOrder = Convert.ToString(sortby) + Convert.ToString(sortorder);

            //Load AutoAcceptance Criteria.
            model.objAutoSetting = new AutoAdditionalAcceptanceCriteriaEntity();
            #endregion

            if (TempData["ApiLayer"] != null)
            {
                ViewBag.ApiLayer = TempData["ApiLayer"];
            }
            else
            {
                ViewBag.ApiLayer = fac.GetCleanseMatchSettings().Where(x => x.SettingName == "API_LAYER").FirstOrDefault().SettingValue;
            }

            ViewBag.Message = TempData["Message"];

            #endregion
            return(View(model));
        }
示例#4
0
 public void UpdateCleanseMatchExclusions(CleanseMatchExclusionsEntity obj)
 {
     rep.UpdateCleanseMatchExclusions(obj);
 }