Ejemplo n.º 1
0
        public ActionResult InsertUpdateDataEnrichment(DnBAPIGroupEntity model, string btnDnBApiGrp, string Tags)
        {
            Tags       = Tags.TrimStart(',').TrimEnd(',');
            model.Tags = Tags == "0" ? null : Tags;
            // Save for DnbAbi Data.
            SettingFacade fac = new SettingFacade(this.CurrentClient.ApplicationDBConnectionString);

            model.lstDnbAPIs = fac.GetDnBAPIList(model.APIType);
            List <string> lstAPIIDS = model.DnbAPIIds != null?model.DnbAPIIds.Split(',').ToList() : new List <string>();

            if (model.IsValidSave)
            {
                if (!IsAPIGroupExists(model))
                {
                    fac.InsertOrUpdateDnBAPIDetail(model);
                    ViewBag.APIMessage = model.APIGroupId == 0 ? CommonMessagesLang.msgCommanInsertMessage : CommonMessagesLang.msgCommanUpdateMessage;
                    return(Json(new { result = true, message = model.APIGroupId == 0 ? CommonMessagesLang.msgCommanInsertMessage : CommonMessagesLang.msgCommanUpdateMessage }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    ViewBag.APIMessage = DandBSettingLang.msgGroupNameExist;
                    return(Json(new { result = false, message = DandBSettingLang.msgGroupNameExist }, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                return(Json(new { result = false, message = DandBSettingLang.msgInvadilState }, JsonRequestBehavior.AllowGet));
            }
        }
Ejemplo n.º 2
0
        public DnBAPIGroupEntity GetAPIGroupDetailsById(int ID)
        {
            DnBAPIGroupEntity result = new DnBAPIGroupEntity();

            result = rep.GetAPIGroupDetailById(ID);
            return(result);
        }
Ejemplo n.º 3
0
        // Validate Api Group is Exist or not if exist than display according Message.
        public bool IsAPIGroupExists(DnBAPIGroupEntity model)
        {
            SettingFacade fac = new SettingFacade(this.CurrentClient.ApplicationDBConnectionString);

            if (fac.GetDnBAPIGroupList("").Exists(d => d.APIGroupName.ToLower() == model.APIGroupName.Trim().ToLower() && d.APIGroupId != model.APIGroupId))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 4
0
        public ActionResult InsertUpdateDataEnrichment(string Parameters)
        {
            // Get Query string in Encrypted mode and decrypt Query string and set Parameters
            if (Parameters == "undefined" || Parameters.ToLower() == "null")
            {
                Parameters = null;
            }
            if (Parameters != null)
            {
                Parameters = StringCipher.Decrypt(Parameters.Replace(Utility.Utility.urlseparator, "+"), General.passPhrase);
            }
            // Open Popup for DnbAbi Data.
            int               GroupId = Convert.ToInt32(Parameters);
            SettingFacade     fac     = new SettingFacade(this.CurrentClient.ApplicationDBConnectionString);
            DnBAPIGroupEntity model   = new DnBAPIGroupEntity();

            if (GroupId > 0)
            {
                model            = fac.GetAPIGroupDetailsById(GroupId);
                model.lstDnbAPIs = fac.GetDnBAPIList(model.APIType, model.CredentialId);
                if (model != null)
                {
                    model.tmpName = model.APIGroupName;
                    if (model.DnbAPIIds != null)
                    {
                        model.lstDnBApiGrp = new List <DnbAPIEntity>();
                        foreach (var item in model.DnbAPIIds.Split(','))
                        {
                            var obj = model.lstDnbAPIs.FirstOrDefault(d => d.DnBAPIId == Convert.ToInt32(item));
                            if (obj != null)
                            {
                                model.lstDnBApiGrp.Add(obj);
                                model.lstDnbAPIs.Remove(obj);
                            }
                        }
                    }
                }
                else
                {
                    model.lstDnbAPIs = fac.GetDnBAPIList(null);
                }
            }

            else
            {
                model.lstDnbAPIs = fac.GetDnBAPIList(null);
            }
            return(PartialView(model));
        }
Ejemplo n.º 5
0
 public void InsertOrUpdateDnBAPIDetail(DnBAPIGroupEntity obj)
 {
     rep.InsertOrUpdateDnBAPIDetail(obj);
 }