Exemplo n.º 1
0
    public List <QuestionnaireDetailData> GetDetails(string masterPK)
    {
        QuestionnaireDetailManager qd = new QuestionnaireDetailManager();
        var datas = qd.GetDataByMasterPK(masterPK);

        return(datas);
    }
Exemplo n.º 2
0
    public string SaveDetailGroup(string value)
    {
        QuestionnaireDetailManager     qdm = new QuestionnaireDetailManager();
        List <QuestionnaireDetailData> qds = new List <QuestionnaireDetailData>();

        string[] values = value.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);

        foreach (var val in values)
        {
            var qd = new QuestionnaireDetailData();
            qd = Element.ToElement(qd, val);

            qds.Add(qd);
        }

        if (qds.Count > 0)
        {
            //先刪除
            qdm.DeleteByGroupId(qds[0].GroupId.ToString());
            //新增
            foreach (var qd in qds)
            {
                qdm.Insert(qd);
            }
        }

        return("Y");
    }
Exemplo n.º 3
0
    public string DeleteData(string detailPK)
    {
        QuestionnaireDetailManager qdm = new QuestionnaireDetailManager();

        qdm.Delete(detailPK);

        return("Y");
    }
Exemplo n.º 4
0
    public string SaveDetail(string detailPK, string masterPK, string type, string groupId, string topic, string desc,
                             string answerType, string answerDef, string nextAnswer, string needed, string sort)
    {
        QuestionnaireDetailManager qdm = new QuestionnaireDetailManager();
        int dPK, mPK, gId, s;

        int.TryParse(detailPK, out dPK);
        int.TryParse(masterPK, out mPK);
        int.TryParse(groupId, out gId);
        int.TryParse(sort, out s);

        if (detailPK == "0")
        {
            detailPK = qdm.Insert(new QuestionnaireDetailData
            {
                MasterId     = mPK,
                Type         = type,
                GroupId      = gId,
                Topic        = topic,
                Description  = desc,
                AnswerType   = answerType,
                AnswerDefine = answerDef,
                NextAnswer   = nextAnswer,
                Needed       = needed == "Y",
                Sort         = s
            });
        }
        else
        {
            qdm.Update(new QuestionnaireDetailData
            {
                Id           = dPK,
                MasterId     = mPK,
                Type         = type,
                GroupId      = gId,
                Topic        = topic,
                Description  = desc,
                AnswerType   = answerType,
                AnswerDefine = answerDef,
                NextAnswer   = nextAnswer,
                Needed       = needed == "Y",
                Sort         = s
            });
        }

        return(detailPK);
    }
Exemplo n.º 5
0
    public string UpdateSort(string value)
    {
        QuestionnaireDetailManager     qm  = new QuestionnaireDetailManager();
        List <QuestionnaireDetailData> qds = new List <QuestionnaireDetailData>();
        QuestionnaireDetailData        qd;

        string[] values = value.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);

        foreach (var val in values)
        {
            qd = new QuestionnaireDetailData();
            qd = Element.ToElement(qd, val);
            qds.Add(qd);
        }

        qm.UpdateSortBatch(qds);

        return("Y");
    }
Exemplo n.º 6
0
    public void SortItem(string sourcePK, string targetPK)
    {
        QuestionnaireDetailManager qdm = new QuestionnaireDetailManager();

        qdm.Sort(sourcePK, targetPK);
    }