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; } }
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 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; } }
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; } }
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 = 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; } }