コード例 #1
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();
 }
コード例 #2
0
        public void Show(int id)
        {
            try
            {
                SPAdvertisementWrapper obj = SPAdvertisementWrapper.FindById(id);

                if (obj != null)
                {
                    this.txtName.Text = ValueConvertUtil.ConvertStringValue(obj.Name);
                    if (obj.UpperID != null)
                    {
                        this.cmbUpper.SetValue(obj.UpperID.Id.ToString());
                    }
                    else
                    {
                        this.cmbUpper.ClearValue();
                    }
                    this.txtCode.Text     = ValueConvertUtil.ConvertStringValue(obj.Code);
                    this.txtImageUrl.Text = ValueConvertUtil.ConvertStringValue(obj.ImageUrl);
                    this.txtAdPrice.Text  = ValueConvertUtil.ConvertStringValue(obj.AdPrice);
                    cmbAccountType.SetValue(obj.AccountType);
                    this.cmbAdType.SetValue(obj.AdType);
                    this.txtAdText.Text      = ValueConvertUtil.ConvertStringValue(obj.AdText);
                    this.txtDescription.Text = ValueConvertUtil.ConvertStringValue(obj.Description);
                    //this.chkIsDisable.Checked = obj.IsDisable.ToString();
                    //this.numAssignedClient.Value = obj.AssignedClient.ToString();
                    //this.numCreateBy.Value = obj.CreateBy.ToString();
                    //this.dateCreateAt.Value = obj.CreateAt.ToString();
                    //this.numLastModifyBy.Value = obj.LastModifyBy.ToString();
                    //this.dateLastModifyAt.Value = obj.LastModifyAt.ToString();



                    hidId.Text = id.ToString();


                    winSPAdvertisementEdit.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;
            }
        }
コード例 #3
0
        public void Show(int id)
        {
            try
            {
                SPAdvertisementWrapper obj = SPAdvertisementWrapper.FindById(id);

                if (obj != null)
                {
                    this.lblName.Text              = ValueConvertUtil.ConvertStringValue(obj.Name);
                    this.lblCode.Text              = ValueConvertUtil.ConvertStringValue(obj.Code);
                    this.lblImageUrl.Text          = ValueConvertUtil.ConvertStringValue(obj.ImageUrl);
                    this.lblAdPrice.Text           = ValueConvertUtil.ConvertStringValue(obj.AdPrice);
                    this.lblAccountType.Text       = ValueConvertUtil.ConvertStringValue(obj.AccountType);
                    this.lblApplyStatus.Text       = ValueConvertUtil.ConvertStringValue(obj.ApplyStatus);
                    this.lblAdType.Text            = ValueConvertUtil.ConvertStringValue(obj.AdType);
                    this.lblAdText.Text            = ValueConvertUtil.ConvertStringValue(obj.AdText);
                    this.lblDescription.Text       = ValueConvertUtil.ConvertStringValue(obj.Description);
                    this.lblIsDisable.Text         = obj.IsDisable.ToString();
                    this.lblAssignedClient.Text    = obj.AssignedClient.ToString();
                    this.lblCreateBy.Text          = obj.CreateBy.ToString();
                    this.lblCreateAt.Text          = obj.CreateAt.ToString();
                    this.lblLastModifyBy.Text      = obj.LastModifyBy.ToString();
                    this.lblLastModifyAt.Text      = obj.LastModifyAt.ToString();
                    this.lblLastModifyComment.Text = ValueConvertUtil.ConvertStringValue(obj.LastModifyComment);



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


                    winSPAdvertisementView.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;
            }
        }
コード例 #4
0
        protected void btnSaveSPAdvertisement_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SPAdvertisementWrapper obj = SPAdvertisementWrapper.FindById(int.Parse(hidId.Text.Trim()));
                if (this.cmbUpper.SelectedItem != null)
                {
                    obj.UpperID = SPUpperWrapper.FindById(Convert.ToInt32(this.cmbUpper.SelectedItem.Value));
                }
                else
                {
                    obj.UpperID = null;
                }
                obj.Name        = this.txtName.Text.Trim();
                obj.Code        = this.txtCode.Text.Trim();
                obj.ImageUrl    = this.txtImageUrl.Text.Trim();
                obj.AdPrice     = this.txtAdPrice.Text.Trim();
                obj.AccountType = cmbAccountType.SelectedItem.Value.Trim();
                //obj.ApplyStatus = this.txtApplyStatus.Text.Trim();
                obj.AdType      = cmbAdType.SelectedItem.Value.Trim();
                obj.AdText      = this.txtAdText.Text.Trim();
                obj.Description = this.txtDescription.Text.Trim();

                //obj.AssignedClient = Convert.ToInt32(this.numAssignedClient.Value.Trim());
                //obj.CreateBy = Convert.ToInt32(this.numCreateBy.Value.Trim());
                //obj.CreateAt = UIHelper.SaftGetDateTime(this.dateCreateAt.Value.Trim());
                //obj.LastModifyBy = Convert.ToInt32(this.numLastModifyBy.Value.Trim());
                //obj.LastModifyAt = UIHelper.SaftGetDateTime(this.dateLastModifyAt.Value.Trim());
                obj.LastModifyBy      = ((BasePage)this.Page).CurrentLoginUser.UserID;
                obj.LastModifyAt      = System.DateTime.Now;
                obj.LastModifyComment = "创建用户。";


                SPAdvertisementWrapper.Update(obj);

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