Beispiel #1
0
    private bool DoAdd()
    {
        ax_ticket model = new ax_ticket();

        if (model.Exists(txtticket_no.Text.Trim()))
        {
            JscriptMsg(this.Page, "您输入的礼券名称已经存在,请检查!", "", "Error");
            return(false);
        }
        model.ticket_no = txtticket_no.Text.Trim();

        model.ticket_pw = txtticket_pw.Text.Trim();

        model.pid      = int.Parse(ddlCategoryId.SelectedValue.Trim());
        model.add_time = Utils.StrToDateTime(txtAddTime.Text.Trim() + " 23:59:59");
        if (cbIsLock.Checked == true)
        {
            model.status = 2;
        }
        else
        {
            model.status = 1;
        }
        if (model.Add() > 0)
        {
            AddAdminLog("添加", "添加礼券:" + txtticket_no.Text); //记录日志
            return(true);
        }

        return(false);
    }
Beispiel #2
0
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        ax_ticket model = new ax_ticket();

        if (model.Existsfb(ticketno.Value.Trim(), 3))
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "1", "<script> $.alert(\"<div class='message'>亲!您输入的提货编码提过货了!可以去查询订单查询订单信息了!</div>\").time(5000);</script>");

            return;
        }
        if (!model.Exists(ticketno.Value.Trim(), ticketpw.Value.Trim()))
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "1", "<script> $.alert(\"<div class='message'>对不起!没有找到您输入信息的相关记录,请检查是否输入有误!</div>\").time(5000);</script>");
        }
        else
        {
            model.GetModel(ticketno.Value.Trim());
            if (model.add_time < DateTime.Now)
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "1", "<script> $.alert(\"<div class='message'>对不起!您查询的券已经过期了,不能在提货了,如有问题请联系客服!</div>\").time(5000);</script>");
            }
            else
            {
                ShopCart.Add(model.GetID(ticketno.Value.Trim(), ticketpw.Value.Trim()), 1);
                PanelOrder.Visible = true;
            }
        }
    }
Beispiel #3
0
    private bool DoEdit(int _id)
    {
        bool result = false;

        ax_ticket model = new ax_ticket();

        if (model.Exists(txtticket_no.Text.Trim(), _id))
        {
            JscriptMsg(this.Page, "您输入的礼券名称已经存在,请检查!", "", "Error");
            return(false);
        }
        model.GetModel(_id);

        model.ticket_no = txtticket_no.Text.Trim();

        model.ticket_pw = txtticket_pw.Text.Trim();

        model.pid      = int.Parse(ddlCategoryId.SelectedValue.Trim());
        model.add_time = Utils.StrToDateTime(txtAddTime.Text.Trim() + " 23:59:59");
        if (cbIsLock.Checked == true)
        {
            model.status = 2;
        }
        else
        {
            model.status = 1;
        }

        if (model.Update())
        {
            AddAdminLog("修改", "修改礼券:" + txtticket_no.Text); //记录日志
            result = true;
        }

        return(result);
    }