예제 #1
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        int nowExpectNum = BLL.CommonClass.CommonDataBLL.getMaxqishu();

        if (nowExpectNum != 1)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("007094", "只有在第一期时才能初始化!") + "');</script>");
            return;
        }
        txtMemberId.Text = DisposeString.DisString(txtMemberId.Text.Trim());

        int count = BLL.CommonClass.CommonDataBLL.getCountNumber(txtMemberId.Text.Trim());

        if (count > 0)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert("该会员编号已存在!"));
            return;
        }

        Model.DefaultMessage def = GetModel(3, txtMemberId.Text.Trim());

        bool isSure = ManagerBLL.UpdateDefaultMember(def);

        if (!isSure)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert("修改失败!"));
            return;
        }

        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('修改成功!');</script>");
    }
예제 #2
0
        public dynamic Login()
        {
            string     name     = Fun.Query("name");
            string     password = Fun.Query("password");
            LoginBLL   bll      = new LoginBLL();
            S_UserInfo user     = bll.Login(name, password);

            if (user == null)
            {
                return("失败");
            }
            UserInfo u = new UserInfo();

            u.id   = user.user_id;
            u.name = user.user_name.Trim();
            ManagerBLL    m       = new ManagerBLL();
            S_ManagerInfo manager = m.GetManagerByLoginId(user.user_id);

            if (manager != null)
            {
                return(new { data = u, manager = manager });
            }
            else
            {
                CustomerBLL    c        = new CustomerBLL();
                C_CustomerInfo customer = c.GetCustomerByLoginId(user.user_id);
                return(new { data = u, customer = customer });
            }
        }
예제 #3
0
        static void Dump()
        {
            ManagerBLL bll = new ManagerBLL();

            Console.WriteLine("Debut Dump");
            try
            {
                Console.WriteLine("-- Employes --");
                foreach (Employe e in bll.GetEmployees())
                {
                    Console.WriteLine($"{e.Id} {e.Nom} {e.Prenom}");
                }
                Console.WriteLine("-- Fin Employes --");

                Console.WriteLine("-- Offres --");
                foreach (Offre o in bll.GetOffres())
                {
                    Console.WriteLine($"{o.Id} {o.Intitule} {o.Description} {o.Responsable} {o.Salaire} {o.Statut?.Libelle}");
                }
                Console.WriteLine("-- Fin Offres --");
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            Console.WriteLine("Fini");
        }
예제 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Permissions.ComRedirect(Page, Permissions.redirUrl);
        Response.Cache.SetExpires(DateTime.Now);
        Permissions.CheckManagePermission(Model.Other.EnumCompanyPermission.SafeRightManageEdit);
        if (!IsPostBack)
        {
            if (Request.QueryString["id"] == null || Request.QueryString["id"].ToString() == "")
            {
                ScriptHelper.SetAlert((Control)sender, GetTran("001102", "异常访问!"), "ManagerManage.aspx");
                return;
            }
            string mid = Request.QueryString["id"];
            int    id  = 0;
            //验证传入参数合法性

            try
            {
                id = int.Parse(mid);
            }
            catch (FormatException)
            {
                ScriptHelper.SetAlert(Page, GetTran("001102", "异常访问!"), "ManagerManage.aspx");
                return;
            }
            ViewState["id"] = id;
            ManageModel manage = ManagerBLL.GetManage(id);
            if (manage == null)
            {
                ScriptHelper.SetAlert(Page, GetTran("001104", "管理员已经不存在!"), "ManagerManage.aspx");
                return;
            }
            string manageId = BLL.CommonClass.CommonDataBLL.getManageID(1);
            if (manage.Number.ToString().Trim() == manageId)
            {
                ScriptHelper.SetAlert(Page, GetTran("001106", "不允许修改该管理员!"), "ManagerManage.aspx");
                return;
            }
            string number = Session["Company"].ToString();
            if (number != manageId)
            {
                if (!DeptRoleBLL.CheckAllot(number, manage.RoleID))
                {
                    ScriptHelper.SetAlert((Control)sender, GetTran("001080", "不能对该管理员进行操作,没有权限!"), "ManagerManage.aspx");
                    return;
                }
            }
            this.txtName.Text      = manage.Name;
            this.txtNumber.Text    = manage.Number;
            this.txtNumber.Enabled = false;
            this.RadioButtonList1.SelectedValue = manage.IsViewPermissions.ToString();
            this.RadioButtonList2.SelectedValue = manage.IsRecommended.ToString();
            deptID = DeptRoleBLL.GetDeptRoleByRoleID(manage.RoleID).DeptID;
            roleID = manage.RoleID;
            InitdllDepts();
        }
        Translations();
    }
    public TableData dataToJson()
    {
        Manager[] m  = ManagerBLL.GetAllList().ToArray();
        TableData td = new TableData();

        td.data  = JsonConvert.SerializeObject(m);
        td.count = m.Length;
        return(td);
    }
