예제 #1
0
    /// <summary>
    /// 创建地区的子节点
    /// </summary>
    private void CreateXElement(XElement root, FineOffice.Modules.CRM_Area model)
    {
        List <FineOffice.Modules.CRM_Area> tempList = areaList.Where(a => a.ParentID == model.ID).OrderBy(t => t.Ordering).ToList();

        foreach (FineOffice.Modules.CRM_Area temp in tempList)
        {
            XElement xe = new XElement("TreeNode", new object[]
            {
                new XAttribute("Text", temp.Area),
                new XAttribute("SingleClickExpand", false),
                new XAttribute("NodeID", temp.ID),
            });
            root.Add(xe);
            CreateXElement(xe, temp);
        }
    }
예제 #2
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     FineOffice.Modules.CRM_Area model = new FineOffice.Modules.CRM_Area();
     model.Area     = txtArea.Text.Trim();
     model.Ordering = int.Parse(txtOrdering.Text);
     model.ParentID = hiddenParentID.Text.Length == 0 ? 0 : int.Parse(hiddenParentID.Text);
     model.Remark   = txtRemark.Text.Trim();
     try
     {
         areaBll.Add(model);
         PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference("subwin_close"));
     }
     catch (Exception ex)
     {
         Alert.ShowInTop(ex.Message);
     }
 }
예제 #3
0
    private void InitModule()
    {
        int id = int.Parse(Request["ID"]);

        FineOffice.Modules.CRM_Area model = areaBll.GetModel(a => a.ID == id);
        txtOrdering.Text    = model.Ordering.ToString();
        txtArea.Text        = model.Area;
        hiddenParentID.Text = model.ParentID.ToString();
        hiddenID.Text       = id.ToString();
        txtRemark.Text      = model.Remark;

        if (model.ParentID != 0)
        {
            FineOffice.Modules.CRM_Area temp = areaBll.GetModel(a => a.ID == model.ParentID);
            txtParent.Text = temp.Area;
        }
        txtParent.OnClientTriggerClick = selectAreaWin.GetSaveStateReference(txtParent.ClientID, hiddenParentID.ClientID)
                                         + selectAreaWin.GetShowReference("../common/FrmSelectArea.aspx?ID=" + id);
    }
예제 #4
0
    /// <summary>
    /// 详细信息
    /// </summary>
    protected void GeneralSituation()
    {
        ChangeTrackingList <EntitySearcher> changeTrackingList = new ChangeTrackingList <EntitySearcher>();

        if (tvwArea.SelectedNodeID.Length == 0)
        {
            lblArea.Text         = "全部";
            lblAreaNumber.Text   = areaList.Count.ToString();
            lblTraderNumber.Text = traderBll.GetCount(changeTrackingList).ToString();
        }
        else
        {
            EntitySearcher search = new EntitySearcher();
            int            id     = int.Parse(tvwArea.SelectedNodeID);
            FineOffice.Modules.CRM_Area        model    = areaBll.GetModel(a => a.ID == id);
            List <FineOffice.Modules.CRM_Area> tempList = areaBll.GetSubList(model);
            StringBuilder area = new StringBuilder();
            foreach (FineOffice.Modules.CRM_Area a in tempList)
            {
                area.Append(a.ID);
                area.Append(",");
            }
            string strArea = area.ToString();
            search          = new EntitySearcher();
            search.Field    = "AreaID";
            search.Relation = "AND";
            search.Operator = "in";
            search.Content  = "(" + strArea.Substring(0, strArea.Length - 1) + ")";
            changeTrackingList.Add(search);
            lblAreaNumber.Text   = tempList.Count.ToString();
            lblTraderNumber.Text = traderBll.GetCount(changeTrackingList).ToString();
            lblArea.Text         = model.Area;
            lblOrdering.Text     = model.Ordering.ToString();
            lblRemark.Text       = model.Remark;
        }
    }