Beispiel #1
0
 public bool Edit(SignUp_LotteryDTO SUL)
 {
     try
     {
         SUL_DAL.Edit(SUL);
     }
     catch (Exception ex)
     {
         return(false);
     }
     return(true);
 }
 public void Insert(SignUp_LotteryDTO TOP)
 {
     ConnectDB.con.Open();
     try
     {
         SqlCommand cmd = new SqlCommand("insert_SIGN_UP_LOTTERY", ConnectDB.con);
         cmd.Parameters.Add("@ID_AGENCY", SqlDbType.VarChar).Value = TOP.ID_AGENCY;
         cmd.Parameters.Add("@ID_TYPE", SqlDbType.VarChar).Value   = TOP.ID_TYPE;
         cmd.Parameters.Add("@DATE_SIGN", SqlDbType.VarChar).Value = TOP.DATE_SIGN;
         cmd.Parameters.Add("@QUANTITY", SqlDbType.Int).Value      = TOP.QUANITY_SIGN;
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.ExecuteNonQuery();
     }
     catch
     {
         throw;
     }
     finally
     {
         ConnectDB.con.Close();
     }
 }
Beispiel #3
0
        protected void btn_edit_Click(object sender, EventArgs e)
        {
            SignUp_LotteryDTO SULO = new SignUp_LotteryDTO();

            SULO.ID_SIGN   = input_id_sign.Text;
            SULO.ID_AGENCY = input_id_agency.SelectedValue;
            SULO.ID_TYPE   = input_Id_type.SelectedValue;
            string[] d    = input_date_sign.Text.Split('/');
            string   date = d[1] + "-" + d[0] + "-" + d[2];

            SULO.DATE_SIGN    = date;
            SULO.QUANITY_SIGN = int.Parse(input_quantity.Text);

            if (SULBL.Edit(SULO) == true)
            {
                MessageBox("Sửa thành công", "SignUp_Lottery.aspx");
            }
            else
            {
                MessageBox("Sửa không thành công", "SignUp_Lottery.aspx");
            }
        }
Beispiel #4
0
        protected void function_insert_Click(object sender, EventArgs e)
        {
            SignUp_LotteryDTO SLO = new SignUp_LotteryDTO();

            SLO.ID_AGENCY = input_Id_agency.SelectedValue;
            SLO.ID_TYPE   = input_Id_type.SelectedValue;

            string[] d    = input_Date_sign.Text.Split('/');
            string   date = d[1] + "-" + d[0] + "-" + d[2];

            SLO.DATE_SIGN    = date;
            SLO.QUANITY_SIGN = int.Parse(input_Quanity_sign.Text);

            if (SULBL.Insert(SLO) == true)
            {
                MessageBox("Thêm thành công", "SignUp_Lottery.aspx");
                uploadData();
            }
            else
            {
                MessageBox("Thêm không thành công", "SignUp_Lottery.aspx");
                uploadData();
            }
        }