예제 #6
0
 /// <summary>
 /// 添加第三方物流信息
 /// </summary>
 /// <param name="logisticsModel">第三方物流基本信息</param>
 /// <param name="pass">第三方物流对应管理密码</param>
 /// <param name="warehouse">第三方物流权限仓库编号字符</param>
 /// <returns></returns>
 public int AddLogistics(LogisticsModel logisticsModel, string pass, string warehouse)
 {
     if (!ManagerBLL.CheckNumber(logisticsModel.Number))
     {
         //标识已存在相同编号的管理员不可修改
         return(-2);
     }
     return(0);//ThirdLogisticsDAL.AddLogistics(logisticsModel, pass, warehouse);
 }
예제 #7
0
    private void BindDropAdmin()
    {
        DataTable dt = ManagerBLL.GetAllManageNumber();

        foreach (DataRow item in dt.Rows)
        {
            ListItem list = new ListItem(item["Number"].ToString(), item["Number"].ToString());
            this.DropAdmin.Items.Add(list);
        }
    }
예제 #8
0
 /// <summary>
 /// 加载默认数据
 /// xyc:2011-12-7
 /// </summary>
 private void LoadDefaultData()
 {
     //加载业务员,默认当前登录者,不可修改
     if (Session["Company"] != null)
     {
         string      number  = Session["Company"].ToString();
         ManageModel loginer = ManagerBLL.GetManage(number);
         this.txtOperationPerson.Text     = loginer == null?"":loginer.Name;
         this.txtOperationPerson.ReadOnly = true;
     }
 }
예제 #9
0
 /// <summary>
 /// 下拉列表选择事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void com_manager_id_SelectionChangeCommitted(object sender, EventArgs e)
 {
     mb   = new ManagerBLL();
     list = mb.FindId((int)com_manager_id.SelectedValue);
     if (list.Count > 0)
     {
         mm = list[0];
         text_manager_name.Text     = mm.Manager_name;
         text_manager_passowrd.Text = mm.Manager_password;
         text_manager_username.Text = mm.Manager_username;
     }
 }
예제 #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Permissions.ComRedirect(Page, Permissions.redirUrl);
        Response.Cache.SetExpires(DateTime.Now);
        Permissions.CheckManagePermission(Model.Other.EnumCompanyPermission.SafeRightManageEdit);
        if (!IsPostBack)
        {
            if (Request.QueryString["id"] == null)
            {
                Response.Redirect("DeptRolesManage.aspx");
            }

            int  roleId = 0;
            bool b      = int.TryParse(Request.QueryString["id"], out roleId);
            //验证角色编号的合法性
            if (!b)
            {
                //编号不合法则转到角色管理页面
                Response.Redirect("DeptRolesManage.aspx");
            }

            string number   = Session["Company"].ToString();
            string manageId = BLL.CommonClass.CommonDataBLL.getManageID(1);
            if (number != manageId)
            {
                if (!DeptRoleBLL.CheckAllot(number, roleId))
                {
                    ScriptHelper.SetAlert((Control)sender, GetTran("000975", "不能对该角色进行操作,没有权限!"), "DeptRolesManage.aspx");
                    return;
                }
            }
            else
            {
                ManageModel model = ManagerBLL.GetManage(number);
                if (model.RoleID == roleId)
                {
                    ScriptHelper.SetAlert((Control)sender, GetTran("001180", "不能对该系统管理角色进行任何操作."), "DeptRolesManage.aspx");
                    return;
                }
            }
            DeptRoleModel deptRole = DeptRoleBLL.GetDeptRoleByRoleID(roleId);
            if (deptRole == null)
            {
                Response.Redirect("DeptRolesManage.aspx");
            }
            ViewState["deptId"]   = deptRole.DeptID;
            ViewState["roleid"]   = roleId;
            this.txtRoleName.Text = deptRole.Name;  //将角色的名称加载到文本框里
            ViewState["Name"]     = deptRole.Name;
            InitdllDepts();
        }
        Translations();
    }
