private void LoadShortName() { try { GetSession session = new GetSession(); if (!IsPostBack) { CommonFunction cmDataTable = new CommonFunction(); //SqlConnection sconLoadShortName = DatabaseConnection.GetConnection(); string commandLoadShortName = "select ShortName from CurrentStockLedger where InvestorACRef='" + session.AccountNumber + "' order by ShortName "; //SqlCommand commandLoadShortName = new SqlCommand("select ShortName from CurrentStockLedger where InvestorACRef='" + GetSession.accNo + "' order by ShortName ", sconLoadShortName); //sconLoadShortName.Close(); //SqlDataAdapter sdaLoadShortName = new SqlDataAdapter(commandLoadShortName); DataTable dtLoadShortName = cmDataTable.GetDatatable(commandLoadShortName); //sdaLoadShortName.Fill(dtLoadShortName); ddlInstrument.DataSource = dtLoadShortName; ddlInstrument.DataTextField = "ShortName"; ddlInstrument.DataBind(); } } catch (Exception ex) { Response.Redirect("../../LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace)); } }
private void ShowBrokerInformation() { GetSession session = new GetSession(); try { //string brokerRef = session.BrokerRef; CommonFunction cmDataTable = new CommonFunction(); //string query = "select Prefix,MemberID,ExchangeID,BOID,BrokerName,Web,CDBLID,Address,Telephone,Fax,Email,DSEID,CSEID from Broker where (Reference='" + brokerRef + "')"; string query = "select Prefix,MemberID,ExchangeID,BOID,BrokerName,Web,CDBLID,Address,Telephone,Fax,Email,DSEID,CSEID from Broker where Email='" + session.UserName + "'"; DataTable dtBrokerName = cmDataTable.GetDatatable(query); foreach (DataRow dr in dtBrokerName.Rows) { txtPrefix.Text = dr["Prefix"].ToString(); txtMemberID.Text = dr["MemberID"].ToString(); //txtExchangeID.Text = dr["ExchangeID"].ToString(); txtDSEID.Text = dr["DSEID"].ToString(); txtCSEID.Text = dr["CSEID"].ToString(); txtBOID.Text = dr["BOID"].ToString(); txtBrokerName.Text = dr["BrokerName"].ToString(); txtWeb.Text = dr["Web"].ToString(); txtCDBLID.Text = dr["CDBLID"].ToString(); txtAddress.Text = dr["Address"].ToString(); txtTelephone.Text = dr["Telephone"].ToString(); txtFax.Text = dr["Fax"].ToString(); txtEmail.Text = dr["Email"].ToString(); } } catch (Exception ex) { Response.Redirect("LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace)); } }
public ActionResult Index() { var items = GetSession.QueryOver <Job>() .List(); return(View(items)); }
/// <summary> /// Report generate /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnPrint_Click(object sender, EventArgs e) { try { GetSession session = new GetSession(); string databaseDateFormat = "yyyy/MM/dd"; string status = ViewState["status"].ToString(); string fromDate = DateTime.ParseExact(Request.Form["rangeBa"], "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None).ToString(databaseDateFormat); string toDate = DateTime.ParseExact(Request.Form["rangeBb"], "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None).ToString(databaseDateFormat); ReportDocument oWithdrawalBrokerRequest = new ReportDocument(); //CrystalReportDataSet ds = new CrystalReportDataSet(); oWithdrawalBrokerRequest.Load(Server.MapPath(@"..\..\WithdrawalRequest.rpt")); Session["ReportName"] = "WithdrawalRequest"; WithdrawalBrokerRequestLoader oLoder = new WithdrawalBrokerRequestLoader(status, fromDate, toDate, oWithdrawalBrokerRequest); ReportDocument rd = (ReportDocument)oLoder.GetReportSource(); Session["ReportDocumentObj"] = rd; ResponseHelper.Redirect(Response, "ReportViwer.aspx", "_blank", "menubar=0,width=800,height=600"); } catch (Exception ex) { Response.Redirect("LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace)); } }
public override void Avoid() { int countchara = ReadD(); ReadQ(); int idchara = ReadD(); Equip_inventory equipc = (Equip_inventory)ReadC(); ReadD(); /////////////////////////////////// int countweapon = ReadD(); ReadQ(); int idweapon = ReadD(); Equip_inventory equipw = (Equip_inventory)ReadC(); ReadD(); /////////////////////////////////// int countcupon = ReadD(); ReadQ(); int idcupon = ReadD(); Equip_inventory equipcupon = (Equip_inventory)ReadC(); ReadD(); /////////////////////////////////// ReadD(); if (LOAD.LoggerReceive && GetSession.INST().floodAccounts == false) { Logger.Warnnig($"countchara: {countchara}, id:{idchara}, equip: {equipc.ToString()}"); Logger.Warnnig($"countcupon: {countweapon}, id:{idweapon}, equip: {equipw.ToString()}"); Logger.Warnnig($"countweapon: {countcupon}, id:{idcupon}, equip: {equipcupon.ToString()}"); } }
protected void ExtractXmlMessageFromRequest() { XmlDocument xmlDoc = new XmlDocument(); GetSession session = new GetSession(); String OrderID; String TransactionType; String Currency; String PurchaseAmount; String OrderStatus; String PAN; if (Request["xmlmsg"] != "" && Request["xmlmsg"] != null) { try { xmlDoc.LoadXml(Request["xmlmsg"]); XmlNodeList nodeList = xmlDoc.SelectNodes("/Message"); OrderID = nodeList.Item(0)["OrderID"].InnerText; TransactionType = nodeList.Item(0)["TransactionType"].InnerText; Currency = nodeList.Item(0)["Currency"].InnerText; PurchaseAmount = nodeList.Item(0)["PurchaseAmount"].InnerText; OrderStatus = nodeList.Item(0)["OrderStatus"].InnerText; if (OrderID == session.OrderID.ToString()) { String data = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; data += "<TKKPG>"; data += "<Request>"; data += "<Operation>GetOrderInformation</Operation>"; data += "<Language>EN</Language>"; data += "<Order>"; data += "<Merchant>" + session.Merchant.ToString() + "</Merchant>"; data += "<OrderID>" + session.OrderID.ToString() + "</OrderID>"; data += "</Order>"; data += "<SessionID>" + session.SessionID.ToString() + "</SessionID>"; data += "<ShowParams>true</ShowParams>"; data += "<ShowOperations>false</ShowOperations>"; data += "<ClassicView>true</ClassicView>"; data += "</Request></TKKPG> "; String response = Functions.PostQW(data); XmlDocument xml = new XmlDocument(); xml.LoadXml(response.Substring(response.IndexOf("<TKKPG>"))); //Extract additional parameters for verification XmlNodeList xmlNodes = xml.SelectNodes("/TKKPG/Response/Order/row/OrderParams/row"); foreach (XmlNode node in xmlNodes) { if (node.ChildNodes.Item(0).InnerText == "PAN") { PAN = node.ChildNodes.Item(1).InnerText; } } } } catch (Exception) { } } }
protected void btnSave_Click(object sender, EventArgs e) { try { GetSession session = new GetSession(); if (txtExpirationDate.Text != string.Empty && txtDeclarationDate.Text != string.Empty) { string dateExpire = DateTime.ParseExact(txtExpirationDate.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None).ToString("yyyy/MM/dd"); string dateDeclaration = DateTime.ParseExact(txtDeclarationDate.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None).ToString("yyyy/MM/dd"); CommonFunction cmSaveData = new CommonFunction(); string insertQuery = "insert into IPODeclaration(CompanyName,AddressLine1,AddressLine2,City,Country,PostCode,Telephone,Fax,NumberOfShare,BuyRate,Reference,ExpireDate,DeclarationDate) Values('" + txtCompanyName.Text + "','" + txtAddressLine1.Text + "','" + txtAddressLine2.Text + "','" + txtCity.Text + "','" + txtCountry.Text + "','" + txtPostCode.Text + "','" + txtTelephone.Text + "','" + txtfax.Text + "','" + txtNumberOfShare.Text + "','" + txtBuyRate.Text + "',NEWID(),'" + dateExpire + "','" + dateDeclaration + "')"; cmSaveData.InsertQuery(insertQuery); ClientScript.RegisterStartupScript(this.GetType(), "Alert", "<script type='text/javascript'>alert('successfully Saved');window.location='IpoInformation.aspx';</script>'"); ShowData(); } else { return; } } catch (Exception ex) { Response.Redirect("LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace)); } }
protected void btnPrint_Click(object sender, EventArgs e) { try { GetSession session = new GetSession(); string status = ViewState["status"].ToString(); if (status == "Accepted") { status = "Submitted"; } string fromDate = Request.Form["rangeBa"]; string toDate = Request.Form["rangeBb"]; ReportDocument oOrderReportDocument = new ReportDocument(); //CrystalReportDataSet ds = new CrystalReportDataSet(); oOrderReportDocument.Load(Server.MapPath(@"..\..\OrderReport.rpt")); Session["ReportName"] = "List Of Oredrs"; OrderLoader oLoder = new OrderLoader(status, fromDate, toDate, oOrderReportDocument); ReportDocument rd = (ReportDocument)oLoder.GetReportSource(); Session["ReportDocumentObj"] = rd; ResponseHelper.Redirect(Response, "ReportViwer.aspx", "_blank", "menubar=0,width=800,height=600"); } catch (Exception ex) { Response.Redirect("../../LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace)); } }
//string accountReference = session.AccountNumber; private void PurchaseOrders() { try { GetSession session = new GetSession(); CommonFunction cmDataTable = new CommonFunction(); string showAddData = "select Instrument,TransactionType,ShareQuantity,Rate,Status,TransactionTime,TransactionDate from TradeOrderFromWeb where(InvestorACRef='" + session.AccountNumber + "' and TransactionType='B' and TransactionDate='" + DateTime.Today + "') order by TransactionTime, Instrument "; DataTable dtPurchaseOrder = cmDataTable.GetDatatable(showAddData); dtPurchaseOrder.Columns.Add("TotalAmount", typeof(decimal)); //dt.Columns.Add(new DataColumn(columnName = "Balance", dataType = typeof (decimal))); foreach (DataRow dr in dtPurchaseOrder.Rows) { double total = 0; total = total + (Double.Parse(dr["ShareQuantity"].ToString()) * Double.Parse(dr["Rate"].ToString())); dr["TotalAmount"] = total.ToString(); } rptPurchaseOrder.DataSource = dtPurchaseOrder; rptPurchaseOrder.DataBind(); } catch (Exception ex) { Response.Redirect("../../LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace)); } }
protected void btnSave_Click(object sender, EventArgs e) { try { GetSession session = new GetSession(); if (ddlInstrument.SelectedIndex > 0) { if (txtShareQuantity.Text == string.Empty || txtRate.Text == string.Empty) { return; } else { CommonFunction cmSaveData = new CommonFunction(); string insertQuery = "insert into TradeOrderFromWeb(InvestorACRef,ShareQuantity,Rate,TransactionDate,TransactionTime,Memo,Status,TransactionType,Reference,Instrument) Values('" + session.AccountNumber + "','" + txtShareQuantity.Text + "','" + txtRate.Text + "','" + DateTime.Today.ToString("yyyy/MM/dd") + "','" + DateTime.Now + "','Online','Pending','B',NEWID(),'" + ddlInstrument.SelectedItem.Text + "')"; cmSaveData.InsertQuery(insertQuery); ClientScript.RegisterStartupScript(this.GetType(), "Alert", "<script type='text/javascript'>alert('successfully Saved');window.location='PurchaseOrder.aspx';</script>'"); PurchaseOrders(); } } else { ClientScript.RegisterStartupScript(this.GetType(), "Alert", "<script type='text/javascript'>alert('Please Select Instrument');</script>'"); } } catch (Exception ex) { Response.Redirect("../../LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace)); } }
protected void ddlInstrument_TextChanged(object sender, EventArgs e) { try { GetSession session = new GetSession(); CommonFunction cmDataTable = new CommonFunction(); string selectQuery = "select MarketPrice from Instrument where (ShortName='" + ddlInstrument.SelectedItem.Text + "') "; DataTable dtShowData = cmDataTable.GetDatatable(selectQuery); if (dtShowData.Rows.Count > 0) { txtRate.Text = dtShowData.Rows[0]["MarketPrice"].ToString(); //Where ColumnName is the Field from the DB that you want to display } else { txtRate.Text = string.Empty; //ClientScript.RegisterStartupScript(this.GetType(), "Alert", "<script type='text/javascript'>alert('Please Select Instrument');window.location='PurchaseOrder.aspx';</script>'"); } } catch (Exception ex) { Response.Redirect("../../LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace)); } }
public ActionResult UploadPhotos(IList <HttpPostedFileBase> photos) { var employee = new Employee { Id = GetEmployeeId }; foreach (var item in photos) { if (item != null && item.ContentLength > 0) { var picture = Guid.NewGuid() + ".jpg"; var image = new WebImage(item.InputStream); image.Resize(601, 601) .Crop(1, 1) .Save("~/public/UserFiles/employeephotos/big/" + picture, "image/jpeg") .Resize(101, 101) .Crop(1, 1) .Save("~/public/UserFiles/employeephotos/small/" + picture, "image/jpeg"); GetSession.Save(new EmployeePhoto { Employee = employee, FileName = picture }); } } return(RedirectToAction("Card", new { employee.Id })); }
public ActionResult ErrorForum(long id) { var item = GetSession.Get <Employee>(id); return(View(item)); }
public ActionResult TakeOptions(long Id, PollTakeOptionsFormModel model) { Poll item = GetSession.Get <Poll>(Id); if (item != null) { if (ModelState.IsValid) { CurrentPollId = Id; if (model.LCID > 0) { Poll poll = GetSession.QueryOver <Poll>() .Where(x => x.Object != null && x.Object.Id == Id && x.LCID == model.LCID) .SingleOrDefault(); if (poll != null) { CurrentPollId = poll.Id; } } CurrentPollDepartmentId = model.Department_id; CurrentPollManagerId = model.Manager_id; CurrentPollLCID = model.LCID; } return(RedirectToAction("TakeIntro", new { Id = CurrentPollId })); } else { return(RedirectToAction("Take", new { Id = Id })); } }
private void ShowData() { try { GetSession session = new GetSession(); CommonFunction cmDataTable = new CommonFunction(); string showAddData = "select CompanyName,NumberOfShare,BuyRate,ExpireDate,Reference from IPODeclaration where(ExpireDate >='" + DateTime.Today + "') order by CompanyName "; DataTable dtIpoInformation = cmDataTable.GetDatatable(showAddData); dtIpoInformation.Columns.Add("TotalAmount", typeof(decimal)); foreach (DataRow dr in dtIpoInformation.Rows) { double total = 0; total = total + (Double.Parse(dr["NumberOfShare"].ToString()) * Double.Parse(dr["BuyRate"].ToString())); dr["TotalAmount"] = total.ToString(); } rptIpoInformation.DataSource = dtIpoInformation; rptIpoInformation.DataBind(); } catch (Exception ex) { Response.Redirect("LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace)); } }
private void ShowData() { try { GetSession session = new GetSession(); CommonFunction cmDataTable = new CommonFunction(); string showAddData = "select InvestorACRef, Reference,Instrument,TransactionType,ShareQuantity,Rate,Status,TransactionTime,TransactionDate from TradeOrderFromWeb WHERE TransactionDate = '" + DateTime.Today.ToString("yyyy-MM-dd") + "' and status='Pending' order by TransactionTime,InvestorACRef,Instrument "; DataTable dtAllOrders = cmDataTable.GetDatatable(showAddData); dtAllOrders.Columns.Add("TotalAmount", typeof(decimal)); foreach (DataRow dr in dtAllOrders.Rows) { double total = 0; total = total + (Double.Parse(dr["ShareQuantity"].ToString()) * Double.Parse(dr["Rate"].ToString())); dr["TotalAmount"] = total.ToString(); } rptAllOrder.DataSource = dtAllOrders; rptAllOrder.DataBind(); foreach (RepeaterItem rpt in rptAllOrder.Items) { HiddenField hf = (HiddenField)rpt.FindControl("HiddenField1"); } } catch (Exception ex) { Response.Redirect("LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace)); } }
public ActionResult DepartmentResult() { var items = GetSession.QueryOver <Department>() .List(); return(View(items)); }
//private void ShowBrokerNameOnSuccessModal() //{ // try // { // string brokerRef = Session["BrokerRef"].ToString(); // //SqlConnection sconShowBrokerName = DatabaseConnection.GetConnection(); // CommonFunction cmDataTable = new CommonFunction(); // string query = "select BrokerName from Broker where (Reference='" + brokerRef + "')"; // //SqlCommand cmdBrokerName = new SqlCommand(query,sconShowBrokerName); // //SqlDataAdapter sdaShowBrokerName = new SqlDataAdapter(cmdBrokerName); // //sconShowBrokerName.Close(); // DataTable dtBrokerName = cmDataTable.GetDatatable(query); // //sdaShowBrokerName.Fill(dtBrokerName); // if (dtBrokerName.Rows.Count > 0) // { // lblInvestorname.Text = dtBrokerName.Rows[0]["BrokerName"].ToString(); // } // } // catch (Exception ex) // { // throw ex; // } //} protected void textBox_TextChanged(object sender, EventArgs e) { GetSession session = new GetSession(); RijndaelEncryption encryption = new RijndaelEncryption(); string encryptionKey = ConfigurationManager.AppSettings["EncryptionKey"]; string oldPassword = encryption.EncryptText(txtOldPassword.Text, encryptionKey); try { CommonFunction cm = new CommonFunction(); string password = "******" + session.UserName + "' and BONumber='" + session.BoNumber + "'"; DataTable dtpassword = cm.GetDatatable(password); if (dtpassword.Rows.Count > 0) { txtNewPassord.ReadOnly = false; txtConfirmPassword.ReadOnly = false; lblMessage.Text = ""; } else { txtNewPassord.ReadOnly = true; txtConfirmPassword.ReadOnly = true; lblMessage.ForeColor = System.Drawing.Color.Red; lblMessage.Text = "Password does not match"; } } catch (Exception ex) { throw ex; } }
public ActionResult Edit(long id) { var item = GetSession.Get <Department>(id); var model = Mapper.Map <Department, DepartmentFormModel>(item); return(View(model)); }
public override void Avoid() { LoginAcess result = (LoginAcess)ReadD(); ReadC(); player.ID = ReadQ(); string login = ReadS(ReadC()); ReadC(); ReadC(); if (LOAD.LoggerReceive && GetSession.INST().floodAccounts == false) { Logger.Receive($"{GetType().Name} [{result}; SEU ID: {player.ID}]"); } if (result != LoginAcess.LOGIN_SUCESSO && result != LoginAcess.LOGIN_SUCESSO_ACEITO && AuthClient != null) { Logger.Error("Erro ao logar: " + result + ";"); } if (result == LoginAcess.LOGIN_SUCESSO || result == LoginAcess.LOGIN_SUCESSO_ACEITO) { AuthClient.SendPacket(new BASE_GET_MYINFO_ACK().Write()); GetSession.INST().byPass = true; } }
public void IPOApplicationSave() { try { GetSession session = new GetSession(); CommonFunction cmSaveData = new CommonFunction(); try { float buyRate = float.Parse(Session["BuyRate"].ToString()); int marketLot = Int16.Parse(Session["NoOfShares"].ToString()); } catch (Exception) { } string insertQuery = "insert into IPOApplication (Reference, AccountNumber,BONumber,AccountName,Status,IPOReference,AccountBalance,CompanyName,Category) Values(NewID(), '" + session.AccountNumber + "','" + session.BoNumber + "','" + Session["AccountName"].ToString() + "', 'Pending','" + ipoRefference + "','" + availableBalance + "','" + companyName + "','" + category + "')"; cmSaveData.InsertQuery(insertQuery); btnIPOApplication.Disabled = true; // ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "ValidateDate();", true); //Response.Redirect("../../Default.aspx"); } catch (Exception ex) { Response.Redirect("../../LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace)); } }
public ActionResult Update(ForumItemModel model) { ForumItem forumTarget = GetSession.Get <ForumItem>(Convert.ToInt64(Request.Form["Id"])); forumTarget.Admin = GetSession.Get <Employee>(Convert.ToInt64(Request.Form["Admin"])); forumTarget.Title = Request.Form["Title"]; forumTarget.Active = (Request.Form["Active"] == "on") ? true : false; GetSession.Update(forumTarget); #region ADO.NET //string theTitle = Request.Form["Title"]; //long theAdmin = Convert.ToInt32(Request.Form["Admin"]); //long theId = Convert.ToInt32(Request.Form["Id"]); //bool theActive = (Request.Form["Active"] == "on") ? true : false; //SqlConnection sqlConnection1 = new SqlConnection(cs); //SqlCommand cmd = new SqlCommand(); //Int32 rowsAffected; //cmd.CommandText = "UPDATE portal_ForumItem SET Title = '" + theTitle + "', Admin_id = " + theAdmin + ", Active = '" + theActive + "' WHERE Id = " + theId + ""; ////cmd.CommandText = "UPDATE portal_ForumItem SET Title = '" + theTitle + "', Admin_id = " + theAdmin + ", Active = '" + theActive + "' WHERE Id = "+theId+""; //cmd.CommandType = CommandType.Text; //cmd.Connection = sqlConnection1; //sqlConnection1.Open(); //rowsAffected = cmd.ExecuteNonQuery(); //sqlConnection1.Close(); #endregion return(Redirect("/ForumItems/")); }
private void GetAccountBalance() { try { GetSession session = new GetSession(); SqlConnection sqlConnect = DatabaseConnection.GetConnection(); SqlCommand sqlCmd = new SqlCommand("GetClientAccountStatusDetailsAsOn", sqlConnect); sqlCmd.CommandTimeout = 360; sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.Parameters.Add("@AccountRef", SqlDbType.VarChar).Value = session.AccountNumber; sqlCmd.Parameters.Add("@LedgerDate", SqlDbType.DateTime).Value = DateTime.Now.ToString("yyyy/MM/dd"); SqlDataAdapter sdaClientAccountStatusDetailsAsOn = new SqlDataAdapter(sqlCmd); DataTable dtClientAccountStatusDetailsAsOn = new DataTable(); sdaClientAccountStatusDetailsAsOn.Fill(dtClientAccountStatusDetailsAsOn); if (dtClientAccountStatusDetailsAsOn.Rows.Count > 0) { availableBalance = Convert.ToDouble(dtClientAccountStatusDetailsAsOn.Rows[0]["LedgerBalance"].ToString()); } } catch (Exception ex) { Response.Redirect("../../LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace)); } }
public ActionResult Destroy(long id) { var item = GetSession.Get <Job>(id); GetSession.Delete(item); return(RedirectToAction("Index")); }
private void ShowData() { try { GetSession session = new GetSession(); lblInvestorname.Text = session.AccountNumber; CommonFunction cmDataTable = new CommonFunction(); string showAddData = "select CompanyName, NumberOfShare,BuyRate,ExpireDate,Reference from IPODeclaration where(ExpireDate >='" + DateTime.Today + "') and Reference NOT IN (SELECT IPOReference FROM IPOApplication WHERE AccountNumber = '" + Session["AccountNumber"].ToString() + "') order by CompanyName "; DataTable dtIpoInformation = cmDataTable.GetDatatable(showAddData); dtIpoInformation.Columns.Add("TotalAmount", typeof(decimal)); //dt.Columns.Add(new DataColumn(columnName = "Balance", dataType = typeof (decimal))); foreach (DataRow dr in dtIpoInformation.Rows) { double total = 0; total = total + (Double.Parse(dr["NumberOfShare"].ToString()) * Double.Parse(dr["BuyRate"].ToString())); dr["TotalAmount"] = total.ToString(); } rptIpo.DataSource = dtIpoInformation; rptIpo.DataBind(); } catch (Exception ex) { Response.Redirect("../../LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace)); } }
protected void btnResendEmail_Click(object sender, EventArgs e) { try { GetSession session = new GetSession(); foreach (RepeaterItem rpt in rptFundWithdrawRequest.Items) { CheckBox chkAcctive = (CheckBox)rpt.FindControl("chkAcctive"); if (chkAcctive.Checked == true) { Label accountRef = (Label)rpt.FindControl("lblAccountRef"); Label Amount = (Label)rpt.FindControl("lblNetAmount"); Label TrnDate = (Label)rpt.FindControl("lblTrnDate"); HiddenField hf = (HiddenField)rpt.FindControl("HiddenField1"); string userRef = hf.Value; string accountReference = accountRef.Text; SendMail(accountReference, ViewState["status"].ToString(), Amount.Text, TrnDate.Text); } else { continue; } } ShowData(ViewState["status"].ToString(), ViewState["fromDate"].ToString(), ViewState["toDate"].ToString()); ClientScript.RegisterStartupScript(this.GetType(), "Alert", "<script type='text/javascript'>alert('An email has sent to the user');</script>'"); } catch (Exception ex) { Response.Redirect("LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace)); } }
/// <summary> /// Generate Report Investor Portfolio Statement /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void btPrint_Click(object sender, EventArgs e) { #region Investor Portfolio Statement try { GetSession session = new GetSession(); string Investor = session.AccountNumber; DateTime fromDate = DateTime.Today; DateTime dateFrom = DateTime.Today; Session["ReportName"] = "InvestorPortfolioStatementWeb"; ReportDocument oInvestorProtfilioStatement = new ReportDocument(); //JScript.Alert(Server.MapPath(@"Reports\InvestorPortfolioStatement.rpt"), Page); oInvestorProtfilioStatement.Load(Server.MapPath(@"..\..\InvestorPortfolioStatement.rpt")); //JScript.Alert("Load Report pass", Page); InvestorPortfolioStatementLoader oLoder = new InvestorPortfolioStatementLoader(Investor, dateFrom, oInvestorProtfilioStatement); //JScript.Alert("after Report pass", Page); ReportDocument rd = (ReportDocument)oLoder.GetReportSource(); Session["ReportDocumentObj"] = rd; // const string url = ""; ResponseHelper.Redirect(Response, "ReportViwer.aspx", "_blank", "menubar=0,width=800,height=600"); } catch (Exception ex) { Response.Redirect("../../LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace)); return; } #endregion }
protected void textBox_TextChanged(object sender, EventArgs e) { GetSession session = new GetSession(); RijndaelEncryption encryption = new RijndaelEncryption(); string encryptionKey = ConfigurationManager.AppSettings["EncryptionKey"]; string oldPassword = encryption.EncryptText(txtOldPassword.Text, encryptionKey); try { CommonFunction cm = new CommonFunction(); string password = "******" + session.UserName + "' and AccountNumber='" + session.AccountNumber + "' and password='******'"; DataTable dtpassword = cm.GetDatatable(password); if (dtpassword.Rows.Count > 0) { txtNewPassord.ReadOnly = false; txtConfirmPassword.ReadOnly = false; } else { txtNewPassord.ReadOnly = true; txtConfirmPassword.ReadOnly = true; lblMessage.ForeColor = System.Drawing.Color.Red; lblMessage.Text = "Password does not match"; } } catch (Exception ex) { Response.Redirect("../../LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace)); } }
/// <summary> /// Get Account Name /// </summary> private void GetAccountName() { GetSession session = new GetSession(); SqlConnection sqlConnect = DatabaseConnection.GetConnection(); string queryDepositeWithdraw = "SELECT Name FROM InvestorProfile WHERE AccountNumber='" + session.AccountNumber + "'"; try { CommonFunction dt = new CommonFunction(); DataTable dtDepositeWithdraw = dt.GetDatatable(queryDepositeWithdraw); if (dtDepositeWithdraw.Rows.Count > 0) { foreach (DataRow dr in dtDepositeWithdraw.Rows) { lblUserName.Text = dr["Name"].ToString(); } } } catch (SqlException ex) { Response.Redirect("../../LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace)); } finally { sqlConnect.Close(); sqlConnect.Dispose(); } }
protected void btnSave_Click(object sender, EventArgs e) { GetSession session = new GetSession(); string prefix = txtPrefix.Text; string memberID = txtMemberID.Text; string boID = txtBOID.Text; string brokerName = txtBrokerName.Text; string cdblID = txtCDBLID.Text; string address = txtAddress.Text; string telephone = txtTelephone.Text; string fax = txtFax.Text; string email = txtEmail.Text; string web = txtWeb.Text; string dseID = txtDSEID.Text; string cseID = txtCSEID.Text; try { string brokerRef = Session["BrokerRef"].ToString(); SqlConnection sconUpdate = DatabaseConnection.GetConnection(); //string updateQuery = "update Broker set Prefix='" + prefix + "',MemberID='" + memberID + "',DSEID='" + dseID + "', CSEID='"+cseID+"',BOID='" + boID + "',BrokerName='" + brokerName + "',CDBLID='" + cdblID + "',Address='" + address + "',Telephone='" + telephone + "',Fax='" + fax + "',Email='" + email + "',Web='" + web + "' where Reference='" + brokerRef + "'"; string updateQuery = "update Broker set Prefix='" + prefix + "',MemberID='" + memberID + "',DSEID='" + dseID + "', CSEID='" + cseID + "',BOID='" + boID + "',BrokerName='" + brokerName + "',CDBLID='" + cdblID + "',Address='" + address + "',Telephone='" + telephone + "',Fax='" + fax + "',Email='" + email + "',Web='" + web + "' where Email='" + session.UserName + "'"; SqlCommand cmdUpdate = new SqlCommand(updateQuery, sconUpdate); cmdUpdate.ExecuteNonQuery(); sconUpdate.Close(); ClientScript.RegisterStartupScript(this.GetType(), "Alert", "<script type='text/javascript'>alert('Update Successfully');window.location='BrokerInformation.aspx';</script>'"); } catch (Exception ex) { Response.Redirect("LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace)); } }
public object Get(GetSession request) { using (var db = _connectionFactory.Open()) { var session = db.Select<Session>(x => x.JournalId == request.JournalId && x.Id == request.Id).SingleOrDefault(); if (session == null) return new HttpResult() {StatusCode = HttpStatusCode.NotFound}; return session; } }