public void BindData()
        {
            BLL.PointFolders bllPF = new BLL.PointFolders();

            var list = bllPF.GetList(" BranchId= " + BranchID.ToString() + " AND Enabled=1 AND LoanStatus=6 ");

            ddlFolder.DataSource     = list;
            ddlFolder.DataTextField  = "Name";
            ddlFolder.DataValueField = "FolderId";
            ddlFolder.DataBind();

            if (FileId != 0)
            {
                BLL.PointFiles   bllPointfiles = new BLL.PointFiles();
                Model.PointFiles model         = bllPointfiles.GetModel(FileId);
                if (model != null)
                {
                    txbFilename.Text        = model.Name;
                    ddlFolder.SelectedValue = model.FolderId.ToString();
                }
                else
                {
                    PageCommon.RegisterJsMsg(this.Page, "Missing required query string.", "Cancel();");
                }
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            var filename = txbFilename.Text.Trim();

            if (string.IsNullOrEmpty(filename) ||
                (!filename.ToUpper().EndsWith(".PRS") && !filename.ToUpper().EndsWith(".BRW")))
            {
                PageCommon.AlertMsg(this.Page, "You have to specify a valid Point filename that ends with \".PRS\" or \".BRW\".");
                return;
            }

            if (filename.ToUpper().EndsWith(".PRS"))
            {
                filename = "\\PROSPECT\\" + filename;
            }
            else if (filename.ToUpper().EndsWith(".BRW"))
            {
                filename = "\\BORROWER\\" + filename;
            }
            else
            {
                return;
            }


            BLL.PointFiles bllPointfiles = new BLL.PointFiles();

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

            if (FileId == 0)
            {
                modelPointfile.FolderId = Convert.ToInt32(ddlFolder.SelectedValue);
                modelPointfile.Name     = filename;

                bllPointfiles.Add(modelPointfile);
            }
            else
            {
                modelPointfile = bllPointfiles.GetModel(FileId);

                if (modelPointfile == null)
                {
                    return;
                }
                modelPointfile.FolderId = Convert.ToInt32(ddlFolder.SelectedValue);
                modelPointfile.Name     = filename;

                bllPointfiles.UpdateBase(modelPointfile);
            }
            PageCommon.RegisterJsMsg(this.Page, "", " Cancel();");
        }
Exemple #3
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);
        }
Exemple #4
0
        private bool UpdatePointNote(int fileId, DateTime dtNow, string senderName, out string err)
        {
            bool exported = false;

            err = string.Empty;
            try
            {
                BLL.PointFiles   pfMgr   = new PointFiles();
                Model.PointFiles pfModel = pfMgr.GetModel(fileId);
                if (pfModel == null || pfModel.FolderId <= 0 || string.IsNullOrEmpty(pfModel.Name) || string.IsNullOrEmpty(pfModel.CurrentImage))
                {
                    exported = true;
                    return(exported);
                }
                var req = new AddNoteRequest
                {
                    FileId   = fileId,
                    Created  = dtNow,   //DateTime.Now,
                    NoteTime = dtNow,
                    Note     = tbxNote.Text.Trim(),
                    Sender   = senderName,
                    hdr      = new ReqHdr
                    {
                        UserId = this.CurrUser.iUserID
                    }
                };
                ServiceManager sm = new ServiceManager();
                using (LP2ServiceClient client = sm.StartServiceClient())
                {
                    AddNoteResponse res = client.AddNote(req);
                    exported = !res.hdr.Successful ? false : true;
                    err      = res.hdr.StatusInfo;
                }
            } catch (Exception ex)
            {
                return(exported);
            }
            return(exported);
        }