Exemple #1
0
        public bool CapNhatTienDoXuLy(TienDoXyLyDTO td)
        {
            string sql                    = "sp_TienDoXuLy_update";
            List <SqlParameter> ds        = new List <SqlParameter>();
            SqlParameter        thamchieu = new SqlParameter("@idclaim", SqlDbType.VarChar);

            thamchieu.Value = td.MaClaim;
            ds.Add(thamchieu);
            SqlParameter tiendo = new SqlParameter("@idtiendo", SqlDbType.Int);

            tiendo.Value = td.MaTienDo;
            ds.Add(tiendo);
            SqlParameter hosoYC = new SqlParameter("@hosoyeucau", SqlDbType.NVarChar);

            hosoYC.Value = td.HoSoYeuCau;
            ds.Add(hosoYC);
            SqlParameter tinhtrang = new SqlParameter("@tinhtrang", SqlDbType.NVarChar);

            tinhtrang.Value = td.TinhTrang;
            ds.Add(tinhtrang);
            SqlParameter phuongan = new SqlParameter("@phuongandexuat", SqlDbType.NVarChar);

            phuongan.Value = td.PhuongAnDeXuat;
            ds.Add(phuongan);
            return(SqlDataAcessHelper.exNonStoreParas(sql, ds));
        }
Exemple #2
0
        public TienDoXyLyDTO Lay1TienDoXuLy(string matc, int matt)
        {
            TienDoXyLyDTO       td        = new TienDoXyLyDTO();
            string              sql       = "sp_TienDoXuLy_selectMa";
            List <SqlParameter> ds        = new List <SqlParameter>();
            SqlParameter        thamchieu = new SqlParameter("@idclaim", SqlDbType.VarChar);

            thamchieu.Value = matc;
            ds.Add(thamchieu);
            SqlParameter matiendo = new SqlParameter("@idtiendo", SqlDbType.Int);

            matiendo.Value = matt;
            ds.Add(matiendo);
            DataTable dt = new DataTable();

            dt = SqlDataAcessHelper.exStoreParas(sql, ds);
            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                td.MaClaim        = dr[1].ToString();
                td.HoSoYeuCau     = dr[3].ToString();
                td.TinhTrang      = dr[4].ToString();
                td.PhuongAnDeXuat = dr[5].ToString();
            }
            return(td);
        }
        protected void gvDanhSachTienDo_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridViewRow row = gvDanhSachTienDo.SelectedRow;

            if (row != null)
            {
                string temp = row.Cells[0].Text;
                matiendo = int.Parse(temp.ToString());
            }
            tddto = new TienDoXyLyDTO();
            tddto = tddao.Lay1TienDoXuLy(mathamchieu, matiendo);
            //tdcn = new TienDoXyLyDTO();
            //tdcn.MaClaim = mathamchieu;
            //tdcn.MaTienDo = matiendo;
            lblSoThuTu.Text        = matiendo.ToString();
            txtHoSoYeuCau.Text     = tddto.HoSoYeuCau;
            txtTinhTrang.Text      = tddto.TinhTrang;
            txtPhuongAnDeXuat.Text = tddto.PhuongAnDeXuat;
        }
        protected void btnCapNhat_Click(object sender, EventArgs e)
        {
            tddto = new TienDoXyLyDTO();

            tddto.MaClaim = mathamchieu;
            //int stt = tddao.SoLuongTienDoXuLy(mathamchieu) + 1;
            //tddto.Stt = stt;
            tddto.TinhTrang      = txtTinhTrang.Text.Trim();
            tddto.HoSoYeuCau     = txtHoSoYeuCau.Text.Trim();
            tddto.PhuongAnDeXuat = txtPhuongAnDeXuat.Text.Trim();
            bool kq = tddao.ThemTienDoXyLy(tddto);

            if (kq == true)
            {
                loadDS(mathamchieu);
                ClearInputs(Page.Controls);
            }
            else
            {
                Response.Write("<script> alert ('Lỗi!');</script>");
            }
        }