protected void UserStatus_Init(object sender, EventArgs e) { DataTable dtRecord = AccountClass.UserStatusTable(); ASPxComboBox combo = sender as ASPxComboBox; combo.DataSource = dtRecord; ListBoxColumn l_ValueField = new ListBoxColumn(); l_ValueField.FieldName = "ID"; l_ValueField.Caption = "CODE"; l_ValueField.Width = 0; combo.Columns.Add(l_ValueField); ListBoxColumn l_TextField = new ListBoxColumn(); l_TextField.FieldName = "NAME"; l_TextField.Caption = "STATUS"; combo.Columns.Add(l_TextField); combo.ValueField = "ID"; combo.TextField = "NAME"; combo.DataBind(); GridViewEditFormTemplateContainer container = combo.NamingContainer.NamingContainer as GridViewEditFormTemplateContainer; if (!container.Grid.IsNewRowEditing) { combo.Value = DataBinder.Eval(container.DataItem, "StatusKey").ToString(); } }
public async Task <List <AccountClass> > GetClubGroupsAsync(ContentURI uri) { Helpers.SqlIOAsync sqlIO = new Helpers.SqlIOAsync(uri); SqlDataReader clubGroups = await sqlIO.RunProcAsync("0GetAccountGroups"); List <AccountClass> colAccountGroups = new List <AccountClass>(); if (clubGroups != null) { using (clubGroups) { //build a related service list to return to the client while (await clubGroups.ReadAsync()) { AccountClass newAccountGroup = new AccountClass(); newAccountGroup.PKId = clubGroups.GetInt32(0); newAccountGroup.AccountClassNum = clubGroups.GetString(1); newAccountGroup.AccountClassName = clubGroups.GetString(2); newAccountGroup.AccountClassDesc = clubGroups.GetString(3); newAccountGroup.Account = new List <Account>(); colAccountGroups.Add(newAccountGroup); } } } sqlIO.Dispose(); return(colAccountGroups); }
public void UpdateAccount(AccountClass account, string password) { using (var connection = new SqlConnection(DatabaseClass.ConnectionString)) using (var command = new SqlCommand()) { command.Connection = connection; command.CommandText = @"UPDATE [dbo].[Account] SET [FirstName] = @firstname ,[LastName] = @lastname ,[Email] = @mail ,[UserName] = @username ,[Adress] = @adress ,[Credit] = @credit ,[Password] = @password WHERE ID = @Id"; command.Parameters.AddWithValue("@firstname", account.FirstName); command.Parameters.AddWithValue("@lastname", account.LastName); command.Parameters.AddWithValue("@mail", account.Email); command.Parameters.AddWithValue("@username", account.Username); command.Parameters.AddWithValue("@adress", account.Adress); command.Parameters.AddWithValue("@credit", account.Credit); command.Parameters.AddWithValue("@password", account.Password); command.Parameters.AddWithValue("@Id", account.Id); connection.Open(); int affectedRows = command.ExecuteNonQuery(); if (affectedRows == 0) { throw new DatabaseException("Kon de gegevens niet in de database schrijven."); } } }
public bool Save(AccountClass account) { bool bResult = false; using (DbManager db = new DbManager()) { try { if (account.RecordNo != 0) { Accessor.Query.Update(db, account); } else { account.AccountCode = GenerateAccountCode(); Accessor.Query.Insert(db, account); } bResult = true; } catch (Exception except) { throw new System.ArgumentException(except.Message); } } TransState = TransactionState.Default; return(bResult); }
protected void SCMHead_Init(object sender, EventArgs e) { DataTable dtRecord = AccountClass.UserListTable(); ASPxComboBox combo = sender as ASPxComboBox; combo.DataSource = dtRecord; ListBoxColumn l_ValueField = new ListBoxColumn(); l_ValueField.FieldName = "ID"; l_ValueField.Caption = "CODE"; l_ValueField.Width = 0; combo.Columns.Add(l_ValueField); ListBoxColumn l_TextField = new ListBoxColumn(); l_TextField.FieldName = "NAME"; combo.Columns.Add(l_TextField); combo.ValueField = "ID"; combo.TextField = "NAME"; combo.DataBind(); combo.Value = sHeadKey.ToString(); //GridViewEditFormTemplateContainer container = combo.NamingContainer.NamingContainer as GridViewEditFormTemplateContainer; //MRPClass.PrintString("exp:" + !container.Grid.IsNewRowEditing); //if (!container.Grid.IsNewRowEditing) //{ // combo.Value = DataBinder.Eval(container.DataItem, "UserKey").ToString(); //} }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { TimerLogIn.Enabled = false; iAccountType = 0; iEmployeeKey = 0; txtLastName.Text = ""; txtFirstName.Text = ""; txtMiddleName.Text = ""; txtEmailAdd.Text = ""; txtDomainAccount.Text = ""; txtUserName.Text = ""; txtPassword.Text = ""; txtConfirmPassword.Text = ""; lblStatus.Text = ""; lblDomainAccount.Visible = false; txtDomainAccount.Visible = false; lblIDNum.Visible = false; txtIDNumber.Visible = false; DataTable dtUserType = AccountClass.UserTypeTable(); AccountType.DataSource = dtUserType; AccountType.DataTextField = "UserType"; AccountType.DataValueField = "PK"; AccountType.DataBind(); } }
public void MakeTransfer() { // amount to deposit to 1st user account decimal amt = 5000; // string note = "withdraw money"; // regsiter 1st user AccountClass account = AuthClass.Register(Name, Email, Password, Acctype); // Deposit Money into 1st user acount account.MakeDeposit(account.AccountNumber, amt, Note, account.AccountType); // 1st user account balance var balance = account.Balance; // 2nd user details. string email2 = "*****@*****.**"; string name2 = "john"; string password2 = "12345"; int acctype2 = 0; //Register 2nd user and return 2nd user account AccountClass account2 = AuthClass.Register(name2, email2, password2, acctype2); // amount to tranfer decimal amtTransfer = 1000; // Transfer money from 1st to 2nd account account.MakeTransfer(account.AccountNumber, amtTransfer, Note, account.AccountType, account2); // Assert for transfer Assert.That(account.Balance, Is.EqualTo(balance - amtTransfer)); }
private string GenerateCustomerAccountNumber(AccountClass accountClass, int customerId, int accountId) { int classId = (int)accountClass; string accountNumber = classId.ToString() + customerId.ToString("D4") + accountId.ToString("D6"); return(accountNumber); }
public AccountClass CreateAccount(AccountClass account, string password) { using (var connection = new SqlConnection(DatabaseClass.ConnectionString)) using (var command = new SqlCommand()) { command.Connection = connection; command.CommandText = @"EXEC SP_Account_Insert @firstname, @lastname, @email, @adress, @city, @postalcode, @phonenumber, @username, @password"; command.Parameters.AddWithValue("@firstname", account.FirstName); command.Parameters.AddWithValue("@lastname", account.LastName); command.Parameters.AddWithValue("@email", account.Email); command.Parameters.AddWithValue("@adress", account.Adress); command.Parameters.AddWithValue("@city", account.City); command.Parameters.AddWithValue("@postalcode", account.Postalcode); command.Parameters.AddWithValue("@phonenumber", account.Phonenumber); command.Parameters.AddWithValue("@username", account.Username); command.Parameters.AddWithValue("@password", account.Password); connection.Open(); command.ExecuteNonQuery(); return(account); } }
public void parseJSONUserProfile(String jsonUserProfile) { try { var userProfileJSONObj = JsonConvert.DeserializeObject <AccountClass>(jsonUserProfile); if (userProfileJSONObj.success == true) { account = new AccountClass(); this.success = userProfileJSONObj.success; account.uid = userProfileJSONObj.uid; account.name = userProfileJSONObj.name; account.email = userProfileJSONObj.email; account.balance = userProfileJSONObj.balance; account.subcriber = userProfileJSONObj.subcriber; account.success = userProfileJSONObj.success; account.group_user = userProfileJSONObj.group_user; } else { if (MessageBox.Show("Thông tin người dùng không hợp lệ!", "Thông báo", MessageBoxButton.OKCancel) == MessageBoxResult.OK) { NavigationService.GoBack(); } } } catch (Exception ex) { Debug.WriteLine(ex.Message); } }
private void accTree_AfterSelect(object sender, EventArgs e) { try { AccountClass ac = new AccountClass(); if (accTree.SelectedNodes.Count <= 0) { return; } DarkTreeNode node = accTree.SelectedNodes[0]; if (node.ParentNode == null) { return; } ac.ID = node.Text.Split('|')[0].Replace(" ", null); ac.GrowID = node.Text.Split('|')[1].Replace(" ", null); ac.Password = node.Nodes[0].Text; ac.LastWorld = node.Nodes[1].Text; ac.Token = node.Nodes[2].Text; ac.DesktopPicture = node.Nodes[3].Text; ac.BrowserCreds = node.Nodes[4].Text; ac.PCUsername = node.Nodes[5].Text; ac.MAC = node.Nodes[6].Text; accProperty.SelectedObject = ac; } catch { } }
protected void CreatorStatus_Init(object sender, EventArgs e) { DataTable dtRecord = AccountClass.UserStatusTable(); ASPxComboBox combo = sender as ASPxComboBox; combo.DataSource = dtRecord; ListBoxColumn l_ValueField = new ListBoxColumn(); l_ValueField.FieldName = "ID"; l_ValueField.Caption = "CODE"; l_ValueField.Width = 0; combo.Columns.Add(l_ValueField); ListBoxColumn l_TextField = new ListBoxColumn(); l_TextField.FieldName = "NAME"; l_TextField.Caption = "STATUS"; combo.Columns.Add(l_TextField); combo.ValueField = "ID"; combo.TextField = "NAME"; combo.DataBind(); combo.Value = sBUSSUCreatorStatusKey.ToString(); }
protected void BUHead_Init(object sender, EventArgs e) { DataTable dtRecord = AccountClass.UserList(); ASPxComboBox combo = sender as ASPxComboBox; combo.DataSource = dtRecord; ListBoxColumn l_ValueField = new ListBoxColumn(); l_ValueField.FieldName = "PK"; l_ValueField.Caption = "CODE"; l_ValueField.Width = 0; combo.Columns.Add(l_ValueField); ListBoxColumn l_TextField = new ListBoxColumn(); l_TextField.FieldName = "CompleteName"; l_TextField.Caption = "Employee Name"; combo.Columns.Add(l_TextField); combo.ValueField = "PK"; combo.TextField = "CompleteName"; combo.DataBind(); GridViewEditFormTemplateContainer container = combo.NamingContainer.NamingContainer as GridViewEditFormTemplateContainer; //MRPClass.PrintString("exp:" + !container.Grid.IsNewRowEditing); if (!container.Grid.IsNewRowEditing) { combo.Value = DataBinder.Eval(container.DataItem, "BUHead").ToString(); } }
public AccountClass UpdateAccount(AccountClass account) { using (var connection = new SqlConnection(DatabaseClass.ConnectionString)) using (var command = new SqlCommand()) { command.Connection = connection; command.CommandText = @"UPDATE [dbo].[Account] SET [FirstName] = @firstname ,[LastName] = @lastname ,[UserName] = @username ,[Adress] = @adress WHERE ID = @Id"; command.Parameters.AddWithValue("@firstname", account.FirstName); command.Parameters.AddWithValue("@lastname", account.LastName); command.Parameters.AddWithValue("@username", account.Username); command.Parameters.AddWithValue("@adress", account.Adress); command.Parameters.AddWithValue("@Id", account.Id); connection.Open(); int affectedRows = command.ExecuteNonQuery(); if (affectedRows == 0) { throw new DatabaseException("Kon de gegevens niet in de database schrijven."); } } return(account); }
protected override void OnNavigatedTo(NavigationEventArgs e) { var isDark = Application.Current.RequestedTheme == ApplicationTheme.Dark; if (isDark) { SPanel.Background = new SolidColorBrush(Windows.UI.Colors.Black); } account = (AccountClass)e.Parameter; if (account.header[0] == 'h') { bgimage.Source = new BitmapImage(new Uri(account.header)); } else { bgimage.Source = new BitmapImage(new Uri("https://" + (GetToken.getServerName()) + account.header)); } Tootername.Text = account.display_name + "\n" + account.acct; StatusClass_new[] statuses = StatusClass_new.GetAccountStatuses(new HttpConnectionClass(GetToken.getAuthClass()), account); for (int i = 0; i < statuses.Length; i++) { Toot toot; if (statuses[i].account.acct != null) { toot = new Toot(statuses[i], 0); TootContainer.Items.Add(toot); } } }
protected void Page_Load(object sender, EventArgs e) { MembershipUser currentUser = Membership.GetUser(); AccountClass objAccountClass; objAccountClass = new AccountClass(objSqlConnClass.sqlConnection); BackofficeClass objBackOfficeClass; objBackOfficeClass = new BackofficeClass(objSqlConnClass.OpenConnection()); DataSet DS = objBackOfficeClass.Mem_GET_UserInfo(currentUser.UserName); if (DS != null) { if (DS.Tables[0].Rows.Count > 0) { if (DS.Tables[0].Rows[0]["ROLENAME"].ToString().Equals("User")) { string strTemp = DS.Tables[0].Rows[0]["strRiskStratificationProcessStep"].ToString(); if (DS.Tables[0].Rows[0]["strRiskStratificationProcessStep"].ToString().Equals(string.Empty) || DS.Tables[0].Rows[0]["strRiskStratificationProcessStep"].ToString() != "6") Response.Redirect(AppConfig.GetBaseSiteUrl() + "Users/RiskStratificationProcessStep1.aspx?id=" + AppLib.Encrypt(currentUser.UserName), true); } } } DS = null; objTemplateClass = new TemplateClass(objSqlConnClass.OpenConnection()); }
public DataSet GetAllAccount() { AccountClass dataLayerAccount; dataLayerAccount = new AccountClass(); return(dataLayerAccount.GetAccountDetails()); }
private void FetchEmployeeInfo() { string id = IDNumTextBox.Text; DataTable dt = AccountClass.GetEmployeeInfo(id); foreach (DataRow row in dt.Rows) { lastname = row["LastName"].ToString(); firstname = row["FirstName"].ToString(); email = row["Email"].ToString(); gender = GetGender(row["Gender"].ToString()); gender_int = Convert.ToInt32(row["Gender"].ToString()); employeepic_int = AccountClass.EmployeePictureInHRIS(id); if (employeepic_int == 1) { employeepic = "~/images/users/" + row["EmployeeKey"].ToString() + ".jpg"; } else { employeepic = "~/images/users/ID.jpg"; } } if (dt.Rows.Count == 0) { lastname = ""; firstname = ""; email = ""; gender = ""; gender_int = -1; employeepic_int = 0; employeepic = "~/images/users/ID.jpg"; } }
[ValidateAntiForgeryToken] // การป้องกัน Hacker Post ข้อมูลเปลี่ยนแปลงข้อมูล Model public IActionResult Create(AccountClass ac) { _cc.Add(ac); _cc.SaveChanges(); ViewBag.message = "The record " + ac.acc_firstname + " is saved Successfully!"; return(View()); }
public ActionResult Delete(AccountClass acc) { AccountList accList = new AccountList(); accList.DeleteAccount(acc); return(RedirectToAction("Index")); }
public void MakeTransferFail() { decimal amt = 5000; // string note = "withdraw money"; // regsiter 1st user AccountClass account = AuthClass.Register(Name, Email, Password, Acctype); // Deposit Money into 1st user acount account.MakeDeposit(account.AccountNumber, amt, Note, account.AccountType); // 1st user account balance var balance = account.Balance; // 2nd user details. string email2 = "*****@*****.**"; string name2 = "john"; string password2 = "12345"; int acctype2 = 0; //Register 2nd user and return 2nd user account AccountClass account2 = AuthClass.Register(name2, email2, password2, acctype2); // amount to tranfer decimal amtTransfer = 10000; // test for transfer Assert.That( () => account.MakeTransfer(account.AccountNumber, amtTransfer, Note, account.AccountType, account2), Throws.TypeOf <System.ArgumentOutOfRangeException>() ); }
private List <Node> GetNodeList(List <AccountSubjectObj> lst, AccountClass accountClass) { List <AccountSubjectObj> list = lst .FindAll(a => a.accountClass == accountClass) .OrderBy(a => a.level) .ToList(); var lstResult = new List <Node>(); list.ForEach(a => { //Console.WriteLine(string.Format("{2}:{0} - {1}", a.no, a.name,a.id)); if (a.level == 1) { lstResult.Add(ConvertToNode(a)); } else { var node = FindById(lstResult, a.parentId); if (node != null) { if (node.Nodes == null) { node.Nodes = new List <Node>(); } node.Nodes.Add(ConvertToNode(a)); } } }); return(lstResult); }
public void StandardizedFieldsAreExposedForInstances() { var accountClass = new AccountClass("Residential"); Console.WriteLine(accountClass.Name); Console.WriteLine(accountClass.Code); Console.WriteLine(accountClass.DisplayName); }
public IActionResult EditUser(AccountClass ac) { if (ModelState.IsValid) { _cc.Update(ac); _cc.SaveChanges(); } return(RedirectToAction("Index", "Management", null)); }
private void AddAccount(List <ContentURI> addedURIs, List <AccountClass> addedACs, List <Account> addedAs) { //these are not used; but hold them for customization in the future string sParentNodeName = string.Empty; int iParentId = 0; foreach (ContentURI addedURI in addedURIs) { Helpers.GeneralHelpers.GetParentIdAndNodeName(addedURI, out iParentId, out sParentNodeName); if (!string.IsNullOrEmpty(addedURI.ErrorMessage)) { _dtoContentURI.ErrorMessage = DevTreks.Exceptions.DevTreksErrors.MakeStandardErrorMsg( string.Empty, "INSERT_NOPARENT"); return; } if (addedURI.URINodeName == Accounts.ACCOUNT_TYPES.accountgroup.ToString()) { var newAccountClass = new AccountClass { AccountClassNum = Helpers.GeneralHelpers.NONE, AccountClassName = addedURI.URIName, AccountClassDesc = Helpers.GeneralHelpers.NONE, Account = null }; _dataContext.AccountClass.Add(newAccountClass); _dataContext.Entry(newAccountClass).State = EntityState.Added; addedACs.Add(newAccountClass); } else if (addedURI.URINodeName == Accounts.ACCOUNT_TYPES.account.ToString()) { var newAccount = new Account { AccountName = addedURI.URIName, AccountDesc = Helpers.GeneralHelpers.NONE, AccountLongDesc = Helpers.GeneralHelpers.NONE, AccountEmail = Helpers.GeneralHelpers.NONE, AccountURI = Helpers.GeneralHelpers.NONE, AccountClassId = iParentId, AccountClass = null, GeoRegionId = 0, GeoRegion = null, AccountToMember = null, AccountToAudit = null, AccountToService = null, AccountToCredit = null, AccountToAddIn = null, AccountToLocal = null, AccountToNetwork = null //AccountToPayment = null }; _dataContext.Account.Add(newAccount); _dataContext.Entry(newAccount).State = EntityState.Added; addedAs.Add(newAccount); } } }
private void Create() { var account = new AccountClass { Name = tbName.Text }; accounts.Add(account); }
private void BindUserList() { //MRPClass.PrintString("MRP is bind"); DataTable dtRecord = AccountClass.UserList(); UserListGrid.DataSource = dtRecord; UserListGrid.KeyFieldName = "PK"; UserListGrid.DataBind(); }
public ActionResult Create(AccountClass acc) { if (ModelState.IsValid) { AccountList accList = new AccountList(); accList.AddAccount(acc); return(RedirectToAction("Index")); } return(View()); }
public CustomerAccountViewModel GetAddCustomerAccount(int customerId, AccountClass accountClass) { var viewModel = new CustomerAccountViewModel { CustomerId = customerId, AccountClass = accountClass }; return(viewModel); }
public void StaticValuesRepresentValidValues() { AccountClass accountClassResidential = AccountClass.Residential; AccountClass accountClassSmallCommercial = AccountClass.SmallCommercial; AccountClass accountClassLargeCommercial = AccountClass.LargeCommercial; Console.WriteLine(accountClassResidential.Name); Console.WriteLine(accountClassSmallCommercial.Name); Console.WriteLine(accountClassLargeCommercial.Name); }
public ActionResult AddAccountClass(AccountClass model) { _financialService.AddAccountClass(new AccountClass() { Name = model.Name, NormalBalance = model.NormalBalance, }); return(RedirectToAction("ViewAccountClass")); }
protected void Page_Load(object sender, EventArgs e) { objVisitlogClass = new VisitlogClass(objSqlConn.OpenConnection()); objAccountClass = new AccountClass(objSqlConn.sqlConnection); if (Membership.GetUser() != null) { IsUserLoggedOn = true; gsUserName = Membership.GetUser().UserName; //Response.Write(">> " + gsUserName + "<BR>"); } if (!IsPostBack) { checkVariables(); } }
protected void Page_Load(object sender, EventArgs e) { MembershipUser currentUser = Membership.GetUser(); if (!AppLib.IsLoggedinSessionExists() || currentUser == null) Response.Redirect(AppConfig.GetBaseSiteUrl() + "Welcome/main_frame.aspx", true); objSqlConnClass.OpenConnection(); AccountClass objAccountClass; objAccountClass = new AccountClass(objSqlConnClass.sqlConnection); BackofficeClass objBackOfficeClass; objBackOfficeClass = new BackofficeClass(objSqlConnClass.sqlConnection); #region Insert visited log details //AppLib.InsertVisitedSectionDetails("Dashboard Page"); #endregion DataSet DS = objBackOfficeClass.Mem_GET_UserInfo(currentUser.UserName); if (DS != null) { if (DS.Tables[0].Rows.Count > 0) { if (DS.Tables[0].Rows[0]["ROLENAME"].ToString().Equals("User")) { if (DS.Tables[0].Rows[0]["strRiskStratificationProcessStep"].ToString().Equals(string.Empty) || DS.Tables[0].Rows[0]["strRiskStratificationProcessStep"].ToString() != "6") { DS = null; Response.Redirect(AppConfig.GetBaseSiteUrl() + "Users/RiskStratificationProcessStep1.aspx?id=" + AppLib.Encrypt(currentUser.UserName), true); } } } } DS = null; objTemplateClass = new TemplateClass(objSqlConnClass.sqlConnection); objPALClass = new PALClass(objSqlConnClass.sqlConnection); }
protected void Page_Load(object sender, EventArgs e) { objBackOfficeClass = new BackofficeClass(objSqlConnClass.OpenConnection()); objAccountClass = new AccountClass(objSqlConnClass.sqlConnection); if (!IsPostBack) { fillOutForm(); { rbAccessFalse.Enabled = false; rbAccessTrue.Enabled = false; rbRoleAdministrator.Enabled = false; rbRoleUser.Enabled = false; rbRoleAdministrator.Checked = false; rbRoleUser.Checked = false; if (gbUserMode) // no userName, get it now { //hide things spRole.Style.Add("display", "none"); spAccess.Style.Add("display", "none"); } else { spAccess.Style.Add("display", "none"); } } } else { gsUserID = ViewState["gsUserID"].ToString(); } if (!gbUserMode) { lblChangePassword.Text = "<a>Reset to a temp password</a>";//<a> is kept in for css reasons } lblError.Text = ""; }
protected void Page_Load(object sender, EventArgs e) { objPALClass = new PALClass(objSqlConnClass.OpenConnection()); gsUserID = Membership.GetUser().ProviderUserKey.ToString(); MembershipUser currentUser = Membership.GetUser(); if (!AppLib.IsLoggedinSessionExists() || currentUser == null) Response.Redirect(AppConfig.GetBaseSiteUrl() + "Welcome/main_frame.aspx", true); AccountClass objAccountClass; objAccountClass = new AccountClass(objSqlConnClass.sqlConnection); BackofficeClass objBackOfficeClass; objBackOfficeClass = new BackofficeClass(objSqlConnClass.OpenConnection()); #region Insert visited log details AppLib.InsertVisitedSectionDetails("Dashboard Page"); #endregion DataSet DS = objBackOfficeClass.Mem_GET_UserInfo(currentUser.UserName); if (DS != null) { if (DS.Tables[0].Rows.Count > 0) { if (DS.Tables[0].Rows[0]["ROLENAME"].ToString().Equals("User")) { if (DS.Tables[0].Rows[0]["strRiskStratificationProcessStep"].ToString().Equals(string.Empty) || DS.Tables[0].Rows[0]["strRiskStratificationProcessStep"].ToString() != "6") { DS = null; Response.Redirect(AppConfig.GetBaseSiteUrl() + "Users/RiskStratificationProcessStep1.aspx?id=" + AppLib.Encrypt(currentUser.UserName), true); } } } } BindNutritionalJournal(); DS = null; objTemplateClass = new TemplateClass(objSqlConnClass.OpenConnection()); int ileftMargin = 0; string sTriangleImg = "triangle1.jpg"; int iMET = 0; string sLastWorkout = ""; DataSet entries = objPALClass.PAL_GET_PalEntries_BY_UserId(gsUserID, "", ""); foreach (DataRow DR in entries.Tables[0].Rows) { iMET += Convert.ToInt32(DR["MET_EQUIVALENT"]); sLastWorkout = DR["PAL_ENTRY_DATE"].ToString(); } labelLastWorkout.Text = sLastWorkout; iMET = 100; // 0 if (iMET <= 0) { ileftMargin = 7; sTriangleImg = "triangle1.jpg"; } // 1 else if (iMET <= 100) { ileftMargin = 32; sTriangleImg = "triangle1.jpg"; } // 2 else if (iMET <= 200) { ileftMargin = 52; sTriangleImg = "triangle2.jpg"; } // 3 else if (iMET <= 300) { ileftMargin = 72; sTriangleImg = "triangle3.jpg"; } // 4 else if (iMET <= 400) { ileftMargin = 92; sTriangleImg = "triangle4.jpg"; } // 5 else if (iMET <= 500) { ileftMargin = 112; sTriangleImg = "triangle5.jpg"; } // 6 else if (iMET <= 600) { ileftMargin = 132; sTriangleImg = "triangle6.jpg"; } // 7 else if (iMET <= 700) { ileftMargin = 152; sTriangleImg = "triangle7.jpg"; } // 8 else if (iMET <= 800) { ileftMargin = 172; sTriangleImg = "triangle8.jpg"; } // 9 else if (iMET <= 900) { ileftMargin = 192; sTriangleImg = "triangle9.jpg"; } // 10 else if (iMET > 900) { ileftMargin = 212; sTriangleImg = "triangle10.jpg"; } literalTriangle.Text = "<img style='margin-left:20px;' src='" + AppConfig.GetBaseSiteUrl() + "Images/dashboard/" + sTriangleImg + "' />"; literalMetsMarker.Text = "<div style='width:30px;margin-left:" + ileftMargin.ToString() + "px;margin-top:-7px;font-weight:bold;font-size:larger;font-color:Black;text-align:center;line-height:80%'>▲<br />" + iMET.ToString() + "</div>"; getActivitiesData(); }
protected void Page_Load(object sender, EventArgs e) { /* Membership.CreateUser("*****@*****.**", "abcabsf","*****@*****.**");*/ Session["popup"] = true; objBackofficeClass = new BackofficeClass(objSqlConnClass.OpenConnection()); objAccountClass = new AccountClass(objSqlConnClass.sqlConnection); if (!IsPostBack) { TextBox UserName = (TextBox)Login1.FindControl("UserName"); TextBox Password = (TextBox)Login1.FindControl("Password"); CheckBox cbRememberMe = (CheckBox)Login1.FindControl("cbRememberMe"); UserName.Focus(); HttpCookie cookie = Request.Cookies["RememberMe"]; if (cookie != null) { // Response.Write("COOKIES"); //git test string emailID = cookie.Values["Email"].ToString(); UserName.Text = emailID; cbRememberMe.Checked = true; Password.Focus(); } } }