コード例 #1
0
ファイル: MgerSupport.aspx.cs プロジェクト: hoanghcmus/tomato
    void btnLuu_Click(object sender, EventArgs e)
    {
        lbtitle.Visible = true;
        // Neu tat ca du lieu deu duoc nhap hop le
        if (KiemTraDieuKien() == 1)
        {
            bool rs = false;
            HoTro data = new HoTro();
            data.Ten_Vn = txtNhapTenVn.Text;
            data.Ten_En = txtNhapTenEn.Text;
            data.Ten_Ru = txtNhapTenRu.Text;
            data.Ten_Cn = "";

            data.SDT = txtSDT.Text;
            data.Khac = txtNhapMoTa.Text;
            rs = HoTro.Them(data);
            if (rs)
            {
                refesh();
                PopulateControls();
                lbtitle.Text = " *Thêm hỗ trợ thành công!";
                CapNhatHanhDong("Thêm hỗ trợ(id: " + data.ID + ")");
            }
            else
                lbtitle.Text = " *Thêm hỗ trợ thất bại!";
        }
        else
            lbtitle.Text = " *Không thêm được hỗ trợ";
    }
コード例 #2
0
ファイル: HoTro.cs プロジェクト: hoanghcmus/benhvien
 public static bool Them(HoTro hoTro)
 {
     try
     {
         object rs = DataProvider.Instance.ExecuteNonQueryWithOutput("@ID", "HoTro_Them",
             hoTro.ID,hoTro.Ten,hoTro.SDT,hoTro.Email);
         return Convert.ToInt32(rs) > 0;
     }
     catch
     { return false; }
 }
コード例 #3
0
ファイル: HoTro.cs プロジェクト: hoanghcmus/benhvien
 public static bool Sua(HoTro hoTro)
 {
     try
     {
         object rs = DataProvider.Instance.ExecuteNonQuery("HoTro_Sua",
             hoTro.ID, hoTro.Ten, hoTro.SDT, hoTro.Email);
         return Convert.ToInt32(rs) > 0;
     }
     catch
     { return false; }
 }
コード例 #4
0
ファイル: MgerSupport.aspx.cs プロジェクト: hoanghcmus/tomato
    void repProd_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "Updata")
        {
            HoTro dataimg = new HoTro();
            TextBox txtfrmTenVn = (TextBox)e.Item.FindControl("txtfrmTenVn");
            dataimg.Ten_Vn = txtfrmTenVn.Text.Trim().ToString();
            TextBox txtfrmTenEn = (TextBox)e.Item.FindControl("txtfrmTenEn");
            dataimg.Ten_En = txtfrmTenEn.Text.Trim().ToString();
            TextBox txtfrmTenRu = (TextBox)e.Item.FindControl("txtfrmTenRu");
            dataimg.Ten_Ru = txtfrmTenRu.Text.Trim().ToString();

            TextBox txtfrmSDT = (TextBox)e.Item.FindControl("txtfrmSDT");
            dataimg.SDT = txtfrmSDT.Text.Trim().ToString();
            dataimg.ID = ConvertType.ToInt32(e.CommandArgument.ToString().Trim());
            HoTro.Sua(dataimg);
            CapNhatHanhDong("Sửa Hổ trợ (id: " + e.CommandArgument.ToString().Trim() + ")");
        }
        if (e.CommandName == "Delete")
        {
            string s = e.CommandArgument.ToString();
            HoTro.Xoa(s.ToString());
            CapNhatHanhDong("Xóa hỗ trợ (id: " + s[0].ToString() + ")");
        }
        PopulateControls();
    }