Exemplo n.º 1
0
        public int UploadSourceFile(FileUploadDownload File)
        {
            int retValue = -1;

            try
            {
                con = ConnectionClass.getConnection();
                SqlCommand cmd = new SqlCommand();

                cmd.Connection  = con;
                cmd.CommandText = "sp_CreateFileHistory";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@UserID", SqlDbType.NVarChar).Value          = File.UserID;
                cmd.Parameters.Add("@SECID", SqlDbType.NVarChar).Value           = File.SECID;
                cmd.Parameters.Add("@DataDate", SqlDbType.DateTime).Value        = File.DataDate;
                cmd.Parameters.Add("@Time", SqlDbType.NVarChar).Value            = File.Time;
                cmd.Parameters.Add("@CreatedBy", SqlDbType.NVarChar).Value       = File.CreatedBy;
                cmd.Parameters.Add("@CreatedDate", SqlDbType.DateTime).Value     = File.CreatedDate;
                cmd.Parameters.Add("@OrignalFileName", SqlDbType.NVarChar).Value = File.OrginalFileName;
                cmd.Parameters.Add("@SourceFilePath", SqlDbType.NVarChar).Value  = File.SourceFilePath;
                cmd.Parameters.Add("@FileExt", SqlDbType.NVarChar).Value         = File.FileExt;
                cmd.Parameters.Add("@IsArchive", SqlDbType.Bit).Value            = File.IsArchive;
                cmd.Parameters.Add("@TargetFilePath", SqlDbType.NVarChar).Value  = File.TargetFilePath;
                cmd.Parameters.Add("@NewFileName", SqlDbType.NVarChar).Value     = File.NewFileName;
                cmd.Parameters.Add("@BPID", SqlDbType.NVarChar).Value            = File.BPID;
                cmd.Parameters.Add("@Output", SqlDbType.Int);
                cmd.Parameters["@Output"].Direction = ParameterDirection.Output;
                cmd.ExecuteNonQuery();
                retValue = (int)cmd.Parameters["@Output"].Value;
            }
            catch (SqlException sqlEx)
            {
                // Get orginal value from raise error by sql
                retValue = -1;

                // Write exception in log file
                ConnectionClass.closeconnection(con);
                DataLogger.Write("FHFile-UploadSourceFile", sqlEx.Message);
            }
            catch (Exception ex)
            {
                // Base exception
                retValue = -1;

                // Write exception in log file
                ConnectionClass.closeconnection(con);
                DataLogger.Write("FHFile-UploadSourceFile", ex.Message);
            }
            finally
            {
                ConnectionClass.closeconnection(con);
            }

            return(retValue);
        }
Exemplo n.º 2
0
        public List <FileUploadDownload> GetSourceFile(FileUploadDownload File)
        {
            List <FileUploadDownload> lst = new List <FileUploadDownload>();

            return(lst);
        }
