protected void GvData_RowCommand(object sender, GridViewCommandEventArgs e) { try { DataSet dtInfo = new DataSet(); GridViewRow gvrow = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer); hdUniqueId.Value = GvData.DataKeys[gvrow.RowIndex].Value.ToString(); dtInfo = objLtmsService.GetLotteryClaimEntryDtlByReqId(Convert.ToInt64(hdUniqueId.Value)); if (e.CommandName == "PrintEntry") { if (dtInfo.Tables[0].Rows.Count > 0) { Session["ApplicationId"] = dtInfo.Tables[0].Rows[0]["ReqCode"].ToString(); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "popup", "window.open('TrxLotteryClaimEntryPrint.aspx','_blank')", true); } } dtInfo.Dispose(); } catch (Exception Ex) { objValidateData.SaveSystemErrorLog(Ex, Request.UserHostAddress); var message = new JavaScriptSerializer().Serialize("Some Error has occurred while performing your activity. Please contact the System Administrator for further assistance."); var script = string.Format("alert({0});", message); ScriptManager.RegisterClientScriptBlock(this, GetType(), "", script, true); } }
protected void GvData_RowCommand(object sender, GridViewCommandEventArgs e) { try { int SaveStatus = 0; DataSet dtInfo = new DataSet(); GridViewRow gvrow = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer); hdUniqueId.Value = GvData.DataKeys[gvrow.RowIndex].Value.ToString(); objValidateData.ClearAllInputField(pnlDataEntry); dtInfo = objLtmsService.GetLotteryClaimEntryDtlByReqId(Convert.ToInt64(hdUniqueId.Value)); // fill the Location information for edit if (e.CommandName == "EditEntry") { if (dtInfo.Tables[0].Rows.Count > 0) { rdoApproveStatus1.Checked = true; lblApplicationId.Text = "Application Id : " + dtInfo.Tables[0].Rows[0]["ReqCode"].ToString(); lblLotteryType.Text = dtInfo.Tables[0].Rows[0]["LotteryType"].ToString(); lblLotteryName.Text = dtInfo.Tables[0].Rows[0]["LotteryName"].ToString(); lblDrawNo.Text = dtInfo.Tables[0].Rows[0]["DrawNo"].ToString(); lblDrawDate.Text = Convert.ToDateTime(dtInfo.Tables[0].Rows[0]["DrawDate"]).ToString("dd-MMM-yyyy"); lblLotteryNo.Text = dtInfo.Tables[0].Rows[0]["LotteryNo"].ToString(); lblMobileNo.Text = dtInfo.Tables[0].Rows[0]["MobileNo"].ToString(); lblEmailId.Text = dtInfo.Tables[0].Rows[0]["EmailId"].ToString(); lblName.Text = dtInfo.Tables[0].Rows[0]["Name"].ToString(); lblFatherOrGuardianName.Text = dtInfo.Tables[0].Rows[0]["FatherOrGuardianName"].ToString(); lblAddress.Text = dtInfo.Tables[0].Rows[0]["Address"].ToString(); lblAadharNo.Text = dtInfo.Tables[0].Rows[0]["AadharNo"].ToString(); lblPanCard.Text = dtInfo.Tables[0].Rows[0]["PanNo"].ToString(); lblBankName.Text = dtInfo.Tables[0].Rows[0]["BankName"].ToString(); lblBankAccountNo.Text = dtInfo.Tables[0].Rows[0]["BankAccountNo"].ToString(); lblIFSCCode.Text = dtInfo.Tables[0].Rows[0]["IFSCCode"].ToString(); lbllblNameOfPrize.Text = dtInfo.Tables[0].Rows[0]["NameOfPrize"].ToString(); string ClaimType = ""; ClaimType = dtInfo.Tables[0].Rows[0]["ClaimType"].ToString(); if (ClaimType == "1") { txtPrizeAmount.Text = dtInfo.Tables[0].Rows[0]["PrizeAmount"].ToString(); txtPayableToWinner.Text = dtInfo.Tables[0].Rows[0]["UpdatedPayableAmount"].ToString(); } Dictionary <String, String> objClaimType = objValidateData.ClaimType(); lblClaimType.Text = objClaimType[ClaimType]; if (dtInfo.Tables[0].Rows[0]["ClaimType"].ToString() == "1") { trPwtTicket.Visible = true; } if (dtInfo.Tables[0].Rows[0]["Photo"].ToString().Length > 0) { byte[] Photo = ((byte[])dtInfo.Tables[0].Rows[0]["Photo"]); imgPhoto.Visible = true; imgPhoto.BorderWidth = 1; imgPhoto.ImageUrl = "data:image;base64," + Convert.ToBase64String(Photo); } if (dtInfo.Tables[0].Rows[0]["PwtTicket"].ToString().Length > 0) { byte[] PwtTicket = ((byte[])dtInfo.Tables[0].Rows[0]["PwtTicket"]); imgPwtTicket.Visible = true; imgPwtTicket.BorderWidth = 1; imgPwtTicket.ImageUrl = "data:image;base64," + Convert.ToBase64String(PwtTicket); } byte[] aadharPic = ((byte[])dtInfo.Tables[0].Rows[0]["AadharFile"]); imgAadharPic.Visible = true; imgAadharPic.BorderWidth = 1; imgAadharPic.ImageUrl = "data:image;base64," + Convert.ToBase64String(aadharPic); byte[] PanPic = ((byte[])dtInfo.Tables[0].Rows[0]["PanFile"]); imgPan.Visible = true; imgPan.BorderWidth = 1; imgPan.ImageUrl = "data:image;base64," + Convert.ToBase64String(PanPic); byte[] BankDtlPic = ((byte[])dtInfo.Tables[0].Rows[0]["BankDtl"]); imgBankDtl.Visible = true; imgBankDtl.BorderWidth = 1; imgBankDtl.ImageUrl = "data:image;base64," + Convert.ToBase64String(BankDtlPic); btnConfirm.Visible = true; } pnlDataEntry.Visible = true; pnlDataDisplay.Visible = false; } if (e.CommandName == "PrintEntry") { if (dtInfo.Tables[0].Rows.Count > 0) { Session["ApplicationId"] = dtInfo.Tables[0].Rows[0]["ReqCode"].ToString(); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "popup", "window.open('TrxLotteryClaimEntryPrint.aspx','_blank')", true); } } dtInfo.Dispose(); } catch (Exception Ex) { objValidateData.SaveSystemErrorLog(Ex, Request.UserHostAddress); var message = new JavaScriptSerializer().Serialize("Some Error has occurred while performing your activity. Please contact the System Administrator for further assistance."); var script = string.Format("alert({0});", message); ScriptManager.RegisterClientScriptBlock(this, GetType(), "", script, true); } }