Example #1
0
 protected void TreeDpt_NodeCommand(object sender, FineUIPro.TreeCommandEventArgs e)
 {
     if (!string.IsNullOrEmpty(Request.QueryString["dptId"]))
     {
         string        dptId = Request.QueryString["dptId"];
         Model.t_Index m     = BLL.GetModel(Convert.ToInt32(dptId));
         if (e.NodeID == m.Id.ToString())
         {
             return;
         }
     }
     PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(e.Node.NodeID, e.Node.Text) + ActiveWindow.GetHideReference());
 }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindTree();
                if (!string.IsNullOrEmpty(Request.QueryString["dptId"]))
                {
                    string        dptId = Request.QueryString["dptId"];
                    Model.t_Index m     = BLL.GetModel(Convert.ToInt32(dptId));

                    TreeDpt.SelectedNodeID = m.FatherId.ToString();
                }
            }
        }
Example #3
0
        protected void LoadData(string dptId)
        {
            Model.t_Index m = BLL.GetModel(Convert.ToInt32(dptId));
            if (m == null)
            {
                Alert.ShowInTop("出错了!"); return;
            }

            txtDptName.Text = m.Name;

            dptFatherId.Text = m.FatherId.ToString();

            txtFather.Text = BLL.GetModel((int)m.FatherId).Name;
        }
Example #4
0
        protected void btnSaveClose_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["dptId"]))
            {
                string        dptId = Request.QueryString["dptId"];
                Model.t_Index m     = BLL.GetModel(Convert.ToInt32(dptId));
                if (m == null)
                {
                    return;
                }

                m.Name = txtDptName.Text.Trim();

                m.FatherId = Convert.ToInt32(dptFatherId.Text);



                if (BLL.Update(m) == true)
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                }
                else
                {
                    Alert.ShowInTop("出错了!");
                }
            }
            else
            {
                Model.t_Index m = new Model.t_Index();
                m.Name     = txtDptName.Text.Trim();
                m.FatherId = Convert.ToInt32(dptFatherId.Text);
                if (BLL.Add(m) >= 1)
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                }
                else
                {
                    Alert.ShowInTop("出错了!");
                }
            }
        }