예제 #11
0
        public void Postulation(int idOffre, int idEmp)
        {
            if (idOffre.Equals("") || idEmp.Equals(""))
            {
                throw new Exception("IDs pour postuler vide");
            }
            ManagerBLL bll = new ManagerBLL();

            Task.Run(async() => await bll.CreatePostulationAsync(idOffre, idEmp));

            //PostulationDataContract postulation = new PostulationDataContract(idOffre, idEmp);
        }
예제 #12
0
        public dynamic GetManager()
        {
            int           id      = Fun.Query("id", 0);
            ManagerBLL    m       = new ManagerBLL();
            S_ManagerInfo mgr     = m.GetManager(id);
            ManagerInfo   manager = new ManagerInfo();

            manager.id      = mgr.mgr_id;
            manager.loginId = mgr.mgr_login_id;
            manager.name    = mgr.mgr_name.Trim();
            manager.img     = mgr.mgr_headimgurl;
            manager.time    = mgr.mgr_time.ToString("yyyy-MM-dd hh:MM:ss");
            return(manager);
        }
예제 #13
0
        /// <summary>
        /// 修改第三方物流信息
        /// </summary>
        /// <param name="logisticsModel">第三方物流基本信息</param>
        /// <param name="id">第三方物流编号</param>
        /// <param name="pass">第三方物流对应管理密码</param>
        /// <param name="warehouse">第三方物流权限仓库编号字符</param>
        /// <returns></returns>
        public int UpdateThirdLogistics(LogisticsModel logisticsModel, int id, string pass, string warehouse)
        {
            LogisticsModel model = thirdLogisticsDAL.GetThirdLogisticsInit(id);

            if (model.Number != logisticsModel.Number)
            {
                if (!ManagerBLL.CheckNumber(logisticsModel.Number))
                {
                    //标识已存在相同编号的管理员不可修改
                    return(-2);
                }
            }
            return(ThirdLogisticsDAL.UptLogistics(logisticsModel, pass, warehouse, id));
        }
예제 #14
0
        /// <summary>
        /// 登录按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Loginbtn_Click(object sender, EventArgs e)
        {
            ManagerBLL        mb   = new ManagerBLL();
            List <ManagerMOD> list = mb.FindName(Nametext.Text);                       //根据用户名查询密码

            if (list.Count == 0 || list[0].Manager_password != Passwordtext.Text)      //如果返回的密码和输入的密码不一致
            {
                MessageBox.Show("您的用户名或密码有误,请重新输入:");
                Passwordtext.Text = "";
                return;
            }
            LoginInfo.manager_info = list[0];
            this.Close();
        }
예제 #15
0
        public dynamic UpdateManagerImg()
        {
            int        id  = Fun.Form("id", 0);
            string     img = Fun.Form("img");
            ManagerBLL m   = new ManagerBLL();

            if (!m.UpdateManagerImg(id, img))
            {
                return("失败");
            }
            else
            {
                return("成功");
            }
        }
예제 #16
0
        public dynamic UpdateManagerName()
        {
            int        id   = Fun.Form("id", 0);
            string     name = Fun.Form("name");
            ManagerBLL m    = new ManagerBLL();

            if (id == 1 || !m.UpdateManagerName(id, name))//系统管理员不能被修改名称
            {
                return("失败");
            }
            else
            {
                return("成功");
            }
        }
예제 #17
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        txtManageId.Text = DisposeString.DisString(txtManageId.Text.Trim());
        Model.DefaultMessage def = GetModel(1, txtManageId.Text.Trim());

        bool isSure = ManagerBLL.UpdateDefaultManage(def);

        if (!isSure)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert("修改失败!"));
            return;
        }

        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('修改成功,请重新登录!');top.location.href('../logout.aspx')</script>");
    }
