Exemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="cwpId"></param>
        /// <param name="drawingId"></param>
        /// <param name="taskCategoryCodeList"></param>
        /// <param name="taskTypeIdList"></param>
        /// <param name="materialIdList"></param>
        /// <param name="progressIdList"></param>
        /// <param name="searchcValue"></param>
        /// <param name="projectId"></param>
        /// <param name="disciplineCode"></param>
        /// <param name="path"></param>
        /// <param name="grouppage"></param>
        /// <returns></returns>
        public MTOAndDrawing GetComponentProgressForScheduling(int cwpId
                                                                ,int projectscheduleId
                                                                ,int drawingId
                                                                ,List<string> taskCategoryCodeList
                                                                ,List<int> taskTypeIdList
                                                                ,List<int> materialIdList
                                                                ,List<int> progressIdList
                                                                ,string searchValue
                                                                ,int projectId
                                                                ,string disciplineCode
                                                                ,string path
                                                                ,int grouppage)
        {
            Common comm = new Common();

            MTOAndDrawing rtn = new MTOAndDrawing();
            MTOPageTotal p = new MTOPageTotal();

            string xmlID1s = (taskCategoryCodeList == null) ? "" : Element.Shared.Common.Utilities.BuildIDArrayXMLParametr(taskCategoryCodeList.ToArray());
            string xmlID2s = (taskTypeIdList == null) ? "" : Element.Shared.Common.Utilities.BuildIDArrayXMLParametr(taskTypeIdList.ToArray());
            string xmlID3s = (materialIdList == null) ? "" : Element.Shared.Common.Utilities.BuildIDArrayXMLParametr(materialIdList.ToArray());
            string xmlID4s = (progressIdList == null) ? "" : Element.Shared.Common.Utilities.BuildIDArrayXMLParametr(progressIdList.ToArray());

            //string projectpath = comm.GetProjectPath(projectId, "URL");
            //path = path + projectpath + "/";

            p = GetComponentProgressForSchedulingXmlParametrPaging(cwpId, projectscheduleId, drawingId, xmlID1s, xmlID2s, xmlID3s, xmlID4s, searchValue, projectId, disciplineCode, grouppage);

            rtn.mto = p.mto;
            rtn.TotalGroupPageCount = p.TotalPageCount;

            if (rtn.mto != null)
            {
                var x = (from m in rtn.mto select m.DrawingID).Distinct();
                string drawingIDs = Element.Shared.Common.Utilities.BuildIDArrayXMLParametr(x.ToArray());

                if (!string.IsNullOrEmpty(drawingIDs))
                {
                    rtn.drawing = comm.GetComboDrawingByIDs(path, drawingIDs);
                }
            }

            return rtn;
        }
Exemplo n.º 2
0
        private MTOPageTotal GetComponentProgressForSchedulingXmlParametrPaging(
                                                                        int cwpId,
                                                                        int projectscheduleId,
                                                                        int drawingId,
                                                                        string taskCategoryCodeList,
                                                                        string taskTypeIdList,
                                                                        string materialIdList,
                                                                        string progressIdList,
                                                                        string searchValue,
                                                                        int projectId,
                                                                        string disciplineCode,
                                                                        int grouppage)
        {
            // Get connection string
            string connStr = ConnStrHelper.getDbConnString();

            int rtnValue = 0;
            // Compose parameters
            SqlParameter[] parameters = new SqlParameter[] {
                new SqlParameter("@CWPID", cwpId),
                new SqlParameter("@ProjectScheduleID", projectscheduleId),
                new SqlParameter("@DrawingID", drawingId),

                new SqlParameter("@taskCategoryCodeList", taskCategoryCodeList),
                new SqlParameter("@taskTypeIdList", taskTypeIdList),
                new SqlParameter("@materialIdList", materialIdList),
                new SqlParameter("@progressIdList", progressIdList),

                new SqlParameter("@searchValue", searchValue),
                new SqlParameter("@ProjectID", projectId),
                new SqlParameter("@disciplineCode", disciplineCode),
                new SqlParameter("@GroupPage", grouppage),
                new SqlParameter("@TotalPage", rtnValue)
            };

            int iNum = parameters.Length - 1;
            parameters[iNum].Direction = ParameterDirection.Output;

            //DataSet ds = SqlHelper.ExecuteDataset(connStr, "tsp_GetComponentprogressForSchedulingXmlparameter", parameters);  //sp_get_progress_for_scheduling_xmlparameter
            DataSet ds = SqlHelper.ExecuteDataset(connStr, CommandType.StoredProcedure, "tsp_GetComponentprogressForSchedulingXmlparameter", parameters);  //sp_get_progress_for_scheduling_xmlparameter

            MTOPageTotal result = new MTOPageTotal();
            result.mto = DTOHelper.DataTableToListDTO<MTODTO>(ds);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                result.TotalPageCount = Convert.ToInt32(parameters[iNum].Value.ToString());
            }

            return result;
        }