示例#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;
            }
        }
        protected void btnSaveSPAdReport_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SPAdReportWrapper obj = SPAdReportWrapper.FindById(int.Parse(hidId.Text.Trim()));


                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);


                SPAdReportWrapper.Update(obj);

                winSPAdReportEdit.Hide();
                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
                return;
            }
        }
        protected void storeSPAdReport_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            List <SPAdReportWrapper> spDayReports = SPAdReportWrapper.QueryReport(dfStart.SelectedDate, dfEnd.SelectedDate, this.Client);

            storeSPAdReport.DataSource = spDayReports;
            storeSPAdReport.DataBind();

            this.lblTotalDownSycnSuccess.Text = spDayReports.Sum(p => p.ClientCount).ToString();
        }
示例#4
0
        public void DeleteRecord(int id)
        {
            try
            {
                SPAdReportWrapper.DeleteByID(id);

                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = string.Format(ex.Message);
                return;
            }
        }
        public void Show(int id)
        {
            try
            {
                SPAdReportWrapper obj = SPAdReportWrapper.FindById(id);

                if (obj != null)
                {
                    //                    this.numID.Value = obj.ID.ToString();
                    this.lblAdName.Value            = obj.SPPackID.SPAdID.Name;
                    this.lblAdPackName.Value        = obj.SPPackID.Name;
                    this.lblSPClientName.Value      = obj.SPClientID.Name;
                    this.dateReportDate.Value       = obj.ReportDate.Value.ToShortDateString();
                    this.numClientCount.Value       = obj.ClientCount.ToString();
                    this.numAdCount.Value           = obj.AdCount.ToString();
                    this.numAdClientUseCount.Value  = obj.AdClientUseCount;
                    this.numAdUseCount.Value        = obj.AdUseCount;
                    this.numAdClientDownCount.Value = obj.AdClientDownCount;
                    this.numAdDownCount.Value       = obj.AdDownCount;



                    hidId.Text = id.ToString();


                    winSPAdReportEdit.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;
            }
        }