/// <summary> /// GetFreightDetailByMasterID /// </summary> /// <param name="pintFreightMasterID"></param> /// <returns></returns> /// <author>Trada</author> /// <date>Tuesday, Feb 28 2006</date> public DataSet GetFreightDetailByMasterID(int pintFreightMasterID) { DataSet dstFreightDetail = new DataSet(); cst_FreightDetailDS dscst_FreightDetail = new cst_FreightDetailDS(); dstFreightDetail = dscst_FreightDetail.GetFreightDetailByMasterID(pintFreightMasterID); return(dstFreightDetail); }
/// <summary> /// GetReturnToVendorDetail /// </summary> /// <param name="pintReturnToVendorMasterID"></param> /// <returns></returns> /// <author>Trada</author> /// <date>Thursday, July 6 2006</date> public DataSet GetReturnToVendorDetail(int pintReturnToVendorMasterID) { DataSet dstReturnToVendor = new DataSet(); cst_FreightDetailDS dsFreightDetail = new cst_FreightDetailDS(); dstReturnToVendor = dsFreightDetail.GetReturnToVendorByMasterID(pintReturnToVendorMasterID); foreach (DataRow drow in dstReturnToVendor.Tables[0].Rows) { drow[IV_AdjustmentTable.ADJUSTMENTID_FLD] = DBNull.Value; } return(dstReturnToVendor); }
/// <summary> /// DeleteMasterAndDetail /// </summary> /// <param name="pintMasterID"></param> /// <author>Trada</author> /// <date>Tuesday, Feb 28 2006</date> public void DeleteMasterAndDetail(int pintMasterID, DataSet pdstDetail) { foreach (DataRow drow in pdstDetail.Tables[0].Rows) { if (drow.RowState != DataRowState.Deleted) { drow.Delete(); } } cst_FreightDetailDS dsFreightDetail = new cst_FreightDetailDS(); dsFreightDetail.UpdateDataSet(pdstDetail); cst_FreightMasterDS dsFreightMaster = new cst_FreightMasterDS(); dsFreightMaster.Delete(pintMasterID); }
/// <summary> /// AddAndReturnID /// </summary> /// <param name="pobjMasterVO"></param> /// <param name="pdstDetail"></param> /// <returns></returns> /// <author>Trada</author> /// <date>Monday, Feb 27 2006</date> public int AddAndReturnID(cst_FreightMasterVO pobjMasterVO, DataSet pdstDetail) { int intMasterID = 0; cst_FreightMasterDS dscst_FreightMaster = new cst_FreightMasterDS(); intMasterID = dscst_FreightMaster.AddAndReturnID(pobjMasterVO); //save detail foreach (DataRow drow in pdstDetail.Tables[0].Rows) { if (drow.RowState == DataRowState.Deleted) { continue; } drow[cst_FreightDetailTable.FREIGHTMASTERID_FLD] = intMasterID; } cst_FreightDetailDS dscst_FreightDetail = new cst_FreightDetailDS(); //Update dataset dscst_FreightDetail.UpdateDataSet(pdstDetail); return(intMasterID); }
/// <summary> /// UpdateMasterAndDetail /// </summary> /// <param name="pobjMasterVO"></param> /// <param name="pdstDetail"></param> /// <author>Trada</author> /// <date>Tuesday, Feb 28 2006</date> public void UpdateMasterAndDetail(cst_FreightMasterVO pobjMasterVO, DataSet pdstDetail) { cst_FreightMasterDS dsFreightMaster = new cst_FreightMasterDS(); cst_FreightDetailDS dsFreightDetail = new cst_FreightDetailDS(); if (pobjMasterVO.FreightMasterID > 0) { foreach (DataRow drow in pdstDetail.Tables[0].Rows) { if (drow.RowState == DataRowState.Deleted) { continue; } if (int.Parse(drow[cst_FreightMasterTable.FREIGHTMASTERID_FLD].ToString()) == 0) { drow[cst_FreightMasterTable.FREIGHTMASTERID_FLD] = pobjMasterVO.FreightMasterID; } } } //Update master dsFreightMaster.Update(pobjMasterVO); //Update Detail dsFreightDetail.UpdateDataSet(pdstDetail); }
/// <summary> /// Get Additional Charge (including Freight, Import Tax, Credit Note, Debit Note) /// </summary> /// <param name="pintCCNID">CCN</param> /// <param name="pdtmFromDate">From Date</param> /// <param name="pdtmToDate">To Date</param> /// <returns></returns> public DataTable GetAdditionalCharge(int pintCCNID, DateTime pdtmFromDate, DateTime pdtmToDate) { cst_FreightDetailDS dsFreight = new cst_FreightDetailDS(); return(dsFreight.ListAll(pintCCNID, pdtmFromDate, pdtmToDate)); }