/// <summary> /// Update Master object and update detail dataset /// </summary> public void Update(object pobjMaster, DataSet pdstDetails) { STD_CostCenterRateMasterDS dsMaster = new STD_CostCenterRateMasterDS(); // update master dsMaster.Update(pobjMaster); // update detail STD_CostCenterRateDetailDS dsDetail = new STD_CostCenterRateDetailDS(); dsDetail.UpdateDataSet(pdstDetails); }
public int AddAndReturnID(object pobjMaster, DataSet pdstDetail) { STD_CostCenterRateMasterDS dsMaster = new STD_CostCenterRateMasterDS(); // save master object first and get new id int intNewID = dsMaster.AddAndReturnID(pobjMaster); // now assign new id to detail data foreach (DataRow drowData in pdstDetail.Tables[0].Rows) { if (drowData.RowState != DataRowState.Deleted) { drowData[STD_CostCenterRateDetailTable.COSTCENTERRATEMASTERID_FLD] = intNewID; } } // update detail data STD_CostCenterRateDetailDS dsDetail = new STD_CostCenterRateDetailDS(); dsDetail.UpdateDataSet(pdstDetail); // return master id to client return(intNewID); }