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 Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string strFileId = Request.QueryString["fid"]; // file id if (string.IsNullOrEmpty(strFileId)) { PageCommon.WriteJsEnd(this, "Invalid FileId=" + strFileId, "window.parent.close();"); return; } int FileId = Convert.ToInt32(strFileId); if (FileId <= 0) { PageCommon.WriteJsEnd(this, "Invalid FileId.", "window.parent.close();"); return; } string strTargetStatus = "3"; //string strTargetStatus = Request.QueryString["tls"]; // target folder status int iBranchId = 0; string strStatus7 = " OR LoanStatus='7'"; BLL.PointFiles pFile = new BLL.PointFiles(); iBranchId = pFile.GetPointFileBrancId(strFileId, ""); BLL.PointFolders PF = new BLL.PointFolders(); string sqlCondStr = string.Format(" BranchId='{0}' AND (LoanStatus='{1}' {2})", iBranchId, strTargetStatus, strStatus7); //DataSet dsPF = PF.GetList(20, 1,sqlCondStr); DataSet dsPF = PF.GetList(sqlCondStr); if (dsPF == null || dsPF.Tables[0].Rows.Count <= 0) { PageCommon.WriteJsEnd(this, "No Closed or Archived Loan folder found for the branch.", "window.parent.close();"); return; } this.gvFolder.DataSource = dsPF; this.gvFolder.DataBind(); hdnUserId.Value = CurrentUser.iUserID.ToString(); hdnFileId.Value = strFileId; } }
protected void Page_Load(object sender, EventArgs e) { sCloseDialogCodes = this.Request.QueryString["CloseDialogCodes"]; if (sCloseDialogCodes == null) { string Msg = ""; nullflag = true; //sCloseDialogCodes = "window.parent.CloseDialog_CloseLoan();"; //PageCommon.WriteJsEnd(this, Msg, sCloseDialogCodes); //return; } if (sCloseDialogCodes == "taskBaseParent.parent.CloseGlobalPopup()") { sCloseDialogCodes = "window.parent.CloseGlobalPopup();"; } else { sCloseDialogCodes = "window.parent.CloseDialog_CloseLoan();"; } if (!IsPostBack) { string strFileId = Request.QueryString["fid"]; // file id if (string.IsNullOrEmpty(strFileId)) { PageCommon.WriteJsEnd(this, "Invalid FileId=" + strFileId, PageCommon.Js_RefreshSelf); return; } int FileId = Convert.ToInt32(strFileId); if (FileId <= 0) { PageCommon.WriteJsEnd(this, "Invalid FileId.", PageCommon.Js_RefreshSelf); return; } string strTargetStatus = "3"; //string strTargetStatus = Request.QueryString["tls"]; // target folder status int iBranchId = 0; string strStatus7 = " OR LoanStatus='7'"; BLL.PointFiles pFile = new BLL.PointFiles(); iBranchId = pFile.GetPointFileBrancId(strFileId, ""); BLL.PointFolders PF = new BLL.PointFolders(); string sqlCondStr = string.Format(" BranchId='{0}' AND (LoanStatus='{1}' {2})", iBranchId, strTargetStatus, strStatus7); //CR60 ADD BLL.Company_Point bllcomPoint = new BLL.Company_Point(); Model.Company_Point compointInfo = bllcomPoint.GetModel(); if (compointInfo != null && compointInfo.Enable_MultiBranchFolders) { sqlCondStr = string.Format(" (LoanStatus=2 OR LoanStatus=7) order by [Name] asc"); } //CR60 END //DataSet dsPF = PF.GetList(20, 1,sqlCondStr); DataSet dsPF = PF.GetList(sqlCondStr); if (dsPF == null || dsPF.Tables[0].Rows.Count <= 0) { PageCommon.WriteJsEnd(this, "No Closed or Archived Loan folder found for the branch.", sCloseDialogCodes); return; } this.gvFolder.DataSource = dsPF; this.gvFolder.DataBind(); hdnUserId.Value = CurrentUser.iUserID.ToString(); hdnFileId.Value = strFileId; } }
protected void Page_Load(object sender, EventArgs e) { _strPstatus = Request.QueryString["tls"]; strFileId = Request.QueryString["fid"]; // file id if (!IsPostBack) { string strTargetStatus = Request.QueryString["tls"]; // target folder status string strBranchId = Request.QueryString["bid"]; string err; if (string.IsNullOrEmpty(strFileId) || string.IsNullOrEmpty(strTargetStatus)) { err = string.Format("Invalid file Id: {0} or LoanStatus={1}.", strFileId, strTargetStatus); LPLog.LogMessage(LogType.Logerror, err); //PageCommon.WriteJsEnd(this, "The operation failed, "+err, PageCommon.Js_RefreshParent); PageCommon.WriteJsEnd(this, "The operation failed, " + err, "window.parent.CloseGlobalPopup();"); return; } int iLoanId = Convert.ToInt32(strFileId); BLL.PointFolders PF = new BLL.PointFolders(); string sqlCondStr = " 1>0 "; string orderby = " Order By Name "; //CR60 BLL.Company_Point CPMgr = new BLL.Company_Point(); Model.Company_Point CPModel = CPMgr.GetModel(); //check if Company_Point.Enable_MultiBranchFolders=true //select FolderId, [Name] from PointFolders where (LoanStatus=<selected loan/lead status>) order by [Name] asc bool bMultBranchFolder = false; if (CPModel.Enable_MultiBranchFolders == true) { bMultBranchFolder = true; } #region 需求变化,暂去掉Status控制,bug 1186 by Alex 20110904 //if ("1" == Request.QueryString["forProspect"]) //{ // switch (strTargetStatus.ToLower()) // { // //change Request 011 : if the Loans.ProspectLoanStatus<>’Active’, display a list of prospect archive folders (PointFolders.LoanStatus=8) within the branch of the loan and invoke Point Manager’s MoveFile method as it’s currently doing. // //case "converted": // // sqlCondStr = " LoanStatus=1 AND Enabled=1 "; // processing // // break; // case "active": // sqlCondStr = " LoanStatus=6 AND Enabled=1 "; // active prospect // break; // default: // sqlCondStr = " LoanStatus=8 AND Enabled=1 "; // " LoanStatus<>1 AND LoanStatus<>6 "; // break; // } //} //else //{ // if (strTargetStatus == "Processing") // { // strTargetStatus = "1"; // } // else if (strTargetStatus == "Prospect") // { // strTargetStatus = "6"; // } // else if (strTargetStatus == "Canceled") // { // strTargetStatus = "2"; // } // else if (strTargetStatus == "Closed") // { // strTargetStatus = "3"; // } // else if (strTargetStatus == "Denied") // { // strTargetStatus = "4"; // } // else if (strTargetStatus == "Suspended") // { // strTargetStatus = "5"; // } // else if (strTargetStatus == "Archive") // { // strTargetStatus = "7"; // } // sqlCondStr = " (LoanStatus=" + strTargetStatus; // if (strTargetStatus == "1" || strTargetStatus == "6") // sqlCondStr += " AND Enabled=1) "; // processing // else // sqlCondStr += " OR LoanStatus=7) "; //} #endregion DataSet dsPF = null; string sProspect = ""; if (strBranchId == "-1" || string.IsNullOrEmpty(strBranchId) || strBranchId == "0") { sProspect = Request.QueryString["forProspect"] == null ? "" : Request.QueryString["forProspect"].ToString(); //是否是Lead调用 strBranchId = PF.GetLoanOfficerBranchID(iLoanId, (sProspect == "1" ? "lead" : "")); if (strBranchId == "0") //查不到Branch信息 { if (bMultBranchFolder == false) { dsPF = PF.GetListByLoanId(iLoanId, sqlCondStr + orderby); } else { dsPF = PF.GetList(sqlCondStr + orderby); } } else { if (bMultBranchFolder == false) { sqlCondStr += " AND BranchId=" + strBranchId; } dsPF = PF.GetList(sqlCondStr + orderby); } } else { if (bMultBranchFolder == false) { sqlCondStr += " AND BranchId=" + strBranchId; } dsPF = PF.GetList(sqlCondStr + orderby); } this.gvFolder.DataSource = dsPF; this.gvFolder.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { _strPstatus = Request.QueryString["tls"]; if (!IsPostBack) { string strFileId = Request.QueryString["fid"]; // file id string strTargetStatus = Request.QueryString["tls"]; // target folder status string strBranchId = Request.QueryString["bid"]; string sType = Request.QueryString["type"] == null ? "" : Request.QueryString["type"]; //Loan List 页面Dispose传递专用参数 string err; if (string.IsNullOrEmpty(strFileId) || string.IsNullOrEmpty(strTargetStatus)) { err = string.Format("Invalid file Id: {0} or LoanStatus={1}.", strFileId, strTargetStatus); LPLog.LogMessage(LogType.Logerror, err); PageCommon.WriteJsEnd(this, "The operation failed, " + err, PageCommon.Js_RefreshParent); ClientFun("callback", string.Format("callBack('{0}');", -1)); return; } Loans LoansManager = new Loans(); int iLoanId = Convert.ToInt32(strFileId); BLL.PointFolders PF = new BLL.PointFolders(); string sqlCondStr = " 1>0 "; string orderby = " Order By Name "; //CR60 BLL.Company_Point CPMgr = new BLL.Company_Point(); Model.Company_Point CPModel = CPMgr.GetModel(); //check if Company_Point.Enable_MultiBranchFolders=true //select FolderId, [Name] from PointFolders where (LoanStatus=<selected loan/lead status>) order by [Name] asc bool bMultBranchFolder = false; if (CPModel.Enable_MultiBranchFolders == true) { bMultBranchFolder = true; } #region 需求变化,暂去掉Status控制,bug 1186 by Alex 20110904 if (sType == "dispose") { if ("1" == Request.QueryString["forProspect"]) { switch (strTargetStatus.ToLower()) { case "converted": sqlCondStr = " LoanStatus=1 AND Enabled=1 "; // processing break; case "active": sqlCondStr = " LoanStatus=6 AND Enabled=1 "; // active prospect break; default: sqlCondStr = " LoanStatus=8 AND Enabled=1 "; // " LoanStatus<>1 AND LoanStatus<>6 "; break; } } else if ("2" == Request.QueryString["forProspect"]) { sqlCondStr = " LoanStatus=8 AND Enabled=1 "; // " LoanStatus<>1 AND LoanStatus<>6 "; } else { if (strTargetStatus == "Processing") { strTargetStatus = "1"; } else if (strTargetStatus == "Prospect") { strTargetStatus = "6"; } else if (strTargetStatus == "Canceled") { strTargetStatus = "2"; } else if (strTargetStatus == "Closed") { strTargetStatus = "3"; } else if (strTargetStatus == "Denied") { strTargetStatus = "4"; } else if (strTargetStatus == "Suspended") { strTargetStatus = "5"; } else if (strTargetStatus == "Archive") { strTargetStatus = "7"; } sqlCondStr = " (LoanStatus=" + strTargetStatus; if (strTargetStatus == "1" || strTargetStatus == "6") { sqlCondStr += " AND Enabled=1) "; // processing } else { sqlCondStr += " OR LoanStatus=7) "; } } } #endregion string sFileName = LoansManager.GetProspectFileNameInfo(Convert.ToInt32(strFileId)); if (sFileName == "" && strTargetStatus.ToLower() != "converted") //bug 877 { ClientFun("callback", string.Format("callBack('{0}');", "0")); return; } DataSet dsPF = null; string sProspect = ""; if (strBranchId == "-1" || string.IsNullOrEmpty(strBranchId) || strBranchId == "0") { sProspect = Request.QueryString["forProspect"] == null ? "" : Request.QueryString["forProspect"].ToString(); //是否是Lead调用 strBranchId = PF.GetLoanOfficerBranchID(iLoanId, (sProspect == "1" ? "lead" : "")); if (strBranchId == "0") //查不到Branch信息 { if (bMultBranchFolder == false) { dsPF = PF.GetListByLoanId(iLoanId, sqlCondStr + orderby); } else { dsPF = PF.GetList(sqlCondStr + orderby); } } else { if (bMultBranchFolder == false) { sqlCondStr += " AND BranchId=" + strBranchId; } dsPF = PF.GetList(sqlCondStr + orderby); } } else { if (bMultBranchFolder == false) { sqlCondStr += " AND BranchId=" + strBranchId; } dsPF = PF.GetList(sqlCondStr + orderby); } this.gvFolder.DataSource = dsPF; this.gvFolder.DataBind(); } }