protected void Page_Load(object sender, EventArgs e) { base.Page_Load(sender, e); if (!this.IsPostBack) { PageUtility.SetContentTitle(this.Page, "出差审批"); this.Page.Title = "出差审批"; int formID = int.Parse(Request["ObjectID"]); this.ViewState["ObjectId"] = formID; QueryDS.FormViewRow rowForm = new FormQueryBLL().GetFormViewByID(formID); FormDS.FormTravelApplyRow applyRow = this.PersonalReimburseBLL.GetFormTravelApplyByID(formID); if (rowForm.IsProcIDNull()) { ViewState["ProcID"] = ""; } else { ViewState["ProcID"] = rowForm.ProcID; } ViewState["OrganizationUnitID"] = rowForm.OrganizationUnitID; txtFormNo.Text = rowForm.FormNo; AuthorizationDS.StuffUserRow applicant = new AuthorizationBLL().GetStuffUserById(rowForm.UserID); this.StuffNameCtl.Text = applicant.StuffName; this.PositionNameCtl.Text = new OUTreeBLL().GetPositionById(rowForm.PositionID).PositionName; if (new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID) != null) { this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID).OrganizationUnitName; } this.AttendDateCtl.Text = applicant.AttendDate.ToShortDateString(); if (!applyRow.IsTransportFeeNull()) { this.txtTransportFee.Text = applyRow.TransportFee.ToString("N"); } if (!applyRow.IsHotelFeeNull()) { this.txtHotelFee.Text = applyRow.HotelFee.ToString("N"); } if (!applyRow.IsMealFeeNull()) { this.txtMealFee.Text = applyRow.MealFee.ToString("N"); } if (!applyRow.IsOtherFeeNull()) { this.txtOtherFee.Text = applyRow.OtherFee.ToString("N"); } if (!applyRow.IsTotalFeeNull()) { this.txtTotal.Text = applyRow.TotalFee.ToString("N"); } this.RemarkCtl.Text = applyRow.Remark; if (!applyRow.IsAttachedFileNameNull() && !applyRow.IsRealAttachedFileNameNull()) { this.UCFileUpload.AttachmentFileName = applyRow.RealAttachedFileName; this.UCFileUpload.RealAttachmentFileName = applyRow.RealAttachedFileName; } // 打开明细表 FormTravelApplyDetailTableAdapter taDetail = new FormTravelApplyDetailTableAdapter(); taDetail.FillByApplyID(this.InnerDS.FormTravelApplyDetail, formID); //历史单据 if (rowForm.IsRejectedFormIDNull()) { lblRejectFormNo.Text = "无"; } else { FormDS.FormRow rejectedForm = this.PersonalReimburseBLL.GetFormByID(rowForm.RejectedFormID)[0]; this.lblRejectFormNo.Text = rejectedForm.FormNo; this.lblRejectFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/OtherForm/TravelApproval.aspx?ShowDialog=1&ObjectID=" + rejectedForm.FormID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')"; } //审批页面处理&按钮处理 AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"]; this.ViewState["StuffUserID"] = stuffUser.StuffUserId; if (Session["ProxyStuffUserId"] == null && rowForm.InTurnUserIds.Contains("P" + stuffUser.StuffUserId + "P")) { this.SubmitBtn.Visible = true; this.cwfAppCheck.IsView = false; this.ViewState["IsView"] = false; } else { this.SubmitBtn.Visible = false; this.cwfAppCheck.IsView = true; this.ViewState["IsView"] = true; } if (rowForm.StatusID == (int)SystemEnums.FormStatus.Rejected && (stuffUser.StuffUserId == rowForm.UserID)) { this.EditBtn.Visible = true; this.ScrapBtn.Visible = true; } else { this.EditBtn.Visible = false; this.ScrapBtn.Visible = false; } //如果是弹出,取消按钮不可见 if (this.Request["ShowDialog"] != null) { if (this.Request["ShowDialog"].ToString() == "1") { this.upButton.Visible = false; this.Master.FindControl("divMenu").Visible = false; this.Master.FindControl("tbCurrentPage").Visible = false; } } } this.cwfAppCheck.FormID = (int)this.ViewState["ObjectId"]; this.cwfAppCheck.ProcID = this.ViewState["ProcID"].ToString(); this.cwfAppCheck.IsView = (bool)this.ViewState["IsView"]; }
protected void OpenForm(int formID) { FormDS.FormRow rowForm = this.PersonalReimburseBLL.GetFormByID(formID)[0]; FormDS.FormTravelApplyRow rowFormTravelApply = this.PersonalReimburseBLL.GetFormTravelApplyByID(formID); if (!rowFormTravelApply.IsTransportFeeNull()) { this.txtTransportFee.Text = rowFormTravelApply.TransportFee.ToString("N"); } else { this.txtTransportFee.Text = "0"; } if (!rowFormTravelApply.IsHotelFeeNull()) { this.txtHotelFee.Text = rowFormTravelApply.HotelFee.ToString("N"); } else { this.txtHotelFee.Text = "0"; } if (!rowFormTravelApply.IsMealFeeNull()) { this.txtMealFee.Text = rowFormTravelApply.MealFee.ToString("N"); } else { this.txtMealFee.Text = "0"; } if (!rowFormTravelApply.IsOtherFeeNull()) { this.txtOtherFee.Text = rowFormTravelApply.OtherFee.ToString("N"); } else { this.txtOtherFee.Text = "0"; } if (!rowFormTravelApply.IsTotalFeeNull()) { this.txtTotalAmount.Text = rowFormTravelApply.TotalFee.ToString("N"); } else { this.txtOtherFee.Text = "0"; } //赋值 if (!rowFormTravelApply.IsRemarkNull()) { this.RemarkCtl.Text = rowFormTravelApply.Remark; } if (!rowFormTravelApply.IsAttachedFileNameNull() && !rowFormTravelApply.IsRealAttachedFileNameNull()) { this.UCFileUpload.AttachmentFileName = rowFormTravelApply.RealAttachedFileName; this.UCFileUpload.RealAttachmentFileName = rowFormTravelApply.RealAttachedFileName; } // 打开明细表 FormTravelApplyDetailTableAdapter taDetail = new FormTravelApplyDetailTableAdapter(); taDetail.FillByApplyID(this.InnerDS.FormTravelApplyDetail, formID); }