/// <summary> /// 添加一条新的数据到数据库 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAddSave_Click(object sender, EventArgs e) { var tbxLeadSource = gvLeadSourceses.FooterRow.FindControl("tbxLeadSource") as TextBox; var ddlDefaultUser = gvLeadSourceses.FooterRow.FindControl("ddlUsers") as DropDownList; var cbxDefault = gvLeadSourceses.FooterRow.FindControl("cbxDefaultStr") as CheckBox; var record = new LPWeb.Model.Company_Lead_Sources { LeadSource = tbxLeadSource.Text.Trim(), Default = cbxDefault.Checked, DefaultUserId = int.Parse(ddlDefaultUser.SelectedValue), }; try { //更新Default bllLeadSource.UpdateDefault(cbxDefault.Checked); bllLeadSource.Add(record); } catch (Exception exception) { LPLog.LogMessage(exception.Message); } gvLeadSourceses.ShowFooter = false; lbtnAdd.Text = "Add"; FillDataGrid(string.Empty); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ddlRegion_SelectedIndexChanged(object sender, EventArgs e) { if (ddlRegion.SelectedIndex < 0) { return; } try { this.ddlDivision.AutoPostBack = false; if (ddlRegion.SelectedValue == "0") { string sDivisionID = this.ddlDivision.SelectedValue; string sBranchID = this.ddlBranch.SelectedValue; this.ddlDivision.DataSource = this.GetDivisionData("0"); this.ddlBranch.DataSource = this.GetBranchData("0", "0"); this.ddlDivision.DataBind(); this.ddlBranch.DataBind(); this.ddlDivision.SelectedValue = sDivisionID; this.ddlBranch.SelectedValue = sBranchID; } else { this.ddlDivision.DataSource = this.GetDivisionData(this.ddlRegion.SelectedValue); this.ddlBranch.DataSource = this.GetBranchData(this.ddlRegion.SelectedValue, "0"); this.ddlDivision.DataBind(); this.ddlBranch.DataBind(); } this.ddlDivision.AutoPostBack = true; } catch (Exception ex) { LPLog.LogMessage(LogType.Logdebug, ex.ToString()); } }
/// <summary> /// Save changes /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { bool bEnabled = cbxEnabled.Checked; string sDesc = tbxDescription.Text; string sDivisionMemberIDs = hdnDivisionMemberIDs.Value; string sExectives = hdnExecutivesMembers.Value; int groupId = int.Parse(ddlGroupAccess.SelectedValue); StringBuilder sbOldGroupMemberIDs = new StringBuilder(); try { _bllRegions.SaveRegionAndMembersBase(CurrentRegion.RegionId, bEnabled, sDesc, groupId, sDivisionMemberIDs, sExectives); //Save group folder info if (groupId != 0) { GroupFolder groupFolder = new GroupFolder(); groupFolder.DoSaveGroupFolder(groupId, CurrentRegion.RegionId, "region", Convert.ToInt32(CurrentRegion.GroupID)); } } catch (Exception ex) { PageCommon.AlertMsg(this, "Failed to save region info, please try it again."); LPLog.LogMessage(LogType.Logerror, "Failed to save region info, reason: " + ex.Message); return; } PageCommon.WriteJsEnd(this, "Region saved successfully.", "window.location.href='" + sReturnPage + "?RegionID=" + CurrentRegion.RegionId + "'"); }
/// <summary> /// Bind Grid /// </summary> private void BindTemplateTasksGrid() { int pageSize = AspNetPager1.PageSize; int pageIndex = PageIndex; string queryCondition = GenerateQueryCondition(); if (WflTemplId == 0) { return; } int recordCount = 0; DataSet tpLists = null; try { tpLists = template.GetTemplateWorkflowTasks(pageSize, pageIndex, queryCondition, out recordCount, OrderName, OrderType); } catch (Exception exception) { LPLog.LogMessage(exception.Message); } AspNetPager1.PageSize = pageSize; AspNetPager1.RecordCount = recordCount; gvTaskList.DataSource = null; gvTaskList.DataBind(); gvTaskList.DataSource = tpLists; gvTaskList.DataBind(); }
/// <summary> /// Saves this instance. /// </summary> /// <returns></returns> private bool Save() { bool status = false; try { if (isNew) { bllCompanyGeneral.Add(modCompanyGeneral); } else { //Get old group id (Rocky - 2011-1-30) LPWeb.BLL.Groups groupMgr = new LPWeb.BLL.Groups(); LPWeb.Model.Groups model = groupMgr.GetCompanyGroup(); this.iOldGroupID = model.GroupId; bllCompanyGeneral.Update(modCompanyGeneral); } status = true; } catch (Exception exception) { status = false; LPLog.LogMessage(exception.Message); } return status; }
protected void Page_Load(object sender, EventArgs e) { try { //权限验证 var loginUser = new LoginUser(); if (!loginUser.userRole.CompanySetup) { Response.Redirect("../Unauthorize.aspx"); return; } } catch (Exception exception) { LPLog.LogMessage(exception.Message); } if (!Page.IsPostBack) { if (Request.UrlReferrer != null) { this.btnCancel.PostBackUrl = Request.UrlReferrer.ToString(); } txtSequenceNumber.Text = (bllTaskPickList.GetMaxSequenceNumber() + 10).ToString(); FillDataGrid(string.Empty); } }
/// <summary> /// Bind Grid /// </summary> private void BindContactsGrid(string queryCondition) { int pageSize = 20; int pageIndex = 1; pageIndex = PageIndex; int recordCount = 0; if (this.Request.QueryString["Referral"] != null) { this.OrderName = "TotalReferral"; this.OrderType = 1; } DataSet ds = null; try { ds = bllContactBranchs.GetPartnerContacts(this.CurrUser.iUserID, pageSize, pageIndex, queryCondition, out recordCount, OrderName, OrderType); } catch (Exception exception) { LPLog.LogMessage(exception.Message); } AspNetPager1.PageSize = pageSize; AspNetPager1.RecordCount = recordCount; gvPartnerContacts.DataSource = ds; gvPartnerContacts.DataBind(); }
protected void btnExport_Click(object sender, EventArgs e) { //if (string.IsNullOrEmpty(this.txbPointFileName.Text) || string.IsNullOrEmpty(ddlPointFolder.SelectedValue)) if (string.IsNullOrEmpty(ddlPointFolder.SelectedValue)) { PageCommon.WriteJs(this, "You must specify the Point Folder.", this.sRefreshCodes + this.sCloseDialogCodes); return; } iFileID = Save_LoanDetail(); string sExMsg = string.Empty; try { if (UpdatePointFile(iFileID, true, ref sExMsg) == false) { PageCommon.WriteJs(this, sExMsg, this.sRefreshCodes + this.sCloseDialogCodes); return; } PageCommon.WriteJsEnd(this, "Exported to Point file successfully.", this.sRefreshCodes + this.sCloseDialogCodes); } catch (System.ServiceModel.EndpointNotFoundException) { sExMsg = string.Format("Failed to export to the Point File, FileId={0}, {1}", this.iFileID, "Point Manager is not running."); LPLog.LogMessage(LogType.Logerror, sExMsg); PageCommon.WriteJsEnd(this, sExMsg, this.sRefreshCodes + this.sCloseDialogCodes); } catch (Exception ex) { sExMsg = string.Format("Failed to export to the Point File, FileID={0}, Error:{1}", this.iFileID, ex.Message); LPLog.LogMessage(LogType.Logerror, sExMsg); PageCommon.WriteJsEnd(this, sExMsg, this.sRefreshCodes + this.sCloseDialogCodes); } }
protected void lbtnDelete_Click(object sender, EventArgs e) { Dictionary <int, int> dicIDs = new Dictionary <int, int>(); // Get userid of current selected row foreach (GridViewRow row in gridErrors.Rows) { if (DataControlRowType.DataRow == row.RowType) { CheckBox ckbChecked = row.FindControl("ckbSelected") as CheckBox; if (null != ckbChecked && ckbChecked.Checked) { dicIDs.Add(row.RowIndex, (int)gridErrors.DataKeys[row.RowIndex].Value); } } } if (dicIDs.Count > 0) { try { PIHManager.DeleteImportErrors(dicIDs.Select(i => i.Value).ToList()); } catch (Exception ex) { ClientFun(this.updatePanel, "failedtodeleteuserinad", "alert('Failed to delete the selected import error(s), please try it again.');"); LPLog.LogMessage(LogType.Logerror, "Failed to delete the selected import error record(s): " + ex.Message); return; } BindGrid(); } }
/// <summary> /// Bind contact role gridview /// </summary> private void BindGrid() { int pageSize = AspNetPager1.PageSize; int pageIndex = 1; if (isReset == true) { pageIndex = AspNetPager1.CurrentPageIndex = 1; } else { pageIndex = AspNetPager1.CurrentPageIndex; } string strWhare = GetSqlWhereClause(); int recordCount = 0; DataSet lmEvents = null; try { lmEvents = lmeMngr.GetListForMarketingActivitiesEvents(pageSize, pageIndex, strWhare, out recordCount, OrderName, OrderType); } catch (Exception exception) { LPLog.LogMessage(exception.Message); } AspNetPager1.PageSize = pageSize; AspNetPager1.RecordCount = recordCount; gridList.DataSource = lmEvents; gridList.DataBind(); }
protected void btnSave_Click(object sender, EventArgs e) { if (!CheckInput()) { return; } string err = string.Empty; try { iFileID = Save_LoanDetail(); if (string.IsNullOrEmpty(this.txbPointFileName.Text) || string.IsNullOrEmpty(ddlPointFolder.SelectedValue)) { // success PageCommon.WriteJs(this, "Save loan detail successfully.", this.sRefreshCodes + this.sCloseDialogCodes); return; } if (UpdatePointFile(iFileID, true, ref err) == false) { err = string.Format("Failed to update the Point file, FileId={0}, Error:{1}", iFileID, err); PageCommon.WriteJs(this, err, this.sRefreshCodes + this.sCloseDialogCodes); return; } } catch (Exception ex) { LPLog.LogMessage(ex.Message); err = string.Format("Failed to save the loan, FileId={0}, Error:{1}", iFileID, ex.Message); PageCommon.WriteJsEnd(this, err, this.sRefreshCodes + this.sCloseDialogCodes); } // success PageCommon.WriteJsEnd(this, "Save loan detail successfully.", this.sRefreshCodes + this.sCloseDialogCodes); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { try { //CheckInput /*同一Workflow type下的stage Name不可重复 * /Name必输 */ if (!CheckInput()) { return; } this.SaveStage(this.SetStageModel()); Response.Write("<script>window.parent.ClosePopupStage(); </script>"); if (FromPage.Length > 0) { Response.Write("<script>parent.window.location.href=parent.window.location.href </script>"); } } catch (Exception ex) { LPLog.LogMessage(LogType.Logdebug, ex.ToString()); } }
/// <summary> /// Fills the data grid. /// </summary> /// <param name="condition">The condition.</param> private void FillDataGrid(string condition) { List <LPWeb.Model.Company_Lead_Sources> LeadSourceses = null; try { LeadSourceses = bllLeadSource.GetModelList(condition); } catch (Exception exception) { LPLog.LogMessage(exception.Message); } if (LeadSourceses != null && LeadSourceses.Count == 0) { if (gvLeadSourceses.ShowFooter) { LeadSourceses.Add(new LPWeb.Model.Company_Lead_Sources()); } } gvLeadSourceses.DataSource = LeadSourceses; gvLeadSourceses.DataBind(); if (LeadSourceses != null && LeadSourceses.Count > 0) { if (LeadSourceses[0].LeadSource == null) { gvLeadSourceses.Rows[0].Visible = false; } } }
/// <summary> /// 修改数据到数据库 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void gvLeadSourceses_RowUpdating(object sender, GridViewUpdateEventArgs e) { int leadSourceID = 0; if (gvLeadSourceses.DataKeys[e.RowIndex] != null) { leadSourceID = int.Parse(gvLeadSourceses.DataKeys[e.RowIndex].Values[0].ToString()); } string leadSource = ((TextBox)gvLeadSourceses.Rows[e.RowIndex].FindControl("txtLeadSource")).Text; int defaultUserId = int.Parse(((DropDownList)gvLeadSourceses.Rows[e.RowIndex].FindControl("ddlDefaultUser")).SelectedValue); bool isDefault = ((CheckBox)gvLeadSourceses.Rows[e.RowIndex].FindControl("cbxDefaultStr")).Checked; bllLeadSource.UpdateDefault(isDefault); LPWeb.Model.Company_Lead_Sources leadSourceModel = new LPWeb.Model.Company_Lead_Sources(); leadSourceModel.LeadSourceID = leadSourceID; leadSourceModel.LeadSource = leadSource; leadSourceModel.DefaultUserId = defaultUserId; leadSourceModel.Default = isDefault; try { bllLeadSource.Update(leadSourceModel); } catch (Exception exception) { LPLog.LogMessage(exception.Message); } gvLeadSourceses.EditIndex = -1; FillDataGrid(string.Empty); }
protected void btnSelect_Click(object sender, EventArgs e) { string sCheckValues = hdnSelectedCampaignIds.Value; string sCampaignName = string.Empty; string sCategoryName = string.Empty; sCheckValues = sCheckValues.TrimEnd(','); int cId = 0; int.TryParse(sCheckValues, out cId); try { var model = marketingCampaigns.GetModel(cId); if (model != null) { sCampaignName = model.CampaignName; // sCategoryName = model.CategoryName; } } catch (Exception exception) { LPLog.LogMessage(exception.Message); } ClientFun("callback", string.Format("callBack('{0}','{1}','{2}');", sCheckValues, sCampaignName, sCategoryName)); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { try { //CheckInput /*同一Template下的Task Name不可重复 * /Name, Stage必输 */ if (!CheckInput()) { return; } this.SaveWflTask(this.SetTaskModel()); if (FromPage.Length > 0) { Response.Write("<script>window.parent.location.href=window.parent.location.href </script>"); } Response.Write("<script>window.parent.ClosePopupTask(); </script>"); } catch (Exception ex) { LPLog.LogMessage(LogType.Logdebug, ex.ToString()); } }
protected void btnSave_Click(object sender, EventArgs e) { if (this.CurrentProspectId == 0) { return; } try { ReassignProspect(); LPWeb.BLL.Prospect bProspect = new Prospect(); bProspect.AssignProspect(CurrentProspectId, Convert.ToInt32(ddlUsers.SelectedItem.Value), oldUserID); //PageCommon.WriteJsEnd(this, "Assign Prospect Successfully", PageCommon.Js_RefreshParent); PageCommon.RegisterJsMsg(this, "Assign prospect successfully!", "parent.DialogAssignClose();"); } catch (System.ServiceModel.EndpointNotFoundException ex) { LPLog.LogMessage(ex.Message); PageCommon.WriteJsEnd(this, "Failed to assign prospect, reason: Point Manager is not running.", PageCommon.Js_RefreshSelf); } catch (Exception exception) { LPLog.LogMessage(exception.Message); PageCommon.WriteJsEnd(this, string.Format("Failed to assign prospect, reason:{0}.", exception.Message), PageCommon.Js_RefreshSelf); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDelete_Click(object sender, EventArgs e) { try { //check loan task /*Delete: delete this Workflow Task. If this Workflow Task has been referenced by LoanTasks table, it will display the following message: * The Workflow Task has been referenced by loan tasks. Deleting this Workflow Task will remove the references and is not reversible. Are you sure you want to continue? * [Yes] [No] */ this.taskTmpMgr.Delete(this.iTaskID); //Close windows and refresh parent windows if (FromPage.Length > 0) { Response.Write("<script>window.parent.location.href=window.parent.location.href </script>"); } Response.Write("<script>window.parent.ClosePopupTask(); </script>"); } catch (Exception ex) { LPLog.LogMessage(LogType.Logdebug, ex.ToString()); } }
public byte[] GetPhoto(int photoId) { try { modCompanyWeb = bllCompanyWeb.GetModel(); if (modCompanyWeb != null) { if (modCompanyWeb.HomePageLogoData.Length > 0 && photoId == 1) { return(modCompanyWeb.HomePageLogoData); } if (modCompanyWeb.SubPageLogoData.Length > 0 && photoId == 2) { return(modCompanyWeb.SubPageLogoData); } } return(null); } catch (Exception exception) { modCompanyWeb = null; LPLog.LogMessage(exception.Message); } return(null); }
protected void lnkRemove_Click(object sender, EventArgs e) { string sDelContactIDs = this.hdnDelContactIDs.Value; string sDirections = this.hdnDirections.Value; string[] DelContactIDArray = sDelContactIDs.Split(','); string[] DirectionArray = sDirections.Split(','); // delete Contact_Relationship RelationshipManager = new Contact_Relationship(); try { // delete RelationshipManager.DeleteContactRelationship(this.iContactID, DelContactIDArray, DirectionArray); } catch (Exception ex) { string sExMsg = string.Format("Exception occurred while trying to delete the relationship (ContactID={0}): {1}", this.iContactID, ex.Message); LPLog.LogMessage(LogType.Logerror, ex.Message); PageCommon.WriteJsEnd(this, "Exception occurred while trying to delete the relationship.", "window.location.href=window.location.href;"); } // success PageCommon.WriteJsEnd(this, "Deleted the relationship successfully.", "window.location.href=window.location.href;"); }
private void BindInfo() { try { if (UserId.HasValue) { //绑定用户信息 BindUserInfo(); BindUserLeadDist(); BindLeadSource(); BindState(); BindPurpose(); BindLoanType(); } } catch (Exception exception) { LPLog.LogMessage(exception.Message); } }
/// <summary> /// Bind Grid /// </summary> private void BindReportGrid() { int pageSize = AspNetPager1.PageSize; int pageIndex = 1; if (AspNetPager1.CurrentPageIndex > 0 && isReset == false) { pageIndex = AspNetPager1.CurrentPageIndex; } int recordCount = 0; DataSet reports = null; try { reports = branchManager.GetBranchGoalsReport(pageSize, pageIndex, iRegionID.ToString(), iDivisionID.ToString(), iBranchID.ToString(), out recordCount, OrderName, OrderType); } catch (Exception exception) { LPLog.LogMessage(exception.Message); } AspNetPager1.PageSize = pageSize; AspNetPager1.RecordCount = recordCount; gvBranchReport.DataSource = reports; gvBranchReport.DataBind(); }
/// <summary> /// Inits the group access. /// </summary> private void InitGroupAccess() { var bllGroup = new LPWeb.BLL.Groups(); DataSet dsGroups = null; try { //get data from database dsGroups = bllGroup.GetCompanyRelGroups(); } catch (Exception exception) { //log the error LPLog.LogMessage(exception.Message); return; } if (dsGroups != null && dsGroups.Tables.Count > 0 && dsGroups.Tables[0].Rows.Count > 0) { ddlGroupAccess.DataSource = dsGroups; ddlGroupAccess.DataTextField = "GroupName"; ddlGroupAccess.DataValueField = "GroupId"; ddlGroupAccess.DataBind(); //set selected item foreach (DataRow dataRow in dsGroups.Tables[0].Select("CompanyID is not null and OrganizationType='Company'")) { if (dataRow.IsNull("GroupId") == false) { ViewState["previousSelectedIem"] = dataRow["GroupId"]; ddlGroupAccess.SelectedValue = dataRow["GroupId"].ToString(); } } } }
protected void lbtnDelete_Click(object sender, EventArgs e) { List <int> listIDs = new List <int>(); // Get userid of current selected row foreach (GridViewRow row in gridList.Rows) { if (DataControlRowType.DataRow == row.RowType) { CheckBox ckbChecked = row.FindControl("ckbSelected") as CheckBox; if (null != ckbChecked && ckbChecked.Checked) { listIDs.Add((int)gridList.DataKeys[row.RowIndex].Value); } } } if (listIDs.Count > 0) { try { EmailTempManager.DeleteEmailTemplates(listIDs); } catch (Exception ex) { ClientFun(this.updatePanel, "failedtodeleterecord", "alert('Failed to delete the selected email template(s), please try it again.');"); LPLog.LogMessage(LogType.Logerror, "Failed to delete the selected user account(s): " + ex.Message); return; } BindGrid(); } }
/// <summary> /// Page load event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { try { if (this.IsPostBack == false) { this.FolderSqlDataSource.ConnectionString = LPWeb.DAL.DbHelperSQL.connectionString; //权限验证 var loginUser = new LoginUser(); if (!loginUser.userRole.CompanySetup) { Response.Redirect("../Unauthorize.aspx"); return; } else { if (!loginUser.userRole.ImportLoan) { lbtnSync.Enabled = false; lbtnSuspend.Enabled = false; } } this.DoInitData(); this.BindingGrid(); } } catch (Exception ex) { LPLog.LogMessage(LogType.Logdebug, ex.ToString()); } }
/// <summary> /// Bind email template gridview /// </summary> private void BindGrid() { int pageSize = AspNetPager1.PageSize; int pageIndex = 1; if (isReset == true) { pageIndex = AspNetPager1.CurrentPageIndex = 1; } else { pageIndex = AspNetPager1.CurrentPageIndex; } string strWhare = GetSqlWhereClause(); int recordCount = 0; DataSet listData = null; try { listData = EmailTempManager.GetListForGridView(pageSize, pageIndex, strWhare, out recordCount, OrderName, OrderType); } catch (Exception exception) { LPLog.LogMessage(exception.Message); } AspNetPager1.PageSize = pageSize; AspNetPager1.RecordCount = recordCount; gridList.DataSource = listData; gridList.DataBind(); }
/// <summary> /// Bind Grid /// </summary> private void BindGrid() { int pageIndex = 1; int pageSize = AspNetPager1.PageSize; if (AspNetPager1.CurrentPageIndex > 0 && isReset == false) { pageIndex = AspNetPager1.CurrentPageIndex; } string queryCondition = GenOrgQueryCondition(); int recordCount = 0; DataSet LoanMarketingLists = null; try { LoanMarketingLists = _bLoanMarketing.GetLoanMarketingByFileID(pageSize, pageIndex, queryCondition, out recordCount, OrderName, OrderType, sFileID); } catch (Exception exception) { LPLog.LogMessage(exception.Message); } AspNetPager1.PageSize = pageSize; AspNetPager1.RecordCount = recordCount; gridList.DataSource = LoanMarketingLists; gridList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { try { LoginUser loginUser = new LoginUser(); if (loginUser.userRole.Reports == false) { Response.Redirect("../Unauthorize.aspx"); return; } } catch (Exception exception) { LPLog.LogMessage(exception.Message); } string sErrorMsg = "Failed to load current page: invalid FileID."; string sReturnPage = "ReportRegionProduction.aspx"; if (this.Request.QueryString["Region"] != null) // 如果有GrouRegionIDpID { string sRegionID = this.Request.QueryString["Region"].ToString(); if (PageCommon.IsID(sRegionID) == false) { PageCommon.WriteJsEnd(this, sErrorMsg, "window.location.href='" + sReturnPage + "'"); } this.iRegionID = Convert.ToInt32(sRegionID); } if (this.Request.QueryString["Division"] != null) { string sDivision = this.Request.QueryString["Division"].ToString(); if (PageCommon.IsID(sDivision) == false) { PageCommon.WriteJsEnd(this, sErrorMsg, "window.location.href='" + sReturnPage + "'"); } this.iDivision = Convert.ToInt32(sDivision); } //Branch if (this.Request.QueryString["Branch"] != null) { string sBranch = this.Request.QueryString["Branch"].ToString(); if (PageCommon.IsID(sBranch) == false) { PageCommon.WriteJsEnd(this, sErrorMsg, "window.location.href='" + sReturnPage + "'"); } this.iBranch = Convert.ToInt32(sBranch); } if (!IsPostBack) { BindReportGrid(); } }
/// <summary> /// Fills the data grid. /// </summary> /// <param name="condition">The condition.</param> private void FillDataGrid(string condition) { DataSet loanProgramses = null; int pageSize = AspNetPager1.PageSize; int pageIndex = 1; if (isReset == true) { pageIndex = AspNetPager1.CurrentPageIndex = 1; } else { pageIndex = AspNetPager1.CurrentPageIndex; } int totalcount = 0; try { loanProgramses = bllLoanProgram.GetListInvestorARMprogram(pageSize, pageIndex, condition, out totalcount, "LoanProgramID", 0); } catch (Exception exception) { LPLog.LogMessage(exception.Message); } gvLoanProgramses.DataSource = loanProgramses; gvLoanProgramses.DataBind(); AspNetPager1.RecordCount = totalcount; }
protected void btnImport_Click(object sender, EventArgs e) { ServiceManager sm = new ServiceManager(); using (LP2ServiceClient service = sm.StartServiceClient()) { ImportCardexRequest req = new ImportCardexRequest(); req.CardexFile = string.Empty; req.hdr = new ReqHdr(); req.hdr.SecurityToken = "SecurityToken"; //todo:check dummy data req.hdr.UserId = 5; //todo:check dummy data ImportCardexResponse respone = null; try { respone = service.ImportCardex(req); if (respone.hdr.Successful) { PageCommon.WriteJsEnd(this, "Imported Cardex successfully.", PageCommon.Js_RefreshSelf); } else { PageCommon.WriteJsEnd(this, "Failed to import Cardex, reason:" + respone.hdr.StatusInfo, PageCommon.Js_RefreshSelf); } } catch (Exception exception) { LPLog.LogMessage(exception.Message); PageCommon.WriteJsEnd(this, "Failed to import Cardex, reason:" + exception.Message, PageCommon.Js_RefreshSelf); } } }