예제 #1
0
		private void LoadList()
		{	
			Int64 PromoID =  Convert.ToInt64(lblPromoID.Text);
			PromoItems clsPromoItems = new PromoItems();
			lstStuff.DataSource = clsPromoItems.ListAsDataTable(PromoID).DefaultView;
			lstStuff.DataBind();
			clsPromoItems.CommitAndDispose();
		}
예제 #2
0
		private bool Delete()
		{
			bool boRetValue = false;
			string stIDs = "";

			foreach(DataListItem item in lstStuff.Items)
			{
				HtmlInputCheckBox chkList = (HtmlInputCheckBox) item.FindControl("chkList");
				if (chkList!=null)
				{
					if (chkList.Checked == true)
					{
						stIDs += chkList.Value + ",";		
						boRetValue = true;
					}
				}
			}
			if (boRetValue)
			{
				PromoItems clsPromoItems = new PromoItems();
				clsPromoItems.Delete( stIDs.Substring(0,stIDs.Length-1));
				clsPromoItems.CommitAndDispose();
			}

			return boRetValue;
		}
예제 #3
0
		private void SaveRecord()
		{
			PromoItemsDetails clsDetails = new PromoItemsDetails();

			clsDetails.PromoID = Convert.ToInt64(lblPromoID.Text);
			clsDetails.ContactID = Convert.ToInt64(cboContact.SelectedItem.Value);
			clsDetails.ProductGroupID = Convert.ToInt64(cboProductGroup.SelectedItem.Value);
			clsDetails.ProductSubGroupID = Convert.ToInt64(cboSubGroup.SelectedItem.Value);
			clsDetails.ProductID = Convert.ToInt64(cboProducts.SelectedItem.Value);
			clsDetails.VariationMatrixID = Convert.ToInt64(cboProductVariation.SelectedItem.Value);
			clsDetails.Quantity = Convert.ToDecimal(txtQuantity.Text);
			clsDetails.PromoValue = Convert.ToDecimal(txtPromoValue.Text);
			clsDetails.InPercent = chkInPercentage.Checked;

			PromoItems clsPromoItems = new PromoItems();
			clsPromoItems.Insert(clsDetails);
			clsPromoItems.CommitAndDispose();

			LoadList();
		}
예제 #4
0
        protected void lstStuff_ItemCommand(object source, System.Web.UI.WebControls.DataListCommandEventArgs e)
        {
            HtmlInputCheckBox chkList = (HtmlInputCheckBox)e.Item.FindControl("chkList");

            switch (e.CommandName)
            {
                case "imgItemDelete":
                    {
                        PromoItems clsPromoItems = new PromoItems();
                        clsPromoItems.Delete(chkList.Value);
                        clsPromoItems.CommitAndDispose();
                        LoadList();
                    }
                    break;

            }
        }
예제 #5
0
		private void lstItem_ItemDataBound(object sender, DataListItemEventArgs e)
		{
			if(e.Item.ItemType == ListItemType.Header)
			{
				LoadSortFieldOptions(e);
			}
			else if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
			{
				DataRowView dr = (DataRowView) e.Item.DataItem;				

				HtmlInputCheckBox chkList = (HtmlInputCheckBox) e.Item.FindControl("chkList");
				chkList.Value = dr["PromoID"].ToString();

				Label lblPromoCode = (Label) e.Item.FindControl("lblPromoCode");
				lblPromoCode.Text = dr["PromoCode"].ToString();

				Label lblPromoName = (Label) e.Item.FindControl("lblPromoName");
				lblPromoName.Text = dr["PromoName"].ToString();

				Label lblPromoType = (Label) e.Item.FindControl("lblPromoType");
				lblPromoType.Text = dr["PromoTypeCode"].ToString();

				Label lblStartDate = (Label) e.Item.FindControl("lblStartDate");
				lblStartDate.Text = Convert.ToDateTime(dr["StartDate"].ToString()).ToString("MM/dd/yyyy HH:mm:ss");
				
				Label lblEndDate = (Label) e.Item.FindControl("lblEndDate");
				lblEndDate.Text = Convert.ToDateTime(dr["EndDate"].ToString()).ToString("MM/dd/yyyy HH:mm:ss");

				Label lblStatus = (Label) e.Item.FindControl("lblStatus");
				PromoStatus Status = (PromoStatus) Enum.Parse(typeof(PromoStatus), dr["Status"].ToString());
				lblStatus.Text = Status.ToString("G");

				Int64 PromoID = Convert.ToInt64(dr["PromoID"].ToString());
				DataList lstStuff = (DataList) e.Item.FindControl("lstStuff");
				PromoItems clsPromoItems = new PromoItems();
				DataClass clsDataClass = new DataClass();

				lstStuff.ItemDataBound += new System.Web.UI.WebControls.DataListItemEventHandler(this.lstStuff_ItemDataBound);
				lstStuff.DataSource = clsPromoItems.ListAsDataTable(PromoID).DefaultView;
				lstStuff.DataBind();
				clsPromoItems.CommitAndDispose();

				//For anchor
				HtmlGenericControl divExpCollAsst = (HtmlGenericControl) e.Item.FindControl("divExpCollAsst");
				
				HtmlAnchor anchorDown = (HtmlAnchor) e.Item.FindControl("anchorDown");
				anchorDown.HRef = "javascript:ToggleDiv('" +  divExpCollAsst.ClientID + "')";
			}
		}