//************************************************************************** /// <Description> /// This method uses to change down order of a row in sys_ReportPara /// </Description> /// <Inputs> /// ReportID, ParaName /// </Inputs> /// <Outputs> /// changes /// </Outputs> /// <Returns> /// bool /// </Returns> /// <Authors> /// DungLA /// </Authors> /// <History> /// Created: 05-Jan-2005 /// </History> /// <Notes> /// </Notes> //************************************************************************** public bool MoveDown(string pstrReportID, string pstrParaName) { bool blnResult = false; sys_ReportParaDS dsReportPara = new sys_ReportParaDS(); sys_ReportParaVO voNextPara = new sys_ReportParaVO(); // get current para order sys_ReportParaVO voCurrentPara = (sys_ReportParaVO)dsReportPara.GetObjectVO(pstrReportID, pstrParaName); // get max order int intMaxOrder = dsReportPara.GetMaxOrder(pstrReportID); // if current parameter reached the bottom, then cannot move down if (voCurrentPara.ParaOrder == intMaxOrder) { blnResult = false; } else { // get next para order int intNextOrder = dsReportPara.GetNextOrder(pstrReportID, voCurrentPara.ParaOrder, MoveDirection.Down); // change order voNextPara.ParaOrder = voCurrentPara.ParaOrder; voCurrentPara.ParaOrder = intNextOrder; // update two rows in database dsReportPara.Update(voNextPara); dsReportPara.Update(voCurrentPara); // return value blnResult = true; } return(blnResult); }
//************************************************************************** /// <Description> /// This method uses to change up order of a row in sys_ReportPara /// </Description> /// <Inputs> /// ReportID, ParaName /// </Inputs> /// <Outputs> /// changes /// </Outputs> /// <Returns> /// bool /// </Returns> /// <Authors> /// DungLA /// </Authors> /// <History> /// Created: 05-Jan-2005 /// </History> /// <Notes> /// </Notes> //************************************************************************** public bool MoveUp(string pstrReportID, string pstrParaName) { bool blnResult = false; sys_ReportParaDS dsReportPara = new sys_ReportParaDS(); sys_ReportParaVO voPreviousPara = new sys_ReportParaVO(); // get current para order sys_ReportParaVO voCurrentPara = (sys_ReportParaVO)dsReportPara.GetObjectVO(pstrReportID, pstrParaName); // if current parameter reached the top of order - 1, then cannot move if (voCurrentPara.ParaOrder <= 1) { blnResult = false; } else { // get next para order int intNextOrder = dsReportPara.GetNextOrder(pstrReportID, voCurrentPara.ParaOrder, MoveDirection.Up); // change order voPreviousPara.ParaOrder = voCurrentPara.ParaOrder; voCurrentPara.ParaOrder = intNextOrder; // update two rows in database dsReportPara.Update(voPreviousPara); dsReportPara.Update(voCurrentPara); // return value blnResult = true; } return(blnResult); }