Example #1
0
        private void BindData()
        {
            Entities.QueryProjectInfo query = new Entities.QueryProjectInfo();
            if (!string.IsNullOrEmpty(RequestProjectName))
            {
                query.Name = RequestProjectName;
            }
            if (!string.IsNullOrEmpty(RequestBGID))
            {
                int _bgid = 0;
                if (int.TryParse(RequestBGID, out _bgid))
                {
                    query.BGID = _bgid;
                }
            }
            //项目类型
            query.Sources = "4,6";
            int       count;
            DataTable dt;

            dt          = BLL.ProjectInfo.Instance.GetLastestProjectByUserID(query, " a.createtime desc", BLL.PageCommon.Instance.PageIndex, PageSize, out count, userID);
            RecordCount = count;
            repterProjectlist.DataSource = dt;
            repterProjectlist.DataBind();
            litPagerDown.Text = PageCommon.Instance.LinkStringByPost(BLL.Util.GetUrl(), GroupLength, count, PageSize, PageCommon.Instance.PageIndex, 2);
        }
Example #2
0
        //绑定数据
        private void BindData()
        {
            Entities.QueryProjectInfo query = new Entities.QueryProjectInfo();

            if (RequestProjectID > 0)
            {
                query.ProjectID = RequestProjectID;
            }
            else if (RequestProjectID < 0 && !string.IsNullOrEmpty(RequestName))
            {
                query.Name = StringHelper.SqlFilter(RequestName);
            }

            if (RequestGroup != "")
            {
                query.BGID = int.Parse(RequestGroup);
            }
            if (RequestCategory != "")
            {
                query.PCatageID = int.Parse(RequestCategory);
            }
            query.wherePlus =
                " and ProjectInfo.status>0  AND NOT EXISTS(SELECT 1 FROM AutoCall_ProjectInfo bb WHERE ProjectInfo.ProjectID=bb.projectid ) ";
            //


            DataTable dt = BLL.ProjectInfo.Instance.GetProjectInfo(query, " ProjectInfo.CreateTime Desc", BLL.PageCommon.Instance.PageIndex, PageSize, out RecordCount, userID);

            repeaterTableList.DataSource = dt;
            repeaterTableList.DataBind();

            litPagerDown.Text = BLL.PageCommon.Instance.LinkStringByPost(BLL.Util.GetUrl(), GroupLength, RecordCount, PageSize, BLL.PageCommon.Instance.PageIndex, 100);
        }
        //绑定数据
        public void BindData()
        {
            Entities.QueryProjectInfo query = new Entities.QueryProjectInfo();

            if (RequestProjectID > 0)
            {
                query.ProjectID = RequestProjectID;
            }
            else if (!string.IsNullOrEmpty(RequestName))
            {
                query.Name = StringHelper.SqlFilter(RequestName);
            }
            if (RequestStatuss != "")
            {
                query.Statuss = StringHelper.SqlFilter(RequestStatuss);
            }

            if (RequestGroup != "")
            {
                query.BGID = int.Parse(RequestGroup);
            }
            if (RequestCategory != "")
            {
                //query.PCatageID = int.Parse(RequestCategory);
                int  outPcatage = -1;
                bool bResult    = Int32.TryParse(RequestCategory, out outPcatage);
                if (bResult)
                {
                    query.PCatageID = outPcatage;
                }
            }
            if (RequestCreater != "")
            {
                query.CreateUserID = int.Parse(RequestCreater);
            }
            if (RequestBeginTime != "")
            {
                query.BeginTime = StringHelper.SqlFilter(RequestBeginTime);
            }
            if (RequestEndTime != "")
            {
                query.EndTime = StringHelper.SqlFilter(RequestEndTime);
            }
            query.ISAutoCall = ISAutoCall;
            query.ACStatus   = ACStatus;

            DataTable dt = BLL.ProjectInfo.Instance.GetProjectInfo(query, "ProjectInfo.CreateTime Desc", BLL.PageCommon.Instance.PageIndex, PageSize, out RecordCount, userID);

            repeaterTableList.DataSource = dt;
            repeaterTableList.DataBind();

            litPagerDown.Text = BLL.PageCommon.Instance.LinkStringByPost(BLL.Util.GetUrl(), GroupLength, RecordCount, PageSize, BLL.PageCommon.Instance.PageIndex, 1);
        }
        //绑定数据
        public void BindData()
        {
            Entities.QueryProjectInfo query = new Entities.QueryProjectInfo();



            DataTable dt = BLL.AutoCall_ProjectInfo.Instance.GetAutoCallProjectInfo(StringHelper.SqlFilter(RequestName), Requestgroup, Requestcategory, Requeststatus, RequestacStatus, userID, BLL.PageCommon.Instance.PageIndex, PageSize, out RecordCount);

            repeaterTableList.DataSource = dt;
            repeaterTableList.DataBind();

            litPagerDown.Text = BLL.PageCommon.Instance.LinkStringByPost(BLL.Util.GetUrl(), GroupLength, RecordCount, PageSize, BLL.PageCommon.Instance.PageIndex, 1);
        }