예제 #18
0
 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     Application.Lock();
     if (e.CommandName == "D")
     {
         Permissions.CheckManagePermission(Model.Other.EnumCompanyPermission.SafeRightManageDelete);
         int manageId = 0;
         try
         {
             manageId = int.Parse(e.CommandArgument.ToString());
         }
         catch (FormatException)
         {
             ScriptHelper.SetAlert(Page, GetTran("001074", "管理员编号不存在!"));
             return;
         }
         ManageModel manageModel = ManagerBLL.GetManage(manageId);
         if (manageModel == null)
         {
             ScriptHelper.SetAlert(Page, GetTran("001076", "该记录已经被删除"));
             return;
         }
         string manageId1 = BLL.CommonClass.CommonDataBLL.getManageID(1);
         if (manageModel.Number.Trim() == manageId1)
         {
             ScriptHelper.SetAlert(Page, GetTran("001079", "不允许删除该记录!"));
             return;
         }
         string number = Session["Company"].ToString();
         if (number != manageId1)
         {
             if (!DeptRoleBLL.CheckAllot(number, manageModel.RoleID))
             {
                 ScriptHelper.SetAlert((Control)sender, GetTran("001080", "不能对该管理员进行操作,没有权限!"));
                 return;
             }
         }
         BLL.CommonClass.ChangeLogs cl = new BLL.CommonClass.ChangeLogs("manage", "id");
         cl.AddRecord(manageId);
         if (ManagerBLL.DelManage(manageId) > 0)
         {
             cl.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company26, GetTran("001082", "管理员:") + manageModel.Number.Trim(), BLL.CommonClass.ENUM_USERTYPE.objecttype7);
             ScriptHelper.SetAlert((Control)sender, GetTran("000749", "删除成功!"));
             this.Pager1.PageBind();
         }
     }
     Application.UnLock();
 }
예제 #19
0
 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Del")
     {
         int    id        = Convert.ToInt32(e.CommandArgument);
         string managerID = Request.QueryString["manageID"].ToString();
         BLL.CommonClass.ChangeLogs cl = new BLL.CommonClass.ChangeLogs("viewmanage", "id");
         cl.AddRecord(id);
         if (ManagerBLL.DelViewManage(id) > 0)
         {
             cl.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company25, "管理员:" + managerID, BLL.CommonClass.ENUM_USERTYPE.objecttype7);
             msg = "<script>alert('删除成功!');</script>";
         }
         PageSet();
     }
 }
예제 #20
0
        public dynamic AddManager()
        {
            string     name    = Fun.Form("name");
            int        loginId = Fun.Form("loginId", 0);
            string     headImg = "../../img/default/default-a.png";
            ManagerBLL m       = new ManagerBLL();

            if (!m.AddManager(name, headImg, loginId))
            {
                return("失败");
            }
            else
            {
                return("成功");
            }
        }
예제 #21
0
        public dynamic UpdateManager()
        {
            int        id      = Fun.Form("id", 0);
            string     name    = Fun.Form("name");
            string     headImg = Fun.Form("headImg");
            ManagerBLL m       = new ManagerBLL();

            if (id == 1 || !m.UpdateManager(id, name, headImg))
            {
                return("失败");
            }
            else
            {
                return("成功");
            }
        }
예제 #22
0
        public dynamic GetManagerList()
        {
            ManagerBLL           m       = new ManagerBLL();
            List <S_ManagerInfo> list    = m.GetManagerList();
            List <ManagerInfo>   mList   = new List <ManagerInfo>();
            ManagerInfo          manager = null;

            foreach (var item in list)
            {
                manager      = new ManagerInfo();
                manager.id   = item.mgr_id;
                manager.name = item.mgr_name.Trim();
                manager.img  = item.mgr_headimgurl;
                mList.Add(manager);
            }
            return(mList);
        }
