Ejemplo n.º 1
0
    DataRow GetCase(string body)

    {
        try
        {
            body = transform(body);
            string  start = "CaseDetail.aspx?id=";
            int     begin = body.IndexOf(start) + start.Length;
            int     end   = body.IndexOf("&CompanyID=");
            string  id    = body.Substring(begin, end - begin);
            DataRow dr    = new BLL.CaseBLL(int.Parse(CompanyID)).GetCaseByID(id).Tables[0].Rows[0];
            return(dr);
        }
        catch
        {
            return(null);
        }
    }
Ejemplo n.º 2
0
    private void formSearchMenu()
    {
        string where = GetSearchCondition();
        StringBuilder sb = new StringBuilder();
        string        group;
        string        item;

        int i = 1;

        string order;
        string orderField;

        if (OrderStr == null)
        {
            order      = "";
            orderField = "";
        }
        else
        {
            order      = OrderStr;
            orderField = OrderField;
        }

        DataSet CaseUsersDS = new BLL.CaseBLL(int.Parse(CompanyID)).GetCaseList(where, orderField, order);

        AllOpenedDataSet = BLL.OpenedCaseBLL.GetOpenedCaseList("CaseID", string.Format("CompanyID={0} and UserID={1}", CompanyID, CurrentUser.ID));

        int count = CaseUsersDS.Tables[0].Rows.Count;

        group = string.Format(GroupMenu, i, PatchName, count);
        sb.AppendLine(group);

        for (int j = 0; j < CaseUsersDS.Tables[0].Rows.Count; j++)
        {
            DataRow drCase      = CaseUsersDS.Tables[0].Rows[j];
            string  displayName = drCase[1].ToString();
            string  caseID      = drCase[0].ToString();

            if (drCase["Repeated"].ToString() == "1")
            {
                displayName = string.Format("<font color='red'>{0}</font>", displayName);
            }


            if (drCase["Phoned"].ToString() == "1")
            {
                displayName = string.Format("{0}(电)", displayName);
            }
            if (drCase["Visited"].ToString() == "1")
            {
                displayName = string.Format("{0}(访)", displayName);
            }
            if (drCase["PromisedDate"].ToString() != "")
            {
                displayName = string.Format("{0}(诺)", displayName);
            }


            if (IsOpened(caseID))
            {
                displayName = string.Format("{0}(打开)", displayName);
            }

            item = string.Format(itemMenu, i, displayName, drCase[0].ToString(), CompanyID);

            sb.AppendLine(item);
        }


        Menus = sb.ToString();
    }