Esempio n. 1
0
		public BECompanies SelectAllInactive()
		{
			BECompanies ds = new BECompanies();
			DACompanyAliases da = new DACompanyAliases();
			da.SelectAllInactive(ds.tbl_CompanyAliases);
			return ds;
		}
Esempio n. 2
0
		public BECompanies SelectAll()
		{
			BECompanies ds = new BECompanies();
			DACompanies da = new DACompanies();
			da.SelectAll(ds.tbl_Companies);
			return ds;
		}
Esempio n. 3
0
		public BECompanies SelectAllActive()
		{
			BECompanies ds = new BECompanies();
			DACompanyEmails da = new DACompanyEmails();
			da.SelectAllActive(ds.tbl_CompanyEmails);
			return ds;
		}
Esempio n. 4
0
		public BECompanies SelectCompanyColumnsByCompanyID(int CompanyID)
		{
			BECompanies ds = new BECompanies();
			DACompanyAliases da = new DACompanyAliases();

			da.SelectCompanyColumnsByCompanyID(CompanyID, ds.tbl_CompanyAliases);
			return ds;
		}
Esempio n. 5
0
		public BECompanies SelectCompanyAliasesByID(int CompanyAliasesID)
		{
			BECompanies ds = new BECompanies();
			DACompanyAliases da = new DACompanyAliases();

			da.SelectByID(CompanyAliasesID.ToString(), ds.tbl_CompanyAliases);
			return ds;
		}
Esempio n. 6
0
		public BECompanies SelectAllCustomerInventoryCompaniesByRentalCompanyID(int RentalCompanyID)
		{
			BECompanies ds = new BECompanies();
			DACompanies da = new DACompanies();

			da.SelectAllCustomerInventoryCompaniesByRentalCompanyID(RentalCompanyID, ds.tbl_Companies);
			return ds;
		}
Esempio n. 7
0
		public BECompanies SelectActiveCompanyEmailsByCompanyID(int CompanyID)
		{
			BECompanies ds = new BECompanies();
			DACompanyEmails da = new DACompanyEmails();

			da.SelectActiveCompanyEmailsByCompanyID(CompanyID, ds.tbl_CompanyEmails);
			return ds;
		}
		private void BindGroupsList()
		{	
			BPCompanies bpClients = new BPCompanies();
			DSCompanies = bpClients.SelectAllActive();
			ddlGroups.DataBind();

			ddlGroups.Items.Insert(0, new ListItem("", "-99"));
		}
Esempio n. 9
0
		private void BindDSCompanies()
		{
			BPCompanies BPCompanies = new BPCompanies();
			DSCompanies = BPCompanies.SelectAll();
			DSCompanies.tbl_Companies.DefaultView.Sort = "CompanyName";
			DSCompanies.tbl_Companies.DefaultView.RowFilter = RowFilter("CompanyName", "CompanyActive");

			letters_Bind();
			dgCompanies.DataBind();

			SetPagerButtons();
			if (DSCompanies.tbl_Companies.DefaultView.Count ==  0)
			{
				lblError.Visible = true;
				lblError.Text = "0 Records found.";
			}

			else
			{
				lblError.Visible = false;
				lblError.Text = "";
			}
		}
Esempio n. 10
0
		protected void BindCompanies()
		{
			BPCompanies bp = new BPCompanies();
			DSCompanies = bp.SelectAllActive();
			ddlCompanies.DataBind();

			if (GlobalCompanyID > 0)
			{
				ddlCompanies.Items.FindByValue(GlobalCompanyID.ToString()).Selected = true;
			}
			else
			{
				ddlCompanies.Items.FindByValue(System.Configuration.ConfigurationSettings.AppSettings.Get("OryxCompanyID")).Selected = true;
				GlobalCompanyID = Convert.ToInt32(ddlCompanies.SelectedValue);
			}
		}
Esempio n. 11
0
		private void ViewCompanyEmails()
		{
			BPCompanyEmails bp = new BPCompanyEmails();
			DSCompanies = bp.SelectCompanyEmailsByCompanyID(CompanyID);
			dgCompanyEmails.DataBind();
			dgCompanyEmails.SelectedIndex = -1;

			tabViewCompanyEmails.Attributes["class"] = "current";
			tabAddCompanyEmails.Attributes["class"] = "";

			pnlAddCompanyEmails.Visible = false;
			pnlViewCompanyEmails.Visible = true;
		}
