Exemplo n.º 1
0
        protected void onButton_Click(object sender, EventArgs e)
        {
            if (sender == btnQry)
            {
                loadLeave();
            }
            else if (sender == btnSave)
            {
                IDao dao = DaoFactory.GetDao("DaoBizLeave");
                FrmUtil.GetData(ucLeave, dao.Params);
                dao.Params["Oper"] = Session["MyUserName"].ToString();

                string msg;
                int    rtn;
                if (ucLeave.IsAdd())
                {
                    rtn = dao.Insert(out msg);
                }
                else
                {
                    rtn = dao.Update(out msg);
                }
                if (rtn != 0)
                {
                    lblMsg.Text = "错误:" + msg;
                }
                else
                {
                    lblMsg.Text = "";
                    ASPxPopupControl1.ShowOnPageLoad = false;

                    loadLeave();//成功后刷新列表
                }
            }
        }
Exemplo n.º 2
0
        protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
        {
            IDao dao = DaoFactory.GetDao("DaoSysMenu");

            dao.Params["Oper"] = Session["MyUserName"].ToString();
            int    id  = Convert.ToInt16(ASPxTreeView1.SelectedNode.Name);
            string msg = "操作失败!";
            int    rtn = -1;

            // 增加平级菜单
            if (e.Item.Name.Equals("mAddDept"))
            {
                dao.Params["ID"] = id;
                rtn = dao.Insert(out msg);
            }
            // 增加子菜单
            else if (e.Item.Name.Equals("mAddSubDept"))
            {
                dao.Params["ParentID"] = id;
                rtn = dao.Oper("P_Sys_Oper_Menu", "insertSub", out msg);
            }
            // 删除部门
            else if (e.Item.Name.Equals("mDel"))
            {
                rtn = dao.Delete(id + "", out msg);
            }
            // 保存部门
            else if (e.Item.Name.Equals("mSave"))
            {
                FrmUtil.GetData(ASPxCallbackPanel1, dao.Params);
                rtn = dao.Update(out msg);
            }
            // 上移
            else if (e.Item.Name.Equals("mUp"))
            {
                dao.Params["ID"] = id;
                rtn = dao.Oper("P_Sys_Oper_Menu", "up", out msg);
            }
            // 下移
            else if (e.Item.Name.Equals("mDown"))
            {
                dao.Params["ID"] = id;
                rtn = dao.Oper("P_Sys_Oper_Menu", "down", out msg);
            }

            if (rtn != 0)
            {
                lblMsg.Text = msg;
                ASPxPopupControl1.ShowOnPageLoad = true;
            }
            else
            {
                ASPxTreeView1.Nodes.Clear();
                dao.Params.Clear();
                loadMenu(null, dao.Select(), id);
                //ASPxTreeView1.ExpandAll();
            }
        }
Exemplo n.º 3
0
        private void onDialogButtonClick(object sender, DialogButtonClickEventArgs e)
        {
            IDao dao = DaoFactory.GetDao("DaoBizContract");

            FrmUtil.GetData(this, dao.Params);
            dao.Params["Oper"] = Session["MyUserName"].ToString();

            string msg;
            int    rtn;

            if (!hidID.Contains("ID"))
            {
                rtn = dao.Insert(out msg);
            }
            else
            {
                rtn = dao.Update(out msg);
            }

            e.Msg = msg;
        }
Exemplo n.º 4
0
        protected void onButton_Click(object sender, EventArgs e)
        {
            if (sender == btnQry)
            {
                loadFamily();
            }
            else if (sender == btnSave)
            {
                //Hashtable ht = new Hashtable();


                IDao dao = DaoFactory.GetDao("DaoBizFamily");
                FrmUtil.GetData(ucFamily, dao.Params);
                dao.Params["Oper"] = Session["MyUserName"].ToString();

                string msg;
                int    rtn;
                if (ucFamily.IsAdd())
                {
                    rtn = dao.Insert(out msg);
                }
                else
                {
                    rtn = dao.Update(out msg);
                }
                //这里的lblMsg可表示为一个传递参数的LBL
                if (rtn != 0)
                {
                    lblMsg.Text = "错误:" + msg;
                }
                else
                {
                    lblMsg.Text = "";
                    ASPxPopupControl1.ShowOnPageLoad = false;

                    loadFamily();//成功后刷新列表
                }
            }
        }
Exemplo n.º 5
0
        protected void onButton_Click(object sender, EventArgs e)
        {
            if (sender == btnQry)
            {
                loadTraining();
            }
            else if (sender == btnSave)
            {
                IDao dao = DaoFactory.GetDao("DaoBizTraining");
                FrmUtil.GetData(ucTraining, dao.Params);
                //这里的ucTraining就是之前在aspx、页面中popupControl自定义填充组件的代号!
                dao.Params["Oper"] = Session["MyUserName"].ToString();
                //存储过程中有定义了一个存储过程 里面有oper这个参数 故要有个接收的

                string msg;
                int    rtn;
                if (ucTraining.IsAdd())
                {
                    rtn = dao.Insert(out msg);
                }
                else
                {
                    rtn = dao.Update(out msg);
                }
                //这里的lblMsg可表示为一个传递参数的LBL
                if (rtn != 0)
                {
                    lblMsg.Text = "错误:" + msg;
                }
                else
                {
                    lblMsg.Text = "";
                    ASPxPopupControl1.ShowOnPageLoad = false;

                    loadTraining();//成功后刷新列表
                }
            }
        }
Exemplo n.º 6
0
        protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
        {
            IDao dao = DaoFactory.GetDao("DaoBasDept");

            dao.Params["Oper"] = Session["MyUserName"].ToString();
            string code = ASPxTreeView1.SelectedNode.Name;
            string msg  = "操作失败!";
            int    rtn  = -1;

            // 增加平级部门
            if (e.Item.Name.Equals("mAddDept"))
            {
                dao.Params["Code"] = code;
                rtn  = dao.Insert(out msg);
                code = msg;
            }
            // 增加子部门
            else if (e.Item.Name.Equals("mAddSubDept"))
            {
                dao.Params["ParentCode"] = code;
                rtn  = dao.Oper("P_Bas_Oper_Dept", "insertSub", out msg);
                code = msg;
            }
            // 删除部门
            else if (e.Item.Name.Equals("mDel"))
            {
                rtn = dao.Delete(code, out msg);
            }
            // 保存部门
            else if (e.Item.Name.Equals("mSave"))
            {
                FrmUtil.GetData(ASPxPageControl1, dao.Params);
                dao.Params["NewCode"] = dao.Params["Code"];
                dao.Params["Code"]    = code;
                rtn = dao.Update(out msg);

                code = txtCode.Text;
            }
            // 上移
            else if (e.Item.Name.Equals("mUp"))
            {
                dao.Params["Code"] = code;
                rtn = dao.Oper("P_Bas_Oper_Dept", "up", out msg);
            }
            // 下移
            else if (e.Item.Name.Equals("mDown"))
            {
                dao.Params["Code"] = code;
                rtn = dao.Oper("P_Bas_Oper_Dept", "down", out msg);
            }

            if (rtn != 0)
            {
                lblMsg.Text = msg;
                ASPxPopupControl1.ShowOnPageLoad = true;
            }
            else
            {
                ASPxTreeView1.Nodes.Clear();
                dao.Params.Clear();
                loadTree(null, dao.Select(), code);
                ASPxTreeView1.ExpandAll();
            }
        }