Esempio n. 1
0
        //GET : Insert Update Command Upload Mapping
        public ActionResult CreateCommandMapping(string Parameters)
        {
            CommandUploadMappingEntity objCommandUploadMappingEntity = new CommandUploadMappingEntity();

            string ImportType = "data import";

            if (!string.IsNullOrEmpty(Parameters))
            {
                Parameters = StringCipher.Decrypt(Parameters.Replace(Utility.Utility.urlseparator, "+"), General.passPhrase);
                int id = Convert.ToInt32(Parameters);
                if (id > 0)
                {
                    bool IsTag              = false;
                    bool IsInLanguage       = false;
                    ColumnMappingFacade tac = new ColumnMappingFacade(this.CurrentClient.ApplicationDBConnectionString);
                    objCommandUploadMappingEntity = tac.GetCommandMappingById(id);
                    // Check if file contains tag field or not
                    if (Array.Exists(objCommandUploadMappingEntity.OriginalColumns.Split(','), element => element.ToLower() == "tags") || Array.Exists(objCommandUploadMappingEntity.OriginalColumns.Split(','), element => element.ToLower() == "tag"))
                    {
                        IsTag = true;
                    }
                    // Check if file contains language field or not
                    if (Array.Exists(objCommandUploadMappingEntity.OriginalColumns.Split(','), element => element.ToLower() == "language") ||
                        Array.Exists(objCommandUploadMappingEntity.OriginalColumns.Split(','), element => element.ToLower() == "language values") ||
                        Array.Exists(objCommandUploadMappingEntity.OriginalColumns.Split(','), element => element.ToLower() == "languagevalues") ||
                        Array.Exists(objCommandUploadMappingEntity.OriginalColumns.Split(','), element => element.ToLower() == "language code") ||
                        Array.Exists(objCommandUploadMappingEntity.OriginalColumns.Split(','), element => element.ToLower() == "languagecode"))
                    {
                        IsInLanguage = true;
                    }

                    List <SelectListItem> lstAllFilter          = new List <SelectListItem>();
                    List <string>         LstOriginalcolumnName = new List <string>();
                    LstOriginalcolumnName.AddRange(objCommandUploadMappingEntity.OriginalColumns.Split(','));
                    int i = 0;
                    foreach (var item in LstOriginalcolumnName)
                    {
                        lstAllFilter.Add(new SelectListItem {
                            Value = (i).ToString(), Text = Convert.ToString(item)
                        });
                        i++;
                    }
                    ViewBag.IsContainsTags = IsTag;
                    SessionHelper.CommandMapping_IsInLanguage = IsInLanguage;
                    ViewBag.ExternalColumn = lstAllFilter;
                    ViewBag.ColumnMapping  = objCommandUploadMappingEntity.ColumnMapping;
                    ImportType             = objCommandUploadMappingEntity.ImportType;
                    objCommandUploadMappingEntity.FileFormatCommandLine = objCommandUploadMappingEntity.FileFormat;
                }
            }
            //get column Name
            List <string> columnName = GetcolumnName(ImportType, this.CurrentClient.ApplicationDBConnectionString);

            ViewBag.ImportMode = ImportType;
            ViewBag.ColumnList = columnName;

            return(PartialView("_createCommandMapping", objCommandUploadMappingEntity));
        }
Esempio n. 2
0
        public ActionResult InsertUpdate(CommandUploadMappingEntity obj)
        {
            if (ModelState.IsValid)
            {
                ColumnMappingFacade fac = new ColumnMappingFacade(this.CurrentClient.ApplicationDBConnectionString);
                obj.UserId      = Helper.oUser.UserId;
                obj.Tags        = string.IsNullOrEmpty(obj.Tags) ? "" : obj.Tags == "0" ? "" : obj.Tags;
                obj.Formatvalue = obj.FileFormat == "Delimiter" ? obj.Formatvalue : "";
                obj.FileFormat  = obj.FileFormatCommandLine;
                string msg        = fac.InsertUpdateCommandUploadMapping(obj);
                string ImportType = obj == null ? "data import" : string.IsNullOrEmpty(obj.ImportType) ? "data import" : obj.ImportType.ToLower();
                if (string.IsNullOrEmpty(msg))
                {
                    if (obj.Id > 0)
                    {
                        ViewBag.Message = CommonMessagesLang.msgCommanUpdateMessage;
                        ImportType      = obj.ImportType;



                        List <SelectListItem> lstAllFilter          = new List <SelectListItem>();
                        List <string>         LstOriginalcolumnName = new List <string>();
                        LstOriginalcolumnName.AddRange(obj.OriginalColumns.Split(','));
                        int i = 0;
                        foreach (var item in LstOriginalcolumnName)
                        {
                            lstAllFilter.Add(new SelectListItem {
                                Value = (i).ToString(), Text = Convert.ToString(item)
                            });
                            i++;
                        }
                        ViewBag.ExternalColumn = lstAllFilter;
                        ViewBag.ColumnMapping  = obj.ColumnMapping;
                    }
                    else
                    {
                        ViewBag.Message = CommonMessagesLang.msgCommanInsertMessage;
                        obj             = new CommandUploadMappingEntity();
                    }
                }
                else
                {
                    ViewBag.Message = msg;
                }

                List <string> columnName = GetcolumnName(ImportType, this.CurrentClient.ApplicationDBConnectionString);
                ViewBag.ColumnList = columnName;
                ViewBag.ImportMode = ImportType;
            }
            else
            {
                ViewBag.Message = DandBSettingLang.msgInvadilState;
            }
            return(PartialView("_createCommandMapping", obj));
        }