Exemplo n.º 3
0
        public ActionResult _FilterFileDetails()
        {
            List <SelectListItem> lstSchme = new List <SelectListItem>();
            DataSet dsScheme = _scheme.GetAllSchemeByBPID(Session["BPID"].ToString(), "selectall");

            lstSchme.Add(new SelectListItem {
                Text = "-Scheme-", Value = "0"
            });
            if (dsScheme.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < dsScheme.Tables[0].Rows.Count; i++)
                {
                    lstSchme.Add(new SelectListItem {
                        Text = dsScheme.Tables[0].Rows[i]["SchemeNum"].ToString() + "-" + dsScheme.Tables[0].Rows[i]["SchemeName"].ToString(), Value = dsScheme.Tables[0].Rows[i]["SchemeNum"].ToString()
                    });
                }
            }

            ViewData["lstSchme"] = lstSchme;


            List <ManageFilterTemplateModel> lstFilterTemplate    = new List <ManageFilterTemplateModel>();
            List <ManageFilterTemplateModel> lstFilterTemplateNew = new List <ManageFilterTemplateModel>();
            Template           _template           = new Template();
            CHFilter           _chFilter           = new CHFilter();
            HarmonizeTemplate  _harmonizeTemplate  = new HarmonizeTemplate();
            FileUploadDownload _fileUploadDownload = new FileUploadDownload();
            string             UserID = Session["UserID"].ToString();
            string             BPID   = Session["BPID"].ToString();
            DataSet            ds     = _fhManage.GetFilterByBPID(BPID);

            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    // Add Filter data
                    _chFilter = new CHFilter
                    {
                        SECID        = row["SECID"].ToString(),
                        FLTRNUM      = row["FLTRNUM"].ToString(),
                        FLTRID       = row["FLTRID"].ToString(),
                        FilterDesc   = row["FilterDesc"].ToString(),
                        FilterText   = row["FilterText"].ToString(),
                        FilterName   = row["FilterName"].ToString(),
                        CreatedDate  = Convert.ToDateTime(row["CreatedDate"]),
                        UpdatedDate  = Convert.ToDateTime(row["UpdatedDate"]),
                        IsDeleted    = Convert.ToBoolean(row["IsDeleted"]),
                        FileID       = Convert.ToInt32(row["FileID"]),
                        AssignScheme = Convert.ToInt32(row["AssignScheme"]),
                        IsArchive    = Convert.ToBoolean(row["CFilterIsArchive"])
                    };

                    // Main file to Add list of element
                    lstFilterTemplate.Add(new ManageFilterTemplateModel
                    {
                        Template           = _template,
                        Filter             = _chFilter,
                        FileUploadDownload = _fileUploadDownload,
                        HarmonizeTemplate  = _harmonizeTemplate
                    });
                }
            }
            var datat = lstFilterTemplate.Where(x => x.Filter.IsDeleted == false && x.Filter.IsArchive == false).ToList();

            // lst = lstSword.Distinct(new ItemEqualityComparer()).ToList();
            lstFilterTemplateNew = datat.Distinct(new NoDuplicateFilter()).ToList();;
            return(PartialView(lstFilterTemplateNew));
        }
