Ejemplo n.º 1
0
 protected void btnNewJob_Click(object sender, EventArgs e)
 {
     JobListDTO jl = new JobListDTO();
     jl.MaClaim = drDSCase.SelectedItem.Value.ToString();
     jl.NameJob = txtNameJob.Text;
     jl.MaGDV = int.Parse(Request.Cookies["MaGDV"].Value);
     jl.NgayThucHien = DateTime.Today;
     bool ad = jldao.InsertJob(jl);
     if (ad == true)
     {
         loadDSJobDaiLy();
         txtNameJob.Text = "";
     }
     else
         Response.Write("<script>alert('Updated!');<script/>");
 }
Ejemplo n.º 2
0
        public bool InsertJob(JobListDTO j)
        {
            string sql = "sp_JobList_insert";
            List<SqlParameter> list = new List<SqlParameter>();

            SqlParameter ngay = new SqlParameter("@date", SqlDbType.Date);
            ngay.Value = j.NgayThucHien;
            list.Add(ngay);

            SqlParameter diengiai = new SqlParameter("@diengiai", SqlDbType.NVarChar);
            diengiai.Value = j.NameJob;
            list.Add(diengiai);

            SqlParameter maclaim = new SqlParameter("@idclaim", SqlDbType.VarChar);
            maclaim.Value = j.MaClaim;
            list.Add(maclaim);

            SqlParameter maGDV = new SqlParameter("@idgdv", SqlDbType.Int);
            maGDV.Value = j.MaGDV;
            list.Add(maGDV);

            return SqlDataAcessHelper.exNonStoreParas(sql, list);
        }