protected void Page_Load(object sender, EventArgs e) { #region Tab Pages //if (!NewMode) // ShowDetails(); //else //{ // RadMultiPage1.SelectedIndex = 0; // tsOrders.Tabs[0].Selected = true; //} #endregion BOLClass = new BOLOrders(); //lblSysName.Text = BOLClass.PageLable; if ((Code == null) && (!NewMode)) { return; } if (!Page.IsPostBack) { if (!NewMode) { ShowDetails(); } #region Fill Combo cboHCGenderCode.DataSource = new BOLHardCode().GetHCDataTable("HCGenders"); cboHCSendTypeCode.DataSource = new BOLHardCode().GetHCDataTable("HCSendTypes"); cboHCOrderStatusCode.DataSource = new BOLHardCode().GetHCDataTable("HCOrderStatuses"); cboHCPayMethodCode.DataSource = new BOLHardCode().GetHCDataTable("HCPayMethods"); #endregion if (!NewMode) { LoadData((int)Code); BOLOrders OrdersBOL = new BOLOrders(); Orders CurOrder = ((IBaseBOL <Orders>)OrdersBOL).GetDetails((int)Code); int? UserTransactionCode = CurOrder.UserTransactionCode; if (UserTransactionCode != null) { BOLUserTransactions UserTransactionsBOL = new BOLUserTransactions(1); UserTransactions CurTrans = UserTransactionsBOL.GetDetails((int)UserTransactionCode); if (CurTrans.HCTransStatusCode == 2) { lblPayStatus.Text = "پرداخت شده"; } } } } }
protected void btnDownload_Click(object sender, EventArgs e) { if (ViewState["TransactionCode"] == null) { return; } int UserTransactionCode = Convert.ToInt32(ViewState["TransactionCode"]); BOLUserTransactions UserTransactionsBOL = new BOLUserTransactions(1); UserTransactions CurTransaction = UserTransactionsBOL.GetDetails(UserTransactionCode); if (CurTransaction.ItemType == "Booklet") { int BookletCode = (int)CurTransaction.ItemCode; BOLBooklets BookletsBOL = new BOLBooklets(); string PDFFile = BookletsBOL.GetPDFFile(BookletCode); if (!string.IsNullOrEmpty(PDFFile)) { StartDowload(CurTransaction.ItemType, PDFFile); } else { msgBox.MessageTextMode = AKP.Web.Controls.Common.MessageMode.Error; msgBox.Text = "فایلی برای دانلود وجود ندارد"; } } else if (CurTransaction.ItemType == "Exam") { int ExamCode = (int)CurTransaction.ItemCode; BOLExams ExamsBOL = new BOLExams(); string PDFFile = ExamsBOL.GetPDFFile(ExamCode); if (!string.IsNullOrEmpty(PDFFile)) { StartDowload(CurTransaction.ItemType, PDFFile); } else { msgBox.MessageTextMode = AKP.Web.Controls.Common.MessageMode.Error; msgBox.Text = "فایلی برای دانلود وجود ندارد"; } } }