Exemplo n.º 4
0
        public List <ManageFilterTemplateModel> GetFiletTemplateManageData(string BPID, string HostName, string ProtNo)
        {
            string fullPathUrlTemplate   = "";
            string fullPathUrlHarmonized = "";
            string host       = HostName;
            string port       = ProtNo;
            string rootDomain = ConfigurationManager.AppSettings["rootDomain"].ToString();

            if (!string.IsNullOrEmpty(port))
            {
                fullPathUrlTemplate   = rootDomain + host.TrimEnd('/') + ":" + port + "/Target/" + BPID + "/";
                fullPathUrlHarmonized = rootDomain + host.TrimEnd('/') + ":" + port + "/Harmonized/" + BPID + "/";
            }
            else
            {
                fullPathUrlTemplate   = rootDomain + host.TrimEnd('/') + "/Target/" + BPID + "/";
                fullPathUrlHarmonized = rootDomain + host.TrimEnd('/') + "/Harmonized/" + BPID + "/";
            }
            Template           _template                       = new Template();
            CHFilter           _chFilter                       = new CHFilter();
            HarmonizeTemplate  _harmonizeTemplate              = new HarmonizeTemplate();
            FileUploadDownload _fileUploadDownload             = new FileUploadDownload();
            List <ManageFilterTemplateModel> lstFilterTemplate = new List <ManageFilterTemplateModel>();
            DataSet ds = _fhManage.GetFilterTemplateDetailsByBPID(BPID);

            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    // Add template data
                    _template = new Template
                    {
                        BPID             = row["BPID"].ToString(),
                        HFLTRID          = row["HFLTRID"].ToString(),
                        TEMPID           = row["TEMPID"].ToString(),
                        Partner          = row["Partner"].ToString(),
                        TemplateType     = row["TemplateType"].ToString(),
                        TemplateDesc     = row["TemplateDesc"].ToString(),
                        TemplateName     = row["TemplateName"].ToString(),
                        DocExt           = row["DocExt"].ToString(),
                        CreatedDate      = Convert.ToDateTime(row["TempCDate"]),
                        UpdatedDate      = Convert.ToDateTime(row["TempUDate"]),
                        FileID           = Convert.ToInt32(row["FileID"]),
                        SECCODE          = row["TempSECCode"].ToString(),
                        TemplateText     = row["TemplateText"].ToString(),
                        IsDeleted        = Convert.ToBoolean(row["TempDeleted"]),
                        IsArchive        = Convert.ToBoolean(row["TempArchive"]),
                        InternalExternal = row["InternalExternal"].ToString()
                    };
                    // Add Filter data
                    _chFilter = new CHFilter
                    {
                        SECID        = row["CSECID"].ToString(),
                        FLTRNUM      = row["CFILTERNUM"].ToString(),
                        FLTRID       = row["CFLTERID"].ToString(),
                        FilterDesc   = row["FilterDesc"].ToString(),
                        FilterText   = row["FilterText"].ToString(),
                        FilterName   = row["FilterName"].ToString(),
                        CreatedDate  = Convert.ToDateTime(row["CFCDate"]),
                        UpdatedDate  = Convert.ToDateTime(row["CFUDate"]),
                        AssignScheme = Convert.ToInt32(row["AssignScheme"])
                    };
                    // Add File history data
                    _fileUploadDownload = new FileUploadDownload
                    {
                        OrginalFileName      = row["OrignalFileName"].ToString(),
                        SourceFilePath       = row["SourceFilePath"].ToString(),
                        TargetFilePath       = row["TargetFilePath"].ToString(),
                        IsDeleted            = Convert.ToBoolean(row["FileDelete"]),
                        IsArchive            = Convert.ToBoolean(row["FileArchive"]),
                        TemplateDownloadPath = fullPathUrlTemplate + row["NewFileName"].ToString()
                    };
                    _harmonizeTemplate = new HarmonizeTemplate
                    {
                        ID            = Convert.ToInt32(row["HTID"]),
                        TemplateName  = row["TemplateName"].ToString(),
                        TemplateID    = Convert.ToInt32(row["HTTemplateID"]),
                        NoOfDownloads = Convert.ToInt32(row["NoOfDownloads"]),
                        CreatedDate   = Convert.ToDateTime(row["HTCreatedDate"]),
                        UpdatedDate   = Convert.ToDateTime(row["HTUpdateDate"]),
                        TemplatePath  = fullPathUrlHarmonized + row["TemplatePath"].ToString(),
                        Comment       = row["HTComment"].ToString(),
                        HTFHNumber    = row["HTFHNumber"].ToString(),
                        IsArchive     = Convert.ToBoolean(row["HTIsArchive"])
                    };
                    // Main file to Add list of element
                    lstFilterTemplate.Add(new ManageFilterTemplateModel
                    {
                        Template           = _template,
                        Filter             = _chFilter,
                        FileUploadDownload = _fileUploadDownload,
                        HarmonizeTemplate  = _harmonizeTemplate
                    });
                }
            }
            return(lstFilterTemplate);
        }
