public void update(HOCVIEN_IMG vDto) { SqlParameter[] prams = { MakeInParam("@IMG_Name", SqlDbType.NVarChar, 100, vDto.IMG_Name), MakeInParam("@IMG_Image", SqlDbType.Image, 999999999, vDto.IMG_Image), MakeInParam("@IMG_ID", SqlDbType.Int, 4, vDto.IMG_ID) }; errorcode = RunProc("Update_HOCVIEN_IMG", prams); if (errorcode > 0) { throw new Exception("Error"); } }
public int insert(HOCVIEN_IMG vDto) { SqlParameter[] prams = { MakeInParam("@IMG_HOVID", SqlDbType.Int, 4, vDto.IMG_HOVID), MakeInParam("@IMG_Name", SqlDbType.NVarChar, 100, vDto.IMG_Name), MakeInParam("@IMG_Image", SqlDbType.Image, 999999999, vDto.IMG_Image), MakeOutParam("@IMG_ID", SqlDbType.Int, 4) }; errorcode = RunProc("Insert_HOCVIEN_IMG", prams); if (errorcode > 0) { throw new Exception("Error"); } else { return(gId = (int)prams[3].Value); } }
private bool insertImg() { DtoImg = new HOCVIEN_IMG(); BoImg = new BO_HOCVIEN_IMG(); DtoImg.IMG_HOVID = gIDHocVien; DtoImg.IMG_Name = vImgFileName; try { if (picHocVien.Image != null) { imgArray = ReadFile(vImgFileName); DtoImg.IMG_Image = imgArray; BoImg.insert(DtoImg); vFlagSaveImg = true; } } catch (Exception ex) { MessageBox.Show(ex.Message); } return(vFlagSaveImg); }
public void update(HOCVIEN_IMG vDto) { Dal = new DAL_HOCVIEN_IMG(); Dal.update(vDto); }
public int insert(HOCVIEN_IMG vDto) { Dal = new DAL_HOCVIEN_IMG(); return(Dal.insert(vDto)); }