Exemplo n.º 1
0
        protected void btnKhoaSo_Click(object sender, EventArgs e)
        {
            try
            {
                System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.CreateSpecificCulture("vi-VN");
                CaSauController cont   = new CaSauController();
                int             result = cont.Config_SetNgayKhoaSo(DateTime.Parse(txtDate.Text.Trim(), ci));
                if (result == -1)
                {
                    Page.ClientScript.RegisterStartupScript(typeof(string), "khoasofail", "alert('Khóa sổ không thành công');", true);
                    return;
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(typeof(string), "khoasosuccess", "alert('Khóa sổ thành công!');", true);
                }
            }

            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }