Exemple #1
0
        protected override object GetDataFromDataRow(DataTable dt, int i)
        {
            DOI_CHUNGCHI obj = new DOI_CHUNGCHI();

            obj.DOI_ID = int.Parse(dt.Rows[i]["DOI_ID"].ToString());
            //some column
            return((object)obj);
        }
Exemple #2
0
        public void deleteDoiChungChiByID(DOI_CHUNGCHI vDto)
        {
            SqlParameter[] prams =
            {
                MakeInParam("@DOI_ID", SqlDbType.Int, 4, vDto.DOI_ID)
            };
            int errorcode = RunProc("DeleteHocVienDoiChungChiByID", prams);

            if (errorcode > 0)
            {
                throw new Exception("Error");
            }
        }
Exemple #3
0
        public void update(DOI_CHUNGCHI doiCC)
        {
            SqlParameter[] prams = { MakeInParam("@DOI_ID",      SqlDbType.Int,  4, doiCC.DOI_ID),
                                     //MakeInParam("@DOI_Code",SqlDbType.NVarChar,20,doiCC.DOI_Code),
                                     //MakeInParam("@DOI_HOVID",SqlDbType.Int,4,doiCC.DOI_HOVID),
                                     MakeInParam("@DOI_CHCID",   SqlDbType.Int,  4, doiCC.DOI_CHCID),
                                     //MakeInParam("@DOI_SoCC",SqlDbType.NVarChar ,20,doiCC.DOI_SoCC ),
                                     MakeInParam("@DOI_NgayCap", SqlDbType.Date, 4, doiCC.DOI_NgayCap),
                                     MakeInParam("@DOI_Ngay_KG", SqlDbType.Date, 4, doiCC.DOI_Ngay_KG),
                                     MakeInParam("@DOI_Ngay_KT", SqlDbType.Date, 4, doiCC.DOI_Ngay_KT),
                                     MakeInParam("@DOI_Ngay_QD", SqlDbType.Date, 4, doiCC.DOI_Ngay_QD) };
            int            errorcode = RunProc("usp_UpdateDOI_CHUNGCHI", prams);

            if (errorcode > 0)
            {
                throw new Exception("Error");
            }
        }
Exemple #4
0
 public int insert(DOI_CHUNGCHI doiCC)
 {
     SqlParameter[] prams = { MakeInParam("@DOI_Code",    SqlDbType.NVarChar, 20, doiCC.DOI_Code),
                              MakeInParam("@DOI_HOVID",   SqlDbType.Int,       4, doiCC.DOI_HOVID),
                              MakeInParam("@DOI_CHCID",   SqlDbType.Int,       4, doiCC.DOI_CHCID),
                              MakeInParam("@DOI_SoCC",    SqlDbType.NVarChar, 20, doiCC.DOI_SoCC),
                              MakeInParam("@DOI_NgayCap", SqlDbType.Date,      4, doiCC.DOI_NgayCap),
                              MakeInParam("@DOI_Ngay_KG", SqlDbType.Date,      4, doiCC.DOI_Ngay_KG),
                              MakeInParam("@DOI_Ngay_KT", SqlDbType.Date,      4, doiCC.DOI_Ngay_KT),
                              MakeInParam("@DOI_Ngay_QD", SqlDbType.Date,      4, doiCC.DOI_Ngay_QD),
                              MakeOutParam("@DOI_ID",     SqlDbType.Int, 4) };
     errorcode = RunProc("usp_InsertDOI_CHUNGCHI", prams);
     if (errorcode > 0)
     {
         throw new Exception("Error");
     }
     return(gID = (int)prams[8].Value);
 }