Exemplo n.º 1
0
        protected override object GetDataFromDataRow(DataTable dt, int i)
        {
            DONVI obj = new DONVI();

            obj.DON_ID = int.Parse(dt.Rows[i]["DON_ID"].ToString());
            //some column
            return((object)obj);
        }
Exemplo n.º 2
0
        public void delete(DONVI donvi)
        {
            SqlParameter[] prams =
            {
                MakeInParam("@DON_ID", SqlDbType.Int, 4, donvi.DON_ID)
            };
            int errorcode = RunProc("usp_DeleteDONVI", prams);

            if (errorcode > 0)
            {
                throw new Exception("Error");
            }
        }
Exemplo n.º 3
0
        public DataTable getByID_DONVI(DONVI donvi)
        {
            connect();
            DataSet DS = new DataSet();

            SqlParameter[] prams =
            {
                MakeInParam("@DON_ID", SqlDbType.Int, 4, donvi.DON_ID)
            };

            int errorcode = RunProcDS("usp_SelectDONVI", prams, out DS);

            if (errorcode > 0)
            {
                throw new Exception("Error!");
            }

            return(DS.Tables[0]);
        }
Exemplo n.º 4
0
        public void update(DONVI donvi)
        {
            SqlParameter[] prams =
            {
                MakeInParam("@DON_ID",     SqlDbType.Int,         4, donvi.DON_ID),
                MakeInParam("@DON_Code",   SqlDbType.NVarChar,   20, donvi.DON_Code),
                MakeInParam("@DON_Name",   SqlDbType.NVarChar,  200, donvi.DON_Name),
                MakeInParam("@DON_DiaChi", SqlDbType.NVarChar,  200, donvi.DON_DiaChi),
                MakeInParam("@DON_Phone",  SqlDbType.NVarChar,   12, donvi.DON_Phone),
                MakeInParam("@DON_Fax",    SqlDbType.NVarChar,   12, donvi.DON_Fax),
                MakeInParam("@DON_GhiChu", SqlDbType.NVarChar, 2000, donvi.DON_GhiChu)
            };
            int errorcode = RunProc("usp_UpdateDONVI", prams);

            if (errorcode > 0)
            {
                throw new Exception("Error");
            }
        }