Example #5
0
        //取当前人管辖分组下时间最近的项目
        public void GetLastestProject(out string msg)
        {
            int userid = BLL.Util.GetLoginUserID();

            Entities.QueryProjectInfo query = new Entities.QueryProjectInfo();
            //项目类型
            query.Sources = "4,6";
            int       count;
            DataTable dt = BLL.ProjectInfo.Instance.GetLastestProjectByUserID(query, " a.createtime desc", 1, 1, out count, userid);

            msg = string.Empty;
            if (dt != null && dt.Rows.Count > 0)
            {
                msg = "{projectid:" + dt.Rows[0]["ProjectID"].ToString()
                      + ",projectname:'" + dt.Rows[0]["Name"].ToString()
                      + "',source:" + dt.Rows[0]["Source"].ToString()
                      + ",ProjectTime:'" + dt.Rows[0]["createtime"].ToString() + "'}";
            }
        }
Example #6
0
        public List <Entities.ProjectInfo> GetProjectInfoByDemandIDBathList(string CurrDemandID, int Batch)
        {
            List <Entities.ProjectInfo> model = new List <Entities.ProjectInfo>();

            Entities.QueryProjectInfo query = new Entities.QueryProjectInfo();
            query.DemandID = CurrDemandID;
            query.Batch    = Batch;
            int       totalCount = 0;
            DataTable dt         = GetProjectInfo(query, "", 1, 999, out totalCount);

            if (dt != null && dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    model.Add(Dal.ProjectInfo.Instance.LoadSingleProjectInfo(dr));
                }
            }
            return(model);
        }
Example #7
0
        public Entities.ProjectInfo GetProjectInfoByDemandID(string CurrDemandID)
        {
            Entities.ProjectInfo      model = new Entities.ProjectInfo();
            Entities.QueryProjectInfo query = new Entities.QueryProjectInfo();
            query.DemandID = CurrDemandID;

            int       totalCount = 0;
            DataTable dt         = GetProjectInfo(query, "", 1, 999, out totalCount);

            if (dt != null && dt.Rows.Count > 0)
            {
                model = Dal.ProjectInfo.Instance.LoadSingleProjectInfo(dt.Rows[0]);
            }
            else
            {
                model = null;
            }
            return(model);
        }
 /// <summary>
 /// 加载页面元素
 /// </summary>
 protected void LoadTPage()
 {
     if (!string.IsNullOrEmpty(RequestTaskID))
     {
         Entities.OtherTaskInfo model = null;
         //根据任务id,取自定义数据表编号,自定义数据表主键
         model = BLL.OtherTaskInfo.Instance.GetOtherTaskInfo(RequestTaskID);
         if (model != null)
         {
             RelationID = model.RelationID;
             TTCode     = model.RelationTableID;
             Entities.QueryProjectInfo query = new Entities.QueryProjectInfo();
             query.ProjectID = model.ProjectID;
             int       totalCount = 0;
             DataTable dt         = BLL.ProjectInfo.Instance.GetProjectInfo(query, "", 1, 999, out totalCount);
             if (dt != null && dt.Rows.Count > 0)
             {
                 TPName = dt.Rows[0]["Name"].ToString();
             }
         }
     }
 }
Example #9
0
        private void UpdateSurveyCategoryStatus(out string msg)
        {
            msg = string.Empty;
            int _scid = 0;

            if (int.TryParse(RequestSCID, out _scid))
            {
                Entities.SurveyCategory model = BLL.SurveyCategory.Instance.GetSurveyCategory(_scid);
                if (model != null)
                {
                    int count;
                    if (model.Status == 0)
                    {
                        if (model.TypeId == 1)
                        {
                            //判断该分类在调查问卷或调查项目中使用,则不能删除
                            Entities.QuerySurveyInfo query_surveyInfo = new Entities.QuerySurveyInfo();
                            query_surveyInfo.SCID = _scid;
                            DataTable dt_surveyInfo = BLL.SurveyInfo.Instance.GetSurveyInfo(query_surveyInfo, "", 1, 10000, out count);
                            if (dt_surveyInfo.Rows.Count > 0)
                            {
                                msg = "{msg:'该分类在调查问卷中有使用,无法停用'}";
                                return;
                            }

                            //判断该分类在调查问卷或调查项目中使用,则不能删除
                            Entities.QuerySurveyProjectInfo query_projectInfo = new Entities.QuerySurveyProjectInfo();
                            query_projectInfo.SCID   = _scid;
                            query_projectInfo.Status = 0;
                            DataTable dt_projectInfo = BLL.SurveyProjectInfo.Instance.GetSurveyProjectInfo(query_projectInfo, "", 1, 10000, out count);
                            if (dt_projectInfo.Rows.Count > 0)
                            {
                                msg = "{msg:'该分类在调查项目中有使用,无法停用'}";
                                return;
                            }
                        }
                        else if (model.TypeId == 2)
                        {
                            Entities.QueryProjectInfo query = new Entities.QueryProjectInfo();
                            query.PCatageID = _scid;
                            query.Status    = 0;
                            DataTable dt = BLL.ProjectInfo.Instance.GetProjectInfo(query, "", 1, 9999, out count);
                            if (dt != null && dt.Rows.Count > 0)
                            {
                                msg = "{msg:'该分类在数据清洗项目中有使用,无法停用'}";
                                return;
                            }
                        }

                        model.Status = 1;
                    }
                    else if (model.Status == 1)
                    {
                        model.Status = 0;
                    }
                    int result = 0;
                    try
                    {
                        result = BLL.SurveyCategory.Instance.Update(model);
                        msg    = "{msg:'success'}";
                    }
                    catch (Exception ex)
                    {
                        msg = "{msg:'" + ex.Message + "'}";
                    }
                }
            }
        }