Esempio n. 3
0
        public ActionResult DeleteCommandDownload(string Parameters)
        {
            // Get Query string in Encrypted mode and decrypt Query string and set Parameters
            if (!string.IsNullOrEmpty(Parameters))
            {
                Parameters = StringCipher.Decrypt(Parameters.Replace(Utility.Utility.urlseparator, "+"), General.passPhrase);
            }

            ColumnMappingFacade fac = new ColumnMappingFacade(this.CurrentClient.ApplicationDBConnectionString);

            fac.DeleteCommandDownloadMapping(Convert.ToInt32(Parameters));
            return(Json(CommonMessagesLang.msgCommanDeleteMessage));
        }
Esempio n. 4
0
        //GET : Insert Update Command Download Mapping
        public ActionResult InsertUpdateCommandDownload(string Parameters)
        {
            CommandDownloadMappingEntity obj = new CommandDownloadMappingEntity();

            obj.IsAppendDateTime = true;
            // Get Query string in Encrypted mode and decrypt Query string and set Parameters
            if (!string.IsNullOrEmpty(Parameters))
            {
                Parameters = StringCipher.Decrypt(Parameters.Replace(Utility.Utility.urlseparator, "+"), General.passPhrase);
                int id = Convert.ToInt32(Parameters);
                if (id > 0)
                {
                    ColumnMappingFacade tac = new ColumnMappingFacade(this.CurrentClient.ApplicationDBConnectionString);
                    obj = tac.GetCommandDownloadMappingById(id);
                }
            }
            return(PartialView("_insertUpdateCommandDownload", obj));
        }
Esempio n. 5
0
 public ActionResult InsertUpdateCommandDownload(CommandDownloadMappingEntity obj)
 {
     if (ModelState.IsValid)
     {
         if (string.IsNullOrEmpty(obj.ProviderType))
         {
             if (Helper.LicenseEnabledDNB && !Helper.LicenseEnabledOrb)
             {
                 obj.ProviderType = "DandB";
             }
             else if (!Helper.LicenseEnabledDNB && Helper.LicenseEnabledOrb)
             {
                 obj.ProviderType = "Orb";
             }
         }
         ColumnMappingFacade fac = new ColumnMappingFacade(this.CurrentClient.ApplicationDBConnectionString);
         obj.Formatvalue = obj.DownloadFormat == "Delimiter" ? obj.Formatvalue : "";
         obj.UserId      = 0;
         string msg = fac.InsertUpdateCommandDownloadMapping(obj);
         // set message for insert & update
         if (string.IsNullOrEmpty(msg))
         {
             if (obj.Id > 0)
             {
                 ViewBag.Message = CommonMessagesLang.msgCommanUpdateMessage;
             }
             else
             {
                 ViewBag.Message = CommonMessagesLang.msgCommanInsertMessage;
             }
         }
         else
         {
             ViewBag.Message = msg;
         }
     }
     else
     {
         ViewBag.Message = DandBSettingLang.msgInvadilState;
     }
     return(View("_insertUpdateCommandDownload", obj));
 }
Esempio n. 6
0
        public ActionResult IndexCommandDownload()
        {
            ColumnMappingFacade tac = new ColumnMappingFacade(this.CurrentClient.ApplicationDBConnectionString);
            List <CommandDownloadMappingEntity> model = new List <CommandDownloadMappingEntity>();

            //Get Command Download Mapping List
            model = tac.GetCommandDownloadMapping();

            // MP-1046 Create Individual URL redirection for all Tabs to make better format for URL
            if (Request.Headers["X-PJAX"] == "true")
            {
                return(PartialView("_indexCommandDownload", model));
            }
            else
            {
                ViewBag.SelectedTab           = "Data Governance";
                ViewBag.SelectedMainTab       = "Integration Gateway";
                ViewBag.SelectedIndividualTab = "Download Configuration";
                return(View("~/Views/Portal/Index.cshtml", model));
            }
        }