Exemplo n.º 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);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Return the DataSet (list of record) by inputing the FieldList and Condition
        /// </summary>

        public void UpdateDataSet(DataSet pdstData)
        {
            try
            {
                PRO_DCOptionDetailDS dsDCOption = new PRO_DCOptionDetailDS();
                dsDCOption.UpdateDataSet(pdstData);
            }
            catch (PCSDBException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Exemplo n.º 3
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]);
        }