Example #1
0
        protected void btnSaveSPAdReport_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SPAdReportWrapper obj = new SPAdReportWrapper();
                //obj.ID = Convert.ToInt32(this.numID.Value.Trim());
                obj.SPAdID            = Convert.ToInt32(this.cmbAd.SelectedItem.Value);
                obj.SPPackID          = SPAdPackWrapper.FindById(Convert.ToInt32(this.cmbAdPack.Value));
                obj.SPClientID        = SPSClientWrapper.FindById(Convert.ToInt32(this.cmbClient.Value));
                obj.ReportDate        = this.dateReportDate.SelectedDate;
                obj.ClientCount       = Convert.ToInt32(this.numClientCount.Value);
                obj.AdCount           = Convert.ToInt32(this.numAdCount.Value);
                obj.AdClientUseCount  = Convert.ToInt32(this.numAdClientUseCount.Value);
                obj.AdUseCount        = Convert.ToInt32(this.numAdUseCount.Value);
                obj.AdClientDownCount = Convert.ToInt32(this.numAdClientDownCount.Value);
                obj.AdDownCount       = Convert.ToInt32(this.numAdDownCount.Value);
                obj.AdAmount          = 1;
                obj.CreateAt          = System.DateTime.Now;
                obj.LastModifyAt      = System.DateTime.Now;
                SPAdReportWrapper.SaveNewReport(obj);

                winSPAdReportAdd.Hide();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
            }
        }
        public void Show(int id)
        {
            try
            {
                SPAdPackWrapper obj = SPAdPackWrapper.FindById(id);

                if (obj != null)
                {
                    this.lblID.Text          = obj.Id.ToString();
                    this.lblSPAdID.Text      = obj.SPAdID.ToString();
                    this.lblName.Text        = ValueConvertUtil.ConvertStringValue(obj.Name);
                    this.lblCode.Text        = ValueConvertUtil.ConvertStringValue(obj.Code);
                    this.lblDescription.Text = ValueConvertUtil.ConvertStringValue(obj.Description);



                    //hidLogID.Text = id.ToString();


                    winSPAdPackView.Show();
                }
                else
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "ErrorMessage:Data does not exist";
                    return;
                }
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
                return;
            }
        }
Example #3
0
 protected void storeAdPack_Refresh(object sender, StoreRefreshDataEventArgs e)
 {
     if (cmbAd.SelectedItem != null)
     {
         this.storeAdPack.DataSource = SPAdPackWrapper.FindAllBySPAdID(SPAdvertisementWrapper.FindById(Convert.ToInt32(cmbAd.SelectedItem.Value)));
     }
     else
     {
         this.storeAdPack.DataSource = new List <SPAdPackWrapper>();
     }
     this.storeAdPack.DataBind();
 }
        protected void storeSPAdPack_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1);

            RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e);


            storeSPAdPack.DataSource = SPAdPackWrapper.FindAllByOrderByAndFilterAndSPAdID(recordSortor.OrderByColumnName, recordSortor.IsDesc, AdvertisementID, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;

            storeSPAdPack.DataBind();
        }
        public void DeleteRecord(int id)
        {
            try
            {
                SPAdPackWrapper.DeleteByID(id);

                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = string.Format(ex.Message);
                return;
            }
        }
Example #6
0
        public void DeleteRecord(int id)
        {
            try
            {
                SPAdPackWrapper spAdPack = SPAdPackWrapper.FindById(id);

                SPAdAssignedHistortyWrapper.RemoveAdAssigned(spAdPack, SPSClientID);

                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = string.Format(ex.Message);
                return;
            }
        }
Example #7
0
        protected void btnSaveSPAdPack_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SPAdPackWrapper adPack = SPAdPackWrapper.FindById(Convert.ToInt32(cmbAdPack.SelectedItem.Value.ToString()));

                decimal clientPrice = Convert.ToDecimal(numClientPrice.Value);

                SPAdAssignedHistortyWrapper.ClientAssignedAdPack(SPSClientID, adPack, clientPrice);

                winSPAdPackAdd.Hide();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
            }
        }
Example #8
0
        public void Show(int id)
        {
            try
            {
                SPAdPackWrapper obj = SPAdPackWrapper.FindById(id);

                if (obj != null)
                {
                    //this.numID.Value = obj.ID.ToString();
                    //this.numSPAdID.Value = obj.SPAdID.ToString();
                    this.txtName.Text        = ValueConvertUtil.ConvertStringValue(obj.Name);
                    this.txtCode.Text        = ValueConvertUtil.ConvertStringValue(obj.Code);
                    this.txtDescription.Text = ValueConvertUtil.ConvertStringValue(obj.Description);

                    if (obj.AdPrice.HasValue)
                    {
                        this.numAdPrice.Value = obj.AdPrice;
                    }
                    else
                    {
                        this.numAdPrice.Value = decimal.Zero;
                    }


                    hidId.Text = id.ToString();


                    winSPAdPackEdit.Show();
                }
                else
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "ErrorMessage:Data does not exist";
                    return;
                }
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "ErrorMessage:" + ex.Message;
                return;
            }
        }
        protected void btnSaveSPAdPack_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SPAdPackWrapper obj = new SPAdPackWrapper();
                //obj.Id = Convert.ToInt32(this.numID.Value.Trim());
                obj.SPAdID      = AdvertisementID;
                obj.Name        = this.txtName.Text.Trim();
                obj.Code        = this.txtCode.Text.Trim();
                obj.Description = this.txtDescription.Text.Trim();
                obj.AdPrice     = Convert.ToDecimal(this.numAdPrice.Value);



                SPAdPackWrapper.Save(obj);

                winSPAdPackAdd.Hide();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
            }
        }
Example #10
0
        protected void btnSaveSPAdPack_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SPAdPackWrapper obj = SPAdPackWrapper.FindById(int.Parse(hidId.Text.Trim()));
                //obj.ID = Convert.ToInt32(this.numID.Value.Trim());
                //obj.SPAdID = Convert.ToInt32(this.numSPAdID.Value.Trim());
                obj.Name        = this.txtName.Text.Trim();
                obj.Code        = this.txtCode.Text.Trim();
                obj.Description = this.txtDescription.Text.Trim();
                obj.AdPrice     = Convert.ToDecimal(this.numAdPrice.Value);

                SPAdPackWrapper.Update(obj);

                winSPAdPackEdit.Hide();
                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
                return;
            }
        }