Esempio n. 12
0
		private void btnDelete_Click(object sender, EventArgs e)
		{
			if (CompanyID != Convert.ToInt32(System.Configuration.ConfigurationSettings.AppSettings.Get("OryxCompanyID")))
			{
				//Delete Company
				BPCompanies bp = new BPCompanies();
				BECompanies.tbl_CompaniesRow Company;
				DSCompanies = bp.SelectCompaniesByID(CompanyID);
				Company = DSCompanies.tbl_Companies.FindByCompanyID(CompanyID);
				Company.Delete();
				bp.Update(DSCompanies);

				//Delete Company Aliases
				BPCompanyAliases bpAliases = new BPCompanyAliases();
				DSCompanies = bpAliases.SelectCompanyAliasesByCompanyID(CompanyID);
				foreach (BECompanies.tbl_CompanyAliasesRow row in DSCompanies.tbl_CompanyAliases.Rows)
				{
					row.Delete();
				}
				bpAliases.Update(DSCompanies);

				//Delete Company Emails
				BPCompanyEmails bpEmails = new BPCompanyEmails();
				DSCompanies = bpEmails.SelectCompanyEmailsByCompanyID(CompanyID);
				foreach (BECompanies.tbl_CompanyEmailsRow row in DSCompanies.tbl_CompanyEmails.Rows)
				{
					row.Delete();
				}
				bpEmails.Update(DSCompanies);

				Response.Redirect("BrowseCompanies.aspx");
			}
			else
			{
				//TODO: Insert Message here stating that Oryx company Cannot be deleted, please see your web master
			}
		}
