private void Judge(string filePath)
        {
            var featureClass = filePath.GetShpFeatureClass();

            if (featureClass == null)
            {
                var index = featureClass.Fields.FindField("TCMC");
                if (index != -1)
                {
                    switch (featureClass.ShapeType)
                    {
                    case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPoint:
                        PointFiles.Add(filePath);
                        break;

                    case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon:
                        PolygonFiles.Add(filePath);
                        break;

                    case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolyline:
                        PolylineFiles.Add(filePath);
                        break;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Import PointFiles
        /// </summary>
        /// <returns></returns>
        private int ImportPointFiles()
        {
            PointFiles bPointFiles = new PointFiles();

            Model.PointFiles mPointFiles = new Model.PointFiles();

            //PointFolders bPointFolders = new PointFolders();
            //DataSet dsFolder = bPointFolders.GetList("BranchID=" + BranchId + " and Enabled='true' order by FolderId");
            //if (dsFolder != null && dsFolder.Tables[0].Rows.Count > 0)
            //{
            //    mPointFiles.FolderId = Convert.ToInt32(dsFolder.Tables[0].Rows[0]["FolderId"]);
            //}
            mPointFiles.FolderId      = 0;
            mPointFiles.FirstImported = DateTime.Now;
            mPointFiles.Success       = true;
            //mPointFiles.CurrentImage = Convert.ToByte("");
            // mPointFiles.PreviousImage = Convert.ToByte("");
            int iFileID = bPointFiles.Add(mPointFiles);

            return(iFileID);
        }
Ejemplo n.º 3
0
    private bool SaveLocal(ref string errMsg)
    {
        if (!string.IsNullOrEmpty(FileName) && FileName.Length > 0 && !FileName.ToUpper().EndsWith(".PRS") && !FileName.ToUpper().EndsWith(".BRW"))
        {
            errMsg = "The filename must end with “.PRS” or “.BRW”. ";
            return(false);
        }

        try
        {
            #region Save BranchId
            Loans             bllLoans = new Loans();
            LPWeb.Model.Loans loanInfo = new LPWeb.Model.Loans();
            loanInfo = bllLoans.GetModel(iFileID);
            if (loanInfo != null)
            {
                loanInfo.BranchID = BranchId;
                bllLoans.Update(loanInfo);
            }
            #endregion

            //Save Loan Officer

            #region Loan Officer

            LoanTeam bllLoanTeam   = new LoanTeam();
            Users    bllUsers      = new Users();
            var      loanOfficer   = bllLoanTeam.GetLoanOfficer(iFileID);
            var      loanOfficerId = bllLoanTeam.GetLoanOfficerID(iFileID);

            #region Loan Officer RolesID   =loanOfficerRolesId
            Roles bllRoles           = new Roles();
            int   loanOfficerRolesId = 3;//default;
            try
            {
                loanOfficerRolesId = bllRoles.GetModelList(" Name = 'Loan Officer' ").FirstOrDefault().RoleId;
            }
            catch { }
            #endregion

            if (LoanOfficerId != loanOfficerId)
            {
                var loanTeamInfo = bllLoanTeam.GetModel(iFileID, loanOfficerRolesId, loanOfficerId);

                if (loanTeamInfo == null)
                {
                    loanTeamInfo = new LPWeb.Model.LoanTeam();
                }
                else
                {
                    bllLoanTeam.Delete(iFileID, loanOfficerRolesId, loanOfficerId);
                }
                loanTeamInfo.FileId = iFileID;
                loanTeamInfo.RoleId = loanOfficerRolesId;
                loanTeamInfo.UserId = LoanOfficerId;


                bllLoanTeam.Add(loanTeamInfo);
            }

            #endregion

            #region Local PointFile  ----pointFileInfo and  pointFolderInfo

            PointFiles   bllPointFile    = new PointFiles();
            PointFolders bllPointFolders = new PointFolders();


            LPWeb.Model.PointFiles pointFileInfo = bllPointFile.GetModel(iFileID);
            var IsAddPointFile = false;
            if (pointFileInfo == null)
            {
                IsAddPointFile = true;
                pointFileInfo  = new LPWeb.Model.PointFiles();
            }
            else
            {
                IsAddPointFile = false;
            }

            pointFileInfo.FileId = iFileID;
            if (FolderId > 0)
            {
                pointFileInfo.FolderId = FolderId;
            }
            if (FileName.Length > 0)
            {
                pointFileInfo.Name = FileName;
            }


            if (IsAddPointFile)
            {
                bllPointFile.Add(pointFileInfo);
            }
            else
            {
                bllPointFile.UpdateBase(pointFileInfo);
            }

            #endregion
        }
        catch (Exception ex)
        {
            errMsg = ex.Message;
            return(false);
        }
        return(true);
    }