Ejemplo n.º 1
0
		private void btnSubmit_ServerClick(object sender, System.EventArgs e)
		{
			BEShippingCosts costs = new BEShippingCosts();
			BPShippingCosts bp = new BPShippingCosts();
			BEShippingCosts.tbl_ShippingCostsRow dr;
			costs = bp.SelectAll();
			for(int i=0;i<dlShippingCosts.Items.Count;i++)
			{
				TextBox tmpHolder = dlShippingCosts.Items[i].FindControl("txtShippingCost") as TextBox;
				if (costs.tbl_ShippingCosts.Rows.Count <= i)
				{
					dr = costs.tbl_ShippingCosts.Newtbl_ShippingCostsRow();
					dr.ShippingMethodID = Convert.ToInt32(tmpHolder.Attributes["ShippingMethodID"]);
					dr.ShippingRegionID = Convert.ToInt32(tmpHolder.Attributes["ShippingRegionID"]);
					dr.ShippingCostActive = true;
					if (tmpHolder.Text == "")
					{
						tmpHolder.Text = "0";
					}
					dr.ShippingCost = Convert.ToDecimal(tmpHolder.Text);
					dr.DateCreated = DateTime.Now;
					dr.DateModified = DateTime.Now;
					dr.ModifiedByAdminID = Convert.ToInt32(CarrielUser.CarrielIdentity.MemberID);
					costs.tbl_ShippingCosts.Addtbl_ShippingCostsRow(dr);

				}
				else
				{
					dr = costs.tbl_ShippingCosts.FindByShippingCostID(Convert.ToInt32(tmpHolder.Attributes["ShippingCostID"]));
					if(dr.ShippingCost != Convert.ToDecimal(tmpHolder.Text))
					{
						dr.ShippingCost = Convert.ToDecimal(tmpHolder.Text);
					}
				}
			}
			bp.Update(costs);
			Response.Redirect("index.aspx");
		}
Ejemplo n.º 2
0
		private void FillShippingDataList()
		{
			BPShippingCosts bp = new BPShippingCosts();
			BEShippingCosts costs = new BEShippingCosts();
			costs = bp.SelectAll();
			if (costs.tbl_ShippingCosts.Count == 0)
			{
				CreateEmptyDataSet(costs);
			}
			dlShippingCosts.DataSource = costs;
			dlShippingCosts.DataMember = "tbl_ShippingCosts";
			dlShippingCosts.DataBind();
		}