protected TruyenNhanFile GetData()
    {
        TruyenNhanFile tn = null;
        if (!lblId.Text.Equals(""))
            tn = TruyenNhanFile.LayTheoID(lblId.Text.Trim());
        else
            tn = new TruyenNhanFile();

        tn.IDThanhVienGui = Convert.ToInt32(lbIDNguoiGui.Text);
        tn.DuongDan = txtDuongDan.Text.Trim();
        tn.MoTa = txtMoTa.Text.Trim();
        tn.IDThanhVienNhan = Convert.ToInt32(drlNguoiNhan.SelectedValue); ;
        tn.NgayGui = txtNgayGui.Text.Trim();
        return tn;
    }
예제 #2
0
 public static int Them(TruyenNhanFile nd)
 {
     try
     {
         object rs = DataProvider.Instance.ExecuteNonQueryWithOutput("@ID", "TruyenNhanFile_Them", nd.ID, nd.IDThanhVienGui, nd.DuongDan, nd.MoTa, nd.IDThanhVienNhan, nd.NgayGui);
         return Convert.ToInt32(rs);
     }
     catch
     {
         return 0;
     }
 }
    protected void SetData(TruyenNhanFile tn)
    {
        txtNguoiGui.Text = tn.TenThanhVienGui;
        lbIDNguoiGui.Text = tn.IDThanhVienGui.ToString();

        down.CommandArgument = tn.DuongDan;
        txtDuongDan.Text = tn.DuongDan;

        txtMoTa.Text = tn.MoTa;
        drlNguoiNhan.SelectedValue = tn.IDThanhVienNhan.ToString();
        txtNgayGui.Text = tn.NgayGui;
    }
예제 #4
0
 public static bool Sua(TruyenNhanFile nd)
 {
     try
     {
         object rs = DataProvider.Instance.ExecuteNonQuery("TruyenNhanFile_Sua", nd.ID, nd.IDThanhVienGui, nd.DuongDan, nd.MoTa, nd.IDThanhVienNhan, nd.NgayGui);
         return Convert.ToInt32(rs) > 0;
     }
     catch
     {
         return false;
     }
 }