protected void Page_Load(object sender, EventArgs e) { mainDSTableAdapters.SetupDetailsTableAdapter setup = new mainDSTableAdapters.SetupDetailsTableAdapter(); mainDS.SetupDetailsDataTable tblSetup = setup.GetSetupDetails(1); if (tblSetup.Rows.Count > 0) { lblCompany.InnerText = tblSetup[0].datCompanyname.ToString(); } try { if (MySessionManager.CurrentUser.BranchID <= 0) { Response.Redirect("~/login.aspx"); } } catch { Response.Redirect("~/login.aspx"); } this.lkbUsername.Text = MySessionManager.CurrentUser.UserFullName + " - " + MySessionManager.CurrentUser.UserRole; if (MySessionManager.CurrentUser.RoleID != 1) { this.settings.Visible = false; } else { settings.Visible = true; } setCountApps(); setMenuList(); }
protected void Page_Load(object sender, EventArgs e) { mainDSTableAdapters.SetupDetailsTableAdapter setup = new mainDSTableAdapters.SetupDetailsTableAdapter(); mainDS.SetupDetailsDataTable tblSetup = setup.GetSetupDetails(1); if (tblSetup.Rows.Count > 0) { lblCompany.InnerText = tblSetup[0].datCompanyname.ToString(); } if (MySessionManager.CurrentUser == null) { Response.Redirect("~/logout.aspx"); } this.lkbUsername.Text = MySessionManager.CurrentUser.UserFullName + " - " + MySessionManager.CurrentUser.UserRole; }
public void loadCompany() { mainDSTableAdapters.SetupDetailsTableAdapter company = new mainDSTableAdapters.SetupDetailsTableAdapter(); mainDS.SetupDetailsDataTable tblCompany = company.GetSetupDetails(1); try { if (tblCompany.Rows.Count > 0) { txtCompany.Value = tblCompany[0].datCompanyname.ToString(); txtEmail.Value = tblCompany[0].datEmail.ToString(); txtlocation.Value = tblCompany[0].datLocation.ToString(); txtpostalAddress.Value = tblCompany[0].datAddresss.ToString(); txtTelNo.Value = tblCompany[0].datTelephoneNumber.ToString(); txtWebsite.Value = tblCompany[0].datWebsite.ToString(); // picLogo.ImageUrl= } } catch (Exception ex) { } }
protected void btnSave_Click(object sender, EventArgs e) { try { string fileName = fuLogo.PostedFile.FileName; int fileLength = fuLogo.PostedFile.ContentLength; byte[] imageBytes = new byte[fileLength]; fuLogo.PostedFile.InputStream.Read(imageBytes, 0, fileLength); mainDSTableAdapters.SetupDetailsTableAdapter company = new mainDSTableAdapters.SetupDetailsTableAdapter(); mainDS.SetupDetailsDataTable tblCompany = company.GetSetupDetails(1); if (tblCompany.Rows.Count > 0) { company.UpdateSetupDetails(txtCompany.Value, txtpostalAddress.Value, txtEmail.Value, txtTelNo.Value, txtlocation.Value, txtWebsite.Value, imageBytes, 1); } else { company.InsertSetupDetails(txtCompany.Value, txtpostalAddress.Value, txtEmail.Value, txtTelNo.Value, txtlocation.Value, txtWebsite.Value, imageBytes); } } catch (Exception ex) { } }