Exemplo n.º 5
0
        public List <ManageFilterTemplateModel> GetFiletTemplateManageData(string BPID)
        {
            //added Smit userid,Fhnumb,associate
            string UserID                = Session["UserID"].ToString();
            string FHnumb                = Session["FHnumber"].ToString();
            string Associate             = Session["Associate"].ToString();
            string fullPathUrlTemplate   = "";
            string fullPathUrlHarmonized = "";
            string host       = Request.Url.Host;
            string port       = Request.Url.Port.ToString();
            string rootDomain = ConfigurationManager.AppSettings["rootDomain"].ToString();

            if (!string.IsNullOrEmpty(port))
            {
                fullPathUrlTemplate   = rootDomain + host.TrimEnd('/') + ":" + port + "/Target/" + Session["BPID"] + "/";
                fullPathUrlHarmonized = rootDomain + host.TrimEnd('/') + ":" + port + "/Harmonized/" + Session["BPID"] + "/";
            }
            else
            {
                fullPathUrlTemplate   = rootDomain + host.TrimEnd('/') + "/Target/" + Session["BPID"] + "/";
                fullPathUrlHarmonized = rootDomain + host.TrimEnd('/') + "/Harmonized/" + Session["BPID"] + "/";
            }
            //added Smit
            Association        association                     = new Association();
            Template           _template                       = new Template();
            CHFilter           _chFilter                       = new CHFilter();
            HarmonizeTemplate  _harmonizeTemplate              = new HarmonizeTemplate();
            FileUploadDownload _fileUploadDownload             = new FileUploadDownload();
            List <ManageFilterTemplateModel> lstFilterTemplate = new List <ManageFilterTemplateModel>();
            DataSet ds = _fhManage.GetFilterTemplateDetailsByBPID(BPID);

            if (ds.Tables[0].Rows.Count > 0)
            {
                //added smit
                association.FHnumber        = FHnumb;
                association.Associate       = Associate;
                association.AssocStatus     = true;
                association.AssocCanceledBy = UserID;
                int    createAssociation = _fhFileData.CreateAssociation(association);
                string recordId1         = _fhFileData.GetAssociationInActiveId(FHnumb, Associate);
                if (recordId1 != "")
                {
                    Session["RecordId"] = recordId1;
                }
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    // Add template data
                    _template = new Template
                    {
                        BPID             = row["BPID"].ToString(),
                        HFLTRID          = row["HFLTRID"].ToString(),
                        TEMPID           = row["TEMPID"].ToString(),
                        Partner          = row["Partner"].ToString(),
                        TemplateType     = row["TemplateType"].ToString(),
                        TemplateDesc     = row["TemplateDesc"].ToString(),
                        TemplateName     = row["TemplateName"].ToString(),
                        DocExt           = row["DocExt"].ToString(),
                        CreatedDate      = Convert.ToDateTime(row["TempCDate"]),
                        UpdatedDate      = Convert.ToDateTime(row["TempUDate"]),
                        FileID           = Convert.ToInt32(row["FileID"]),
                        SECCODE          = row["TempSECCode"].ToString(),
                        TemplateText     = row["TemplateText"].ToString(),
                        IsDeleted        = Convert.ToBoolean(row["TempDeleted"]),
                        IsArchive        = Convert.ToBoolean(row["TempArchive"]),
                        InternalExternal = row["InternalExternal"].ToString()
                    };
                    // Add Filter data
                    _chFilter = new CHFilter
                    {
                        SECID        = row["CSECID"].ToString(),
                        FLTRNUM      = row["CFILTERNUM"].ToString(),
                        FLTRID       = row["CFLTERID"].ToString(),
                        FilterDesc   = row["FilterDesc"].ToString(),
                        FilterText   = row["FilterText"].ToString(),
                        FilterName   = row["FilterName"].ToString(),
                        CreatedDate  = Convert.ToDateTime(row["CFCDate"]),
                        UpdatedDate  = Convert.ToDateTime(row["CFUDate"]),
                        AssignScheme = Convert.ToInt32(row["AssignScheme"])
                    };
                    // Add File history data
                    _fileUploadDownload = new FileUploadDownload
                    {
                        OrginalFileName      = row["OrignalFileName"].ToString(),
                        SourceFilePath       = row["SourceFilePath"].ToString(),
                        TargetFilePath       = row["TargetFilePath"].ToString(),
                        IsDeleted            = Convert.ToBoolean(row["FileDelete"]),
                        IsArchive            = Convert.ToBoolean(row["FileArchive"]),
                        TemplateDownloadPath = fullPathUrlTemplate + row["NewFileName"].ToString()
                    };
                    _harmonizeTemplate = new HarmonizeTemplate
                    {
                        ID            = Convert.ToInt32(row["HTID"]),
                        TemplateName  = row["TemplateName"].ToString(),
                        TemplateID    = Convert.ToInt32(row["HTTemplateID"]),
                        NoOfDownloads = Convert.ToInt32(row["NoOfDownloads"]),
                        CreatedDate   = Convert.ToDateTime(row["HTCreatedDate"]),
                        UpdatedDate   = Convert.ToDateTime(row["HTUpdateDate"]),
                        TemplatePath  = fullPathUrlHarmonized + row["TemplatePath"].ToString(),
                        Comment       = row["HTComment"].ToString(),
                        HTFHNumber    = row["HTFHNumber"].ToString(),
                        IsArchive     = Convert.ToBoolean(row["HTIsArchive"])
                    };
                    // Main file to Add list of element
                    lstFilterTemplate.Add(new ManageFilterTemplateModel
                    {
                        Template           = _template,
                        Filter             = _chFilter,
                        FileUploadDownload = _fileUploadDownload,
                        HarmonizeTemplate  = _harmonizeTemplate
                    });
                }
            }
            return(lstFilterTemplate);
        }