Example #10
0
        //问卷分类修改(包括编辑和删除)
        private void surveyCategoryUpdate(out string msg)
        {
            msg = string.Empty;
            int _scid;

            if (int.TryParse(RequestSCID, out _scid))
            {
                Entities.SurveyCategory model = BLL.SurveyCategory.Instance.GetSurveyCategory(_scid);
                if (model != null)
                {
                    string oldName = string.Empty;
                    string newName = string.Empty;

                    if (RequestName != "")
                    {
                        oldName    = model.Name;
                        model.Name = RequestName;
                        newName    = model.Name;
                    }

                    if (RequestStatus != "")
                    {
                        int count;

                        if (TypeId == "1")
                        {
                            //判断该分类在调查问卷或调查项目中使用,则不能删除
                            Entities.QuerySurveyInfo query_surveyInfo = new Entities.QuerySurveyInfo();
                            query_surveyInfo.SCID = _scid;
                            DataTable dt_surveyInfo = BLL.SurveyInfo.Instance.GetSurveyInfo(query_surveyInfo, "", 1, 10000, out count);
                            if (dt_surveyInfo.Rows.Count > 0)
                            {
                                msg = "{msg:'该分类在调查问卷中有使用,无法删除'}";
                                return;
                            }

                            //判断该分类在调查问卷或调查项目中使用,则不能删除
                            Entities.QuerySurveyProjectInfo query_projectInfo = new Entities.QuerySurveyProjectInfo();
                            query_projectInfo.SCID   = _scid;
                            query_projectInfo.Status = 0;
                            DataTable dt_projectInfo = BLL.SurveyProjectInfo.Instance.GetSurveyProjectInfo(query_projectInfo, "", 1, 10000, out count);
                            if (dt_projectInfo.Rows.Count > 0)
                            {
                                msg = "{msg:'该分类在调查项目中有使用,无法删除'}";
                                return;
                            }
                        }
                        else if (TypeId == "2")
                        {
                            Entities.QueryProjectInfo query = new Entities.QueryProjectInfo();
                            query.PCatageID = _scid;
                            query.Status    = 0;
                            DataTable dt = BLL.ProjectInfo.Instance.GetProjectInfo(query, "", 1, 9999, out count);
                            if (dt != null && dt.Rows.Count > 0)
                            {
                                msg = "{msg:'该分类在数据清洗项目中有使用,无法删除'}";
                                return;
                            }
                        }

                        model.Status = int.Parse(RequestStatus);
                    }
                    int result = 0;
                    try
                    {
                        result = BLL.SurveyCategory.Instance.Update(model);

                        if (RequestStatus != "" && TypeId == "2")
                        {
                            //如果是其他任务的删除
                            BLL.CallRecord_ORIG_Business.Instance.DeleteBusinessUrl((int)model.BGID, (int)model.SCID);
                        }

                        if (result == 1)
                        {
                            msg = "{msg:'操作成功'}";

                            string logType = string.Empty;

                            if (TypeId == "1")
                            {
                                //插入日志
                                if (model.Status == -1)//删除
                                {
                                    logType += "问卷分类【删除】主键【" + model.SCID + "】分类名称【" + model.Name + "】问卷";
                                }
                                else if (oldName != string.Empty && newName != string.Empty)
                                {
                                    logType += "问卷分类【修改】主键【" + model.SCID + "】分类名称由【" + oldName + "】修改为【" + newName + "】";
                                }
                            }
                            else if (TypeId == "2")
                            {
                                //插入日志
                                if (model.Status == -1)//删除
                                {
                                    logType += "项目分类【删除】主键【" + model.SCID + "】分类名称【" + model.Name + "】问卷";
                                }
                                else if (oldName != string.Empty && newName != string.Empty)
                                {
                                    logType += "项目分类【修改】主键【" + model.SCID + "】分类名称由【" + oldName + "】修改为【" + newName + "】";
                                }
                            }

                            BLL.Util.InsertUserLog(logType);
                        }
                        else
                        {
                            msg = "{msg:'操作失败'}";
                        }
                    }
                    catch (Exception ex)
                    {
                        msg = "{msg:'" + ex.Message + "'}";
                    }
                }
            }
        }