Exemplo n.º 1
0
		private void LoadRecord()
		{
			Int64 iID = Convert.ToInt64(Common.Decrypt(Request.QueryString["id"],Session.SessionID));
			PromoBySupplier clsPromoBySupplier = new PromoBySupplier();
			PromoBySupplierDetails clsDetails = clsPromoBySupplier.Details(iID);
			clsPromoBySupplier.CommitAndDispose();

			lblPromoBySupplierID.Text = clsDetails.PromoBySupplierID.ToString();
			txtPromoBySupplierCode.Text = clsDetails.PromoBySupplierCode;
			txtPromoBySupplierName.Text = clsDetails.PromoBySupplierName;
            txtPromoLevel.Text = clsDetails.PromoLevel.ToString("G");
			txtStartDate.Text = clsDetails.StartDate.ToString("yyyy-MM-dd HH:mm");
			txtEndDate.Text = clsDetails.EndDate.ToString("yyyy-MM-dd HH:mm");

			LoadList();
            
            switch (clsDetails.PromoLevel)
            {
                case PromoLevel.All:
                    cboContact.Enabled = true; txtContactCode.Enabled = true; imgContactCodeSearch.Enabled = true;
                    cboProductGroup.Enabled = true; txtProductGroupCode.Enabled = true; imgProductGroupCodeSearch.Enabled = true;
                    cboSubGroup.Enabled = true; txtSubGroupCode.Enabled = true; imgSubGroupCodeSearch.Enabled = true;
                    cboProducts.Enabled = true; txtProductCode.Enabled = true; cmdProductCode.Enabled = true;
                    cboProductVariation.Enabled = true;
                    break;
                case PromoLevel.Contact:
                    cboContact.Enabled = true; txtContactCode.Enabled = true; imgContactCodeSearch.Enabled = true;
                    break;
                case PromoLevel.ProductGroup:
                    cboContact.Enabled = true; txtContactCode.Enabled = true; imgContactCodeSearch.Enabled = true;
                    cboProductGroup.Enabled = true; txtProductGroupCode.Enabled = true; imgProductGroupCodeSearch.Enabled = true;
                    break;
                case PromoLevel.ProductSubGroup:
                    cboContact.Enabled = true; txtContactCode.Enabled = true; imgContactCodeSearch.Enabled = true;
                    cboProductGroup.Enabled = true; txtProductGroupCode.Enabled = true; imgProductGroupCodeSearch.Enabled = true;
                    cboSubGroup.Enabled = true; txtSubGroupCode.Enabled = true; imgSubGroupCodeSearch.Enabled = true;
                    break;
                case PromoLevel.Product:
                    cboContact.Enabled = true; txtContactCode.Enabled = true; imgContactCodeSearch.Enabled = true;
                    cboProductGroup.Enabled = true; txtProductGroupCode.Enabled = true; imgProductGroupCodeSearch.Enabled = true;
                    cboSubGroup.Enabled = true; txtSubGroupCode.Enabled = true; imgSubGroupCodeSearch.Enabled = true;
                    cboProducts.Enabled = true; txtProductCode.Enabled = true; cmdProductCode.Enabled = true;
                    break;
                case PromoLevel.Variation:
                    cboContact.Enabled = true; txtContactCode.Enabled = true; imgContactCodeSearch.Enabled = true;
                    cboProductGroup.Enabled = true; txtProductGroupCode.Enabled = true; imgProductGroupCodeSearch.Enabled = true;
                    cboSubGroup.Enabled = true; txtSubGroupCode.Enabled = true; imgSubGroupCodeSearch.Enabled = true;
                    cboProducts.Enabled = true; txtProductCode.Enabled = true; cmdProductCode.Enabled = true;
                    cboProductVariation.Enabled = true;
                    break;
                case PromoLevel.NotApplicable:
                    break;
                default:
                    break;
            }
		}
Exemplo n.º 2
0
		private void LoadRecord()
		{
			Int64 iID = Convert.ToInt64(Common.Decrypt(Request.QueryString["id"],Session.SessionID));
			PromoBySupplier clsPromoBySupplier = new PromoBySupplier();
			PromoBySupplierDetails clsDetails = clsPromoBySupplier.Details(iID);
			clsPromoBySupplier.CommitAndDispose();

			lblPromoBySupplierID.Text = clsDetails.PromoBySupplierID.ToString();
			txtPromoBySupplierCode.Text = clsDetails.PromoBySupplierCode;
			txtPromoBySupplierName.Text = clsDetails.PromoBySupplierName;
            cboPromoLevel.SelectedIndex = cboPromoLevel.Items.IndexOf(cboPromoLevel.Items.FindByValue(clsDetails.PromoLevel.ToString("d")));
			txtStartDate.Text = clsDetails.StartDate.ToString("yyyy-MM-dd");
            txtStartTime.Text = clsDetails.StartDate.ToString("HH:mm");
            txtEndDate.Text = clsDetails.EndDate.ToString("yyyy-MM-dd");
            txtEndTime.Text = clsDetails.EndDate.ToString("HH:mm");
		}