Beispiel #1
0
        protected override void btnSave_Click(object sender, EventArgs e)
        {
            fb = FeedbackService.GetInstance().GetModel(id);
            if (fb != null)
            {
                fb.Attach();

                fb.IsReplied = chkReply.Checked ? 1 : 0;
                fb.ReplyContent = txtReply.Text;
                fb.ReplyTime = DateTime.Now;
                fb.ReplyUser = LoginUser.Id;

                FeedbackService.GetInstance().UpdateModel(fb);

                ScriptUtil.RefreshFrame("MainFrame");
                ScriptUtil.AlertAndCloseDialog("保存成功!");
            }
            else
            {
                ScriptUtil.Alert("信息无效");
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            id = Request["id"];

            if (!IsPostBack)
            {
                fb = FeedbackService.GetInstance().GetModel(id);
                if (fb != null)
                {
                    ltlTitle.Text = fb.Title;
                    ltlContent.Text = fb.Content;
                    ltlName.Text = fb.Name;
                    ltlEmail.Text = fb.Email;
                    ltlPhone.Text = fb.Phone;
                    ltlFax.Text = fb.Fax;
                    ltlCompany.Text = fb.Company;
                    ltlAddress.Text = fb.Address;
                    chkReply.Checked = fb.IsReplied.HasValue && fb.IsReplied == 1 ? true : false;
                    txtReply.Text = fb.ReplyContent;
                }
            }
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            pid = Request["pid"];
            news = NewsService.GetInstance().GetModel(pid);
            if (news != null)
            {
                NodeCode = news.NodeCode;
            }
            else
            {
                news = new cmsNews();
            }

            if (IsPostBack)
            {
                pid = Request["pid"];
                long productId = 0;
                if (!long.TryParse(pid, out productId)) productId = 0;

                string firstName = Request["FirstName"];
                string lastName = Request["LastName"];
                string name = firstName + " " + lastName;
                string company = Request["Company"];
                string address = Request["Address"];
                string zipcode = Request["Zipcode"];
                string email = Request["Email"];
                string phone = Request["Phone"];
                string fax = Request["Fax"];
                string title = Request["Title"];
                string content = Request["Content"];

                if (string.IsNullOrEmpty(name.Trim()))
                {
                    ScriptUtil.Alert("Please enter name.");
                    return;
                }
                if (string.IsNullOrEmpty(email.Trim()))
                {
                    ScriptUtil.Alert("Please enter email.");
                    return;
                }
                if (string.IsNullOrEmpty(title.Trim()))
                {
                    ScriptUtil.Alert("Please enter subject.");
                    return;
                }
                if (string.IsNullOrEmpty(content.Trim()))
                {
                    ScriptUtil.Alert("Please enter content.");
                    return;
                }
                cmsFeedback fb = new cmsFeedback()
                {
                    LangId = CurrentLanguage.Id,
                    ProductId = productId,
                    Name=name,
                    Company = company,
                    Address = address,
                    Phone = phone,
                    Fax = fax,
                    Email = email,
                    Title = title,
                    Content = content,
                    PostTime = DateTime.Now,
                    IsReplied = 0,
                };
                FeedbackService.GetInstance().AddModel(fb);

                ScriptUtil.AlertAndExecute("submit ok!", "location.href=location.href;");
            }
        }