예제 #1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (this.lblErrorMessage.Text.Length != 0)
            {
                this.lblErrorMessage.Text = "";
            }

            BoothInfoDTO dto = populate();

            Facade       facade       = Facade.GetInstance();
            IBoothInfoBL oBoothInfoBL = facade.createBoothInfoBL();
            oBoothInfoBL.addNewBoothRecord(dto);

            this.lblErrorMessage.Text = "Data Save Successfully.";

            this.ddlBranchName.SelectedValue = "";
            this.txtHideFieldPK.Value        = "";
            this.txtCashLimit.Text           = "";
            this.chkBoothStatus.Checked      = true;
            this.btnSave.Text = "Save";
            this.GridView1.DataBind();
        }
        catch (Exception Exp)
        {
            lblErrorMessage.Text = cls.ErrorString(Exp);
        }
    }
예제 #2
0
    private void DropDownListBoothNo(Facade facade)
    {
        IBoothInfoBL        BoothList      = facade.createBoothInfoBL();
        List <BoothInfoDTO> oBoothInfoList = BoothList.showDataBoothInfo();

        int i = 0;

        ddlBoothNo.Items.Clear();
        ddlBoothNo.Items.Add("(Select booth No.)");
        this.ddlBoothNo.Items[i].Value = "";
        foreach (BoothInfoDTO newDto in oBoothInfoList)
        {
            i++;
            this.ddlBoothNo.Items.Add(newDto.BoothNo.ToString());
            this.ddlBoothNo.Items[i].Value = newDto.PrimaryKey.ToString();
        }
    }
예제 #3
0
    protected void btnBoothReg_Click(object sender, EventArgs e)
    {
        int permanentDay = 0;
        int demoDay      = 0;
        int ExpiresDate  = 0;

        if ((chkPermanent.Checked == false) && (chkDemo.Checked == false))
        {
            this.lblErrorMessage.Text = "You must be select Registration Type!";
            return;
        }
        if ((chkPermanent.Checked == true) && (chkDemo.Checked == true))
        {
            this.lblErrorMessage.Text = "You must be select one registration Type!";
            return;
        }
        if ((chkPermanent.Checked == true) && (chkDemo.Checked == false))
        {
            permanentDay = 356;
        }
        if ((chkPermanent.Checked == false) && (chkDemo.Checked == true))
        {
            if (this.txtBoothExpiresDate.Text == "")
            {
                return;
            }
            demoDay = int.Parse(this.txtBoothExpiresDate.Text);
        }
        if (this.lblErrorMessage.Text.Length != 0)
        {
            this.lblErrorMessage.Text = "";
        }


        BoothInfoDTO dto = populate();

        Facade       facade       = Facade.GetInstance();
        IBoothInfoBL oBoothInfoBL = facade.createBoothInfoBL();

        oBoothInfoBL.addNewBoothRecord(dto);


        // Get values in text field
        string boothNo = this.ddlBoothNo.SelectedValue;

        if (permanentDay != 0)
        {
            ExpiresDate = permanentDay;
        }
        else
        {
            ExpiresDate = demoDay;
        }



        DateTime dt = DateTime.Now;
        TimeSpan ts = new TimeSpan(0, ExpiresDate, 0, 0);

        //Create a custome coookies
        HttpCookie myCookie = new HttpCookie("DPOS");

        //Keep data in cookies
        //myCookie["BoothNo"] = "ONE";
        myCookie["BoothNo"] = boothNo;
        myCookie.Expires    = dt.Add(ts);
        Response.Cookies.Add(myCookie);


        this.lblErrorMessage.Text     = "Booth Registration Successfully.";
        this.ddlBoothNo.SelectedValue = "";
        //this.pnlDay.Visible = false;
        this.txtHideFieldPK.Value = "";
        this.chkPermanent.Checked = false;
        this.chkDemo.Checked      = false;
    }