Esempio n. 1
0
 public bool Edit(Type_LotteryDTO TLO)
 {
     try
     {
         T_DAL.Edit(TLO);
     }
     catch (Exception ex)
     {
         return(false);
     }
     return(true);
 }
        protected void btn_edit_Click(object sender, EventArgs e)
        {
            Type_LotteryDTO TLO = new Type_LotteryDTO();


            TLO.CHANNEL = input_channel.Text;
            TLO.ID_TYPE = input_id.Text;

            if (TBL.Edit(TLO) == true)
            {
                MessageBox("Sửa thành công", "Type_Lottery.aspx");
            }
            else
            {
                MessageBox("Sửa không thành công", "Type_Lottery.aspx");
            }
        }
        protected void function_insert_Click(object sender, EventArgs e)
        {
            Type_LotteryDTO TLO = new Type_LotteryDTO();

            TLO.CHANNEL = input_Channel.Text;

            if (TBL.Insert(TLO) == true)
            {
                MessageBox("Thêm thành công", "Type_Lottery.aspx");
                uploadData();
            }
            else
            {
                MessageBox("Thêm không thành công", "Type_Lottery.aspx");
                uploadData();
            }
        }
Esempio n. 4
0
 public void Insert(Type_LotteryDTO TOP)
 {
     ConnectDB.con.Open();
     try
     {
         SqlCommand cmd = new SqlCommand("insert_TYPE_LOTTERY", ConnectDB.con);
         cmd.Parameters.Add("@CHANNEL", SqlDbType.NVarChar).Value = TOP.CHANNEL;
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.ExecuteNonQuery();
     }
     catch
     {
         throw;
     }
     finally
     {
         ConnectDB.con.Close();
     }
 }