Beispiel #1
0
        /// <summary>
        /// Delete record by condition
        /// </summary>

        public void DeleteDCOption(int pintMasterID)
        {
            try
            {
                //First, delete data on detail table
                PRO_DCOptionDetailDS dsDetail = new PRO_DCOptionDetailDS();
                PRO_DCOptionMasterDS dsMaster = new PRO_DCOptionMasterDS();

                DataSet dtsDetail = dsDetail.GetDetailByMaster(pintMasterID);
                foreach (DataRow drow in dtsDetail.Tables[0].Rows)
                {
                    drow.Delete();
                }
                dsDetail.UpdateDataSet(dtsDetail);

                //Second, select all DCPResult
                dsMaster.DeleteRelatedInforOfDCOption(pintMasterID);

                //Then delete data on master table
                dsMaster.Delete(pintMasterID);
            }
            catch (PCSDBException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Gets Cycle Detail from Master
        /// </summary>
        /// <param name="pintCycleMasterID">Cycle Master ID</param>
        /// <returns>Cycle Detail</returns>

        public DataTable GetCycleDetail(int pintCycleMasterID)
        {
            PRO_DCOptionDetailDS dsDetail = new PRO_DCOptionDetailDS();

            return(dsDetail.GetDetailByMaster(pintCycleMasterID).Tables[0]);
        }