コード例 #1
0
ファイル: FHManage.cs プロジェクト: NRohilla/FileHarmonizer
        public int UpdateFilterComment(CHFilter filter)
        {
            int retValue = -1;

            try
            {
                string sql = "Update tbl_CreateFilters set FilterDesc='" + filter.FilterDesc + "',FilterText='" + filter.FilterText + "', UpdatedDate=GETDATE() where FLTRID='" + filter.FLTRID + "'";
                con = ConnectionClass.getConnection();
                SqlCommand cmd = new SqlCommand();
                cmd.Connection  = con;
                cmd.CommandText = sql;
                cmd.CommandType = CommandType.Text;
                retValue        = cmd.ExecuteNonQuery();
                ConnectionClass.closeconnection(con);
            }
            catch (Exception ex)
            {
                ConnectionClass.closeconnection(con);
                DataLogger.Write("FHMnage-UpdateFilterComment", ex.Message);
            }
            finally
            {
                ConnectionClass.closeconnection(con);
            }
            return(retValue);
        }
コード例 #2
0
ファイル: FHFileData.cs プロジェクト: NRohilla/FileHarmonizer
        public string CreateFilter(CHFilter Filter)
        {
            string Result = "";

            try
            {
                con = ConnectionClass.getConnection();
                SqlCommand cmd = new SqlCommand();
                cmd.Connection  = con;
                cmd.CommandText = "sp_InsertUpdateDeleteCreateFilter";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@ID", SqlDbType.NVarChar).Value         = Filter.ID;
                cmd.Parameters.Add("@UserID", SqlDbType.NVarChar).Value     = Filter.UserID;
                cmd.Parameters.Add("@SECID", SqlDbType.NVarChar).Value      = Filter.SECID;
                cmd.Parameters.Add("@SECCODE", SqlDbType.NVarChar).Value    = Filter.SECCODE;
                cmd.Parameters.Add("@FilterType", SqlDbType.Char).Value     = Filter.FilterType;
                cmd.Parameters.Add("@BPID", SqlDbType.Char).Value           = Filter.BPID;
                cmd.Parameters.Add("@FLTRSEC", SqlDbType.NVarChar).Value    = Filter.SECCODE;
                cmd.Parameters.Add("@FLTRID", SqlDbType.NVarChar).Value     = Filter.FLTRID;
                cmd.Parameters.Add("@FilterDesc", SqlDbType.NVarChar).Value = Filter.FilterDesc;
                cmd.Parameters.Add("@FilterText", SqlDbType.NVarChar).Value = Filter.FilterText;
                cmd.Parameters.Add("@FilterName", SqlDbType.NVarChar).Value = Filter.FilterName;
                cmd.Parameters.Add("@FLTRNUM", SqlDbType.NVarChar).Value    = Filter.FLTRNUM;
                cmd.Parameters.Add("@INDID", SqlDbType.NVarChar).Value      = Filter.INDID;
                cmd.Parameters.Add("@CATID", SqlDbType.NVarChar).Value      = Filter.CATID;
                cmd.Parameters.Add("@FileID", SqlDbType.NVarChar).Value     = Filter.FileID;
                cmd.Parameters.Add("@Operation", SqlDbType.NVarChar).Value  = "Insert";
                cmd.Parameters.Add("@Output", SqlDbType.NVarChar, 50);
                cmd.Parameters["@Output"].Direction = ParameterDirection.Output;
                cmd.ExecuteNonQuery();
                Result = (string)cmd.Parameters["@Output"].Value;
                ConnectionClass.closeconnection(con);
            }
            catch (Exception ex)
            {
                ConnectionClass.closeconnection(con);
                Result = "";
                DataLogger.Write("FHFile-CreateFilter", ex.Message);
            }
            finally
            {
                ConnectionClass.closeconnection(con);
            }
            return(Result);
        }
コード例 #3
0
        public ActionResult RenameFilter(int FileID, string Comment, string Description, string FLTRID, int op = 0)
        {
            int      retValue  = -1;
            CHFilter _chFilter = new CHFilter();

            _chFilter.FileID     = FileID;
            _chFilter.FilterDesc = Description;
            _chFilter.FilterText = Comment;
            _chFilter.FLTRID     = FLTRID;
            if (op == 1)
            {
                // Update Filter
                retValue = _fhManage.UpdateFilterComment(_chFilter);
                return(Json(retValue, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(PartialView("_RenameFilter", _chFilter));
            }
        }
コード例 #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);
        }
コード例 #5
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));
        }
コード例 #6
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);
        }