Esempio n. 13
0
		private void btnSubmit_ServerClick(object sender, EventArgs e)
		{
			if (chkCompanyRentalInventory.Checked)
			{
				pnlColumnAliases.Visible = false;
			}

			BPCompanies bp = new BPCompanies();
			BECompanies.tbl_CompaniesRow Company;
			DSCompanies = new BECompanies();
			if (CompanyID == 0)
			{
				// Add new Company
				Company = DSCompanies.tbl_Companies.Newtbl_CompaniesRow();
			}
			else
			{
				// Edit a Company
				DSCompanies = bp.SelectCompaniesByID(CompanyID);
				Company = DSCompanies.tbl_Companies.FindByCompanyID(CompanyID);				
			}
			//all content to be updated/inserted between here
			Company.CompanyName = txtCompanyName.Text;

			ImageWizard ddlCompanyImage = Page.FindControl("ddlCompanyImage") as ImageWizard;
			if (ddlCompanyImage.SelectedImage > 0)
			{
				Company.CompanyImageID = Convert.ToInt32(ddlCompanyImage.SelectedImage);
			}
			else
			{
				Company.SetCompanyImageIDNull();
			}

			Company.CompanyDescription = txtCompanyDescription.Text + " ";
			Company.CompanyAddress1 = txtCompanyAddress1.Text;
			Company.CompanyAddress2 = txtCompanyAddress2.Text;
			Company.CompanyCity = txtCompanyCity.Text;
			Company.CompanyProvince = txtCompanyProvince.Text;
			Company.CompanyCountry = txtCompanyCountry.Text;
			Company.CompanyPostalCode = txtCompanyPostalCode.Text;
			Company.CompanyPhone = txtCompanyPhone.Text;
			Company.CompanyFax = txtCompanyFax.Text;
			Company.CompanyActive = chkCompanyActive.Checked;
			if (CompanyID != Convert.ToInt32(System.Configuration.ConfigurationSettings.AppSettings.Get("OryxCompanyID")))
			{
				Company.CompanyRentalInventory = chkCompanyRentalInventory.Checked;
			}
			else
			{
				Company.CompanyRentalInventory = true;
			}
			
			Company.DateModified = DateTime.Now;
			Company.ModifiedByAdminID = Convert.ToInt32(OryxUser.OryxIdentity.MemberID);
			//all content to be updated/inserted between here			
			if (CompanyID == 0)
			{
				//Add new Application Category
				Company.DateCreated = DateTime.Now;
				DSCompanies.tbl_Companies.Addtbl_CompaniesRow(Company);
			}
			bp.Update(DSCompanies);

			//CreateResizedImage(BEImages DSImages, int ImageID, string prefix, int width, int height, Page page)
			if (!Company.IsCompanyImageIDNull())
			{
				MWUtility.CreateResizedImage(Company.CompanyImageID, "l", "", imageSize, 0, this);
			}

			if (chkCompanyRentalInventory.Checked && CompanyID != Convert.ToInt32(System.Configuration.ConfigurationSettings.AppSettings["OryxCompanyID"]))
			{
				BPCompanyAliases bpAliases = new BPCompanyAliases();

				//delete all of the company Aliases incase they have more aliases than Oryx, otherwise those extra columns would not get over-ridden.
				DSNewCompanyAliases = bpAliases.SelectCompanyAliasesByCompanyID(CompanyID);
				if (DSNewCompanyAliases.tbl_CompanyAliases.Count > 0)
				{
					BECompanies.tbl_CompanyAliasesRow deletealias = DSNewCompanyAliases.tbl_CompanyAliases[0];
					deletealias.Delete();
					bpAliases.Update(DSNewCompanyAliases);
				}

				//Get Oryx's Aliases first
				DSCompanyAliases = bpAliases.SelectCompanyAliasesByCompanyID(Convert.ToInt32(System.Configuration.ConfigurationSettings.AppSettings.Get("OryxCompanyID")));
				if (DSCompanyAliases.tbl_CompanyAliases.Count > 0)
				{
					BECompanies.tbl_CompanyAliasesRow alias = DSCompanyAliases.tbl_CompanyAliases[0];

					//replace the company Aliases with Oryx's aliases
					BECompanies.tbl_CompanyAliasesRow newalias;
					DSNewCompanyAliases = bpAliases.SelectCompanyAliasesByCompanyID(Company.CompanyID);
					if (DSNewCompanyAliases.tbl_CompanyAliases.Count > 0)
					{
						CompanyHasAliases = true;
						newalias = DSNewCompanyAliases.tbl_CompanyAliases[0];
					}
					else
					{
						CompanyHasAliases = false;
						newalias = DSNewCompanyAliases.tbl_CompanyAliases.Newtbl_CompanyAliasesRow();
					}
					newalias.CompanyID = Company.CompanyID;

					if (! alias.IsDescriptionNull()) newalias.Description = alias.Description;
					if (! alias.IsBoxNull()) newalias.Box = alias.Box;
					if (! alias.IsPinNull()) newalias.Pin = alias.Pin;
					if (! alias.IsItemNumberNull()) newalias.ItemNumber = alias.ItemNumber;
					if (! alias.IsBox2Null()) newalias.Box2 = alias.Box2;
					if (! alias.IsMajorODNull()) newalias.MajorOD = alias.MajorOD;
					if (! alias.IsMinorODNull()) newalias.MinorOD = alias.MinorOD;
					if (! alias.IsInsideDiameterNull()) newalias.InsideDiameter = alias.InsideDiameter;
					if (! alias.IsSealtoSealLengthNull()) newalias.SealtoSealLength = alias.SealtoSealLength;
					if (! alias.IsFloatBoreNull()) newalias.FloatBore = alias.FloatBore;
					if (! alias.IsGeneralCommentsNull()) newalias.GeneralComments = alias.GeneralComments;

					if (! alias.IsExtraColumn1Null()) newalias.ExtraColumn1 = alias.ExtraColumn1;
					if (! alias.IsExtraColumn2Null()) newalias.ExtraColumn2 = alias.ExtraColumn2;
					if (! alias.IsExtraColumn3Null()) newalias.ExtraColumn3 = alias.ExtraColumn3;
					if (! alias.IsExtraColumn4Null()) newalias.ExtraColumn4 = alias.ExtraColumn4;
					if (! alias.IsExtraColumn5Null()) newalias.ExtraColumn5 = alias.ExtraColumn5;
					if (! alias.IsExtraColumn6Null()) newalias.ExtraColumn6 = alias.ExtraColumn6;
					if (! alias.IsExtraColumn7Null()) newalias.ExtraColumn7 = alias.ExtraColumn7;
					if (! alias.IsExtraColumn8Null()) newalias.ExtraColumn8 = alias.ExtraColumn8;
					if (! alias.IsExtraColumn9Null()) newalias.ExtraColumn9 = alias.ExtraColumn9;
					if (! alias.IsExtraColumn10Null()) newalias.ExtraColumn10 = alias.ExtraColumn10;

					if (CompanyHasAliases == false)
					{
						DSNewCompanyAliases.tbl_CompanyAliases.Rows.Add(newalias);
					}
					bpAliases.Update(DSNewCompanyAliases);
				}     
			}

			if (CompanyID == 0)
			{
				Response.Redirect("EditCompanies.aspx?CompanyID=" + Company.CompanyID);
			}
			else
			{
				Response.Redirect("BrowseCompanies.aspx");
			}
		}
Esempio n. 14
0
		public void Update(BECompanies ds)
		{
			DACompanyAliases da = new DACompanyAliases();
			da.Update(ds.tbl_CompanyAliases);
		}
Esempio n. 15
0
		public void Update(BECompanies ds)
		{
			DACompanyEmails da = new DACompanyEmails();
			da.Update(ds.tbl_CompanyEmails);
		}