예제 #23
0
        public List <OffreDataContract> GetAllOffres()
        {
            ManagerBLL   bll    = new ManagerBLL();
            List <Offre> offers = bll.GetOffres().ToList();

            if (offers.Count == 0)
            {
                throw new Exception("Liste d'offre vide");
            }
            List <OffreDataContract> offersDC = new List <OffreDataContract>();

            foreach (Offre offer in offers)
            {
                OffreDataContract o = new OffreDataContract(offer);
                offersDC.Add(o);
            }
            return(offersDC);
        }
예제 #24
0
        static void Clean()
        {
            ManagerBLL bll = new ManagerBLL();

            Console.WriteLine("Debut Clean");
            try
            {
                List <Task> tasks = new List <Task>();
                tasks.Add(bll.ClearBaseAsync());
                Task.WaitAll(tasks.ToArray());
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            Console.WriteLine("Fini");
        }
예제 #25
0
    private void InitPermissionTree()
    {
        string mid = HttpContext.Current.Request.QueryString["id"];
        //调用角色树图生成方法生成树图
        string    number = Session["Company"].ToString();
        Hashtable htb    = DeptRoleBLL.GetAllPermission(Session["Company"].ToString());                                          //获取指定管理员的所有权限

        this.DivPermission.InnerHtml = (new DeptRoleBLL()).ResetAllPermission(ManagerBLL.GetManage(number).RoleID, number, htb); //获取权限菜单,并生成权限树

        //如果mid不为空则判断为mid的角色是否可以被当前用户登录用户编辑
        if (mid != null && mid != "")
        {
            int id = 0;
            //检查传入参数的合法性
            try
            {
                id = int.Parse(mid);
            }
            catch (FormatException)
            {
                Response.End();
            }
            DeptRoleModel deptRoleModel = DeptRoleBLL.GetDeptRoleByRoleID(id);
            if (deptRoleModel == null)
            {
                Response.Write("<script>alert('" + BLL.Translation.Translate("004200", "当前角色已经不存在,不允许操作") + ".');window.location='DeptRolesManage.aspx'</script>");
                Response.End();
            }
            ManagerBLL manageBLL = new ManagerBLL();
            this.chkAllot.Checked = (deptRoleModel.Allot == 1);

            //查询指定角色权限信息
            htb = DeptRoleBLL.GetAllPermission(deptRoleModel.Id);
            IDictionaryEnumerator idiction = htb.GetEnumerator();
            string str_html = "";
            while (idiction.MoveNext())
            {
                str_html += "<script>getpermission('" + idiction.Key + "');</script>";
            }
            this.DivSetPer.InnerHtml = str_html;
        }
    }
예제 #26
0
        public ManagerVM()
        {
            manager = new ManagerBLL();

            Employes = new ObservableCollection <EmployeVM>();
            Offres   = new ObservableCollection <OffreVM>();

            ChargerDonnees();
            AttacherListeners();
            OffreSelectionnee = Offres.FirstOrDefault();

            SelectionnerOffre = new Commande(
                (obj) => OffreSelectionnee = (obj as OffreVM),
                (obj) => obj is OffreVM
                );

            AjouterInteresse = new Commande(
                (obj) =>
            {
                var employe = obj as EmployeVM;
                if (!OffreSelectionnee.EmployesInteresses.Contains(employe))
                {
                    OffreSelectionnee.EmployesInteresses.Add(employe);
                }
            },
                (obj) => obj is EmployeVM
                );

            RetirerInteresse = new Commande(
                (obj) =>
            {
                var employe = obj as EmployeVM;
                if (OffreSelectionnee.EmployesInteresses.Contains(employe))
                {
                    OffreSelectionnee.EmployesInteresses.Remove(employe);
                }
            },
                (obj) => obj is EmployeVM
                );
        }
        public ActionResult Analysis()
        {
            List <Analysis> lst = ManagerBLL.Manager_Analysis();

            return(View(lst));
        }
        public ActionResult Download()
        {
            List <ObjFile> data = ManagerBLL.Manager_GetAllFileToDownload();

            return(View(data));
        }
 public ActionResult CreateTag(string tagName, string description)
 {
     ManagerBLL.Manager_CreateNewTag(tagName, description);
     return(RedirectToAction("Tag", "Manager"));
 }
 public ActionResult DeleteTag(int id)
 {
     ManagerBLL.Manager_DeleteTag(id);
     return(RedirectToAction("Tag", "Manager"));
 }