コード例 #1
0
        private void button1_Click(object sender, EventArgs e)              //添加员工信息
        {
            if (this.txtStaffName.Text == "" || this.cbbStaffSex.Text == "" || this.cbbStaffDept.Text == "")
            {
                MessageBox.Show("请输入除员工编码外的所有信息", "提示");
                return;
            }

            string txtStaffName = this.txtStaffName.Text;
            string cbbStaffSex  = this.cbbStaffSex.Text;
            string cbbStaffDept = this.cbbStaffDept.Text;
            string txtStaffCode = this.txtStaffCode.Text;

            StaffBLL staffbll = new StaffBLL();

            if (staffbll.addStaff(txtStaffName, cbbStaffSex, cbbStaffDept, txtStaffCode))
            {
                MessageBox.Show("保存成功!");
            }


            staffs = staffbll.getAllStaff();
            staffDataGrid.DataSource = staffs;


            this.txtStaffName.Clear();
            this.cbbStaffDept.Text = "";
            this.cbbStaffSex.Text  = "";
            this.txtStaffCode.Clear();
        }
コード例 #2
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            if (txtSName.Text.Length <= 0)
            {
                lblSNameMsg.Text = "Name cannot be blank";
            }

            if (txtSName.Text.Length > 0)
            {
                UserAccount user    = (UserAccount)Session["UserAccountObj"];
                int         staffId = user.UserId;

                StaffBLL staffBLL = new StaffBLL();
                int      result   = staffBLL.DoUpdateStaff(staffId, txtSName.Text);

                if (result > 0)
                {
                    alertSuccess.Visible = true;
                }

                else
                {
                    alertFailure.Visible = true;
                    lblAlertMsg.Text     = "Error in updating staff profile";
                }
            }
        }
コード例 #3
0
ファイル: Statistic.cs プロジェクト: huyquyentran/tour
        private void LoadStaff(DateTime?StartDate = null, DateTime?EndDate = null)
        {
            try
            {
                if (InvokeRequired)
                {
                    BeginInvoke(new Action(() =>
                    {
                        dgvStaff.ShowLoading(true);
                    }));
                }

                var staffStatistics = StaffBLL.GetTourCountOfStaffs(StartDate, EndDate);

                if (InvokeRequired)
                {
                    BeginInvoke(new Action(() =>
                    {
                        dgvStaff.ShowLoading(false);
                        dgvStaff.DataSource = staffStatistics;

                        dgvStaff.Columns["StaffId"].HeaderText   = "Mã nhân viên";
                        dgvStaff.Columns["StaffName"].HeaderText = "Tên nhân viên";
                        dgvStaff.Columns["TourCount"].HeaderText = "Số lần đi khách";
                    }));
                }
            }
            catch (Exception ex)
            {
                GUIExtensionMethod.HandleError(ex);
            }
        }
コード例 #4
0
        private void departmentTreeview1_DragDrop(object sender, DragEventArgs e)
        {
            Point    p    = departmentTreeview1.PointToClient(new Point(e.X, e.Y));
            TreeNode node = departmentTreeview1.GetNodeAt(p);

            if (node != null && (node.Tag == null || node.Tag is Department))
            {
                string[] s = e.Data.GetFormats();
                if (s.Length > 0)
                {
                    object o = e.Data.GetData(s[0]);
                    if (o is List <Staff> )
                    {
                        Department   dept  = node.Tag as Department;
                        List <Staff> staff = o as List <Staff>;
                        if (staff != null && staff.Count > 0)
                        {
                            StaffBLL bll = new StaffBLL(AppSettings.CurrentSetting.ConnectUri);
                            foreach (Staff st in staff)
                            {
                                st.DepartmentID = dept.ID;
                                st.Department   = dept;
                                bll.Update(st);
                            }
                        }
                    }
                }
                SelectNode(node);
            }
        }
コード例 #5
0
        private void bind()
        {
            string id = Request.QueryString["id"].ToString();


            StaffBLL staffBLL = new StaffBLL();

            staff = staffBLL.get(id);

            UserBLL userBLL = new UserBLL();
            User    user    = userBLL.get(staff.UserId);

            TextBox_username.Text = user.UserName;
            TextBox_name.Text     = staff.Name;
            if (staff.Gender.Equals("女"))
            {
                RadioButton_female.Checked = true;
            }
            PageUtil.bindDropDownList(DropDownList_yearPart1, staff.Birth[0].ToString());
            PageUtil.bindDropDownList(DropDownList_yearPart2, staff.Birth[1].ToString());
            PageUtil.bindDropDownList(DropDownList_yearPart3, staff.Birth[2].ToString());
            PageUtil.bindDropDownList(DropDownList_yearPart4, staff.Birth[3].ToString());
            PageUtil.bindDropDownList(DropDownList_month, staff.Birth.Substring(4, 2));
            TextBox_phone.Text = staff.Phone;
            PageUtil.bindDropDownList(DropDownList_type, staff.Type);
        }
コード例 #6
0
        protected void ImageButton_submit_Click(object sender, ImageClickEventArgs e)
        {
            if (check())
            {
                StaffBLL staffBLL = new StaffBLL();
                UserBLL  userBLL  = new UserBLL();

                string username = TextBox_username.Text.Trim();
                string name     = TextBox_name.Text.Trim();
                string gender   = RadioButton_male.Checked ? "男" : "女";
                string birth    = DropDownList_yearPart1.SelectedValue + DropDownList_yearPart2.SelectedValue + DropDownList_yearPart3.SelectedValue + DropDownList_yearPart4.SelectedValue;
                birth += DropDownList_month.SelectedValue;
                string phone = TextBox_phone.Text.Trim();
                string type  = DropDownList_type.SelectedValue;

                User user = userBLL.get(staff.UserId);
                if (!user.UserName.Equals(username) || !staff.Type.Equals(type))
                {
                    user.UserName = username;
                    user.Type     = type.Equals("考勤维护员") ? "6" : "5";
                    userBLL.update(user);
                }

                staff.Name   = name;
                staff.Gender = gender;
                staff.Birth  = birth;
                staff.Phone  = phone;
                staff.Type   = type;
                staffBLL.update(staff);

                Response.Write("<script>alert('修改成功!');location.href='showStaffs.aspx';</script>");
            }
        }
コード例 #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            sql = "select * from PmStaff where 1=1";

            if (txtStaffName.Text == "" && cbbStaffSex.Text == "")
            {
                MessageBox.Show("请选择查询条件", "提示");
                return;
            }

            //if (txtStaffID.Text != "")
            //{
            //    sql = sql + "and StaffID ='" + txtStaffID.Text + "'";
            //}
            if (txtStaffName.Text != "")
            {
                sql = sql + " and StaffName like'%" + txtStaffName.Text + "%'";
            }
            if (cbbStaffSex.Text != "")
            {
                sql = sql + " and StaffSex ='" + cbbStaffSex.Text + "'";
            }

            StaffBLL staffbll = new StaffBLL();

            staffs = staffbll.selByCondition(sql);
            staffDataGrid.DataSource = staffs;

            //this.txtStaffID.Clear();
            this.txtStaffName.Clear();
            this.cbbStaffSex.Text = "";
        }
コード例 #8
0
        private void StaffQueryForm_Load(object sender, EventArgs e)        //加载窗体时显示所有员工
        {
            this.Width  = Fuctions.winFormWidth;
            this.Height = Fuctions.winFormHeight;

            StaffBLL staffbll = new StaffBLL();

            staffs = staffbll.getAllStaff();
            staffDataGrid.DataSource = staffs;

            staffDataGrid.ReadOnly = true;
            staffDataGrid.RowHeadersWidthSizeMode     = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
            staffDataGrid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            staffDataGrid.Width    = Fuctions.dataGridViewWidth;
            staffDataGrid.Height   = Fuctions.dataGridViewHeight;
            staffDataGrid.Location = new Point(Fuctions.dataGridViewLocationX, Fuctions.dataGridViewLocationY);



            staffDataGrid.Columns[0].HeaderText = "主键";   //修改显示的列名
            staffDataGrid.Columns[0].Visible    = false;
            staffDataGrid.Columns[1].HeaderText = "员工";
            staffDataGrid.Columns[2].HeaderText = "性别";
            staffDataGrid.Columns[3].HeaderText = "权限";
            staffDataGrid.Columns[3].Visible    = false;
            staffDataGrid.Columns[4].HeaderText = "密码";
            staffDataGrid.Columns[4].Visible    = false;
            staffDataGrid.Columns[5].HeaderText = "编号";

            Fuctions.AutoSize(staffDataGrid);
        }
コード例 #9
0
 public StaffView()
 {
     InitializeComponent();
     bll = new StaffBLL();
     LoadView();
     LoadComboBox();
 }
コード例 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["isLogin"] == null)
            {
                Response.Redirect("Login.aspx");
            }

            UserAccount user = (UserAccount)Session["UserAccountObj"];

            if (!user.UserRole.Equals("Staff"))
            {
                lblAccessRight.Text = "YOU DO NOT HAVE STAFF RIGHTS TO ACCESS THIS FUNCTION";
                btn_back.Visible    = false;
            }

            else
            {
                StaffBLL staffbll = new StaffBLL();
                Staff    staff    = staffbll.DoRetrieveStaffByID(user.UserId);

                DataTable dt        = new DataTable();
                ReviewBLL reviewBLL = new ReviewBLL();
                int       restId    = Convert.ToInt32(staff.RestId);
                dt = reviewBLL.DoRetrieveRestaurantRating(restId);

                if (dt != null)
                {
                    gv_restaurants.DataSource = dt;
                    gv_restaurants.DataBind();
                }
            }
        }
コード例 #11
0
        protected void lnk_ViewStaff_Click(object sender, EventArgs e)
        {
            int           restId     = Convert.ToInt32((sender as LinkButton).CommandArgument);
            RestaurantBLL rBLL       = new RestaurantBLL();
            Restaurant    restaurant = rBLL.DoRetrieveRestaurantByRestID(restId);

            StaffBLL  staffBLL = new StaffBLL();
            DataTable dt       = new DataTable();

            panelViewStaff.Visible = true;

            lblRestName.Text = restaurant.RestName;
            dt = staffBLL.DoRetrieveStaffByRestID(restId);

            if (dt != null)
            {
                gv_viewStaff.DataSource = dt;
                gv_viewStaff.DataBind();
            }

            else
            {
                alertFailure.Visible  = true;
                lblErrorRetrieve.Text = "Error in retrieving staff list";
            }
        }
コード例 #12
0
 /// <summary>
 /// Khi click vao Create Schedule
 /// </summary>
 /// <param name="dto"></param>
 /// <param name="oDto"></param>
 public ScheduleDetailOfBus(BusDTO dto, RouteDTO rDto)
 {
     InitializeComponent();
     main_bus_dto   = dto;
     main_route_dto = rDto;
     main_staff_bll = new StaffBLL();
     bus_bll        = new BusBLL();
     staff_form     = null;
 }
コード例 #13
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                LoginAgentUser loginAgentUser = new LoginAgentUser(context, "UKeyActivation");
                AgentRoleBLL   agentRoleBLL   = new AgentRoleBLL(context, loginAgentUser);
                StaffBLL       staffBll       = new StaffBLL(context, loginAgentUser);
                if (!loginAgentUser.Pass)//权限验证
                {
                    return;
                }
                //获取用户登录的角色类型 0为 代理商 1 为员工
                string roleType = agentRoleBLL.GetRoleType(loginAgentUser.RoleIds);
                string agentId  = "";
                string siteId   = context.Request["siteId"];
                if (roleType == "0")
                {
                    agentId = loginAgentUser.UserId;
                }
                if (roleType != "0")
                {
                    siteId = staffBll.Get(loginAgentUser.UserId).siteId;
                }

                //加载DataGrid
                if (context.Request["action"] == "gridLoad")
                {
                    UKeyBLL bll    = new UKeyBLL(context, loginAgentUser);
                    int     page   = int.Parse(context.Request["page"]);
                    int     rows   = int.Parse(context.Request["rows"]);
                    string  uKeyId = context.Request["uKeyId"];
                    string  status = context.Request["status"];
                    bll.LoadGrid(page, rows, uKeyId, status, siteId, "", agentId);
                    return;
                }
                //加载快开厅
                if (context.Request["action"] == "ddlStatusListLoad")
                {
                    UKeyBLL bll = new UKeyBLL(context, loginAgentUser);
                    bll.AgentUKeyStatusCombobox();
                    return;
                }

                //激活
                if (context.Request["action"] == "activation")
                {
                    UKeyBLL bll    = new UKeyBLL(context, loginAgentUser);
                    string  ukeyId = context.Request["ukeyId"];//加密狗编号
                    bll.Activation(ukeyId);
                    return;
                }
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
        }
コード例 #14
0
        private void LoadStaffsNotInGroup(int groupId)
        {
            //Back to main thread update UI
            if (InvokeRequired)
            {
                BeginInvoke(new Action(() =>
                {
                    dgvGroupStaffListAll.ShowLoading(true);
                }));
            }

            //Fill DataTable
            var staffs = StaffBLL.ListStaffsNotInGroup(groupId);
            var data   = new BindingList <StaffBinding>();


            foreach (var staff in staffs)
            {
                data.Add(new StaffBinding
                {
                    Id                   = staff.Id,
                    Name                 = staff.Name,
                    DoB                  = staff.DoB,
                    PhoneNumber          = staff.PhoneNumber,
                    IdentificationNumber = staff.IdentificationNumber,
                    Gender               = staff.Gender,
                    Address              = staff.Address,
                });
            }

            //Back to main thread update UI
            if (InvokeRequired)
            {
                BeginInvoke(new Action(() =>
                {
                    //Clear loading column
                    dgvGroupStaffListAll.Columns.Clear();

                    dgvGroupStaffListAll.Columns.Add("Id", "Mã");
                    dgvGroupStaffListAll.Columns.Add("Name", "Tên");
                    dgvGroupStaffListAll.Columns.Add("DoB", "Ngày sinh");
                    dgvGroupStaffListAll.Columns.Add("PhoneNumber", "SĐT");
                    dgvGroupStaffListAll.Columns.Add("IdentificationNumber", "CMND");
                    dgvGroupStaffListAll.Columns.Add("Gender", "Giới tính");
                    dgvGroupStaffListAll.Columns.Add("Address", "Địa chỉ");

                    dgvGroupStaffListAll.Columns["DoB"].DefaultCellStyle.Format = "dd/MM/yyyy";

                    foreach (DataGridViewColumn column in dgvGroupStaffListAll.Columns)
                    {
                        column.DataPropertyName = column.Name;
                    }

                    dgvGroupStaffListAll.DataSource = data;
                }));
            }
        }
コード例 #15
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                LoginAgentUser loginAgentUser = new LoginAgentUser(context, "ClientAccDetail");
                AgentRoleBLL   agentRoleBLL   = new AgentRoleBLL(context, loginAgentUser);
                StaffBLL       staffBll       = new StaffBLL(context, loginAgentUser);
                if (!loginAgentUser.Pass)//权限验证
                {
                    return;
                }
                //获取用户登录的角色类型 0为 代理商 1 为员工
                string roleType = agentRoleBLL.GetRoleType(loginAgentUser.RoleIds);
                string agentId  = "";
                string siteId   = context.Request["siteId"];
                if (roleType == "0")
                {
                    agentId = loginAgentUser.UserId;
                }
                if (roleType != "0")
                {
                    siteId = staffBll.Get(loginAgentUser.UserId).siteId;
                }
                //加载DataGrid
                if (context.Request["action"] == "gridLoad")
                {
                    ClientAccDetailBLL bll = new ClientAccDetailBLL(context, loginAgentUser);
                    int    page            = int.Parse(context.Request["page"]);
                    int    rows            = int.Parse(context.Request["rows"]);
                    string clientId        = context.Request["clientId"];
                    string cardId          = context.Request["cardId"];
                    string clientName      = context.Request["clientName"];
                    bll.LoadGrid(page, rows, clientId, agentId, siteId, cardId, clientName);
                    return;
                }

                //加载信息
                if (context.Request["action"] == "load")
                {
                    ClientAccDetailBLL bll = new ClientAccDetailBLL(context, loginAgentUser);
                    long flowId            = long.Parse(context.Request["flowId"]);//编号
                    bll.Load(flowId);
                    return;
                }
                if (context.Request["action"] == "siteListLoad")
                {
                    ClientBLL bll = new ClientBLL(context, loginAgentUser);
                    bll.SiteCombobox(loginAgentUser.UserId, roleType);
                }
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
        }
コード例 #16
0
        protected void Button_submit_Click(object sender, EventArgs e)
        {
            if (!checkEmpty())
            {
                string userName = TextBox_userName.Text.Trim();
                string password = TextBox_password.Text.Trim();

                StaffBLL staffBLL = new StaffBLL();
                UserBLL  userBLL  = new UserBLL();
                User     user     = userBLL.getByUsername(userName);
                if (user != null)
                {
                    //取得加密后的密码
                    string encryptPWD = EncryptUtil.MD5Encrypt(password);

                    if (!user.Password.Equals(encryptPWD))
                    {
                        //密码不匹配的情况

                        checkPassword.ErrorMessage = "密码输入错误!";
                        checkPassword.IsValid      = false;
                    }
                    else
                    {
                        Staff staff = staffBLL.getByUserId(user.Id);
                        if (staff != null && staff.Type.Equals("超级管理员"))
                        {
                            //用户检查通过的情况
                            AttendanceBLL  attendBLL = new AttendanceBLL();
                            CourseTableBLL ctBLL     = new CourseTableBLL();

                            string    filter = "semester='" + GlobalVars.SEMESTER + "'";
                            DataTable dt     = PageUtil.getProcessedDataTable(ctBLL.getAll().Tables[0], filter, null, false);

                            foreach (DataRow dr in dt.Rows)
                            {
                                attendBLL.deleteByCourseTableId(dr["ID"].ToString());
                            }

                            Response.Write("<script>alert('考勤初始化成功!');location.href='../mainPages/welcome.aspx';</script>");
                        }
                        else
                        {
                            checkUsername.ErrorMessage = "该用户没有权限!";
                            checkUsername.IsValid      = false;
                        }
                    }
                }
                else
                {
                    checkUsername.ErrorMessage = "账号不存在!";
                    checkUsername.IsValid      = false;
                }
            }
        }
コード例 #17
0
        private void button2_Click(object sender, EventArgs e)                           //显示所有员工
        {
            StaffBLL staffbll = new StaffBLL();

            staffs = staffbll.getAllStaff();
            staffDataGrid.DataSource = staffs;

            //this.txtStaffID.Clear();
            this.txtStaffName.Clear();
            this.cbbStaffSex.Text = "";
        }
コード例 #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["isLogin"] == null)
            {
                Response.Redirect("Login.aspx");
            }

            alertSuccess.Visible        = false;
            alertFailure.Visible        = false;
            panelChangePassword.Visible = false;
            panelWorkplace.Visible      = false;

            if (!IsPostBack)
            {
                UserAccount user = (UserAccount)Session["UserAccountObj"];
                txtSUsername.Text = user.Username;

                StaffBLL staffBLL = new StaffBLL();
                Staff    staff    = staffBLL.DoRetrieveStaffByID(user.UserId);

                if (staff != null)
                {
                    txtSName.Text = staff.StaffName;
                    if (user.UserRole.Equals("Staff"))
                    {
                        RestaurantBLL restaurantBLL = new RestaurantBLL();
                        Restaurant    restaurant    = restaurantBLL.DoRetrieveRestaurantByRestID(staff.RestId);
                        panelWorkplace.Visible = true;

                        if (restaurant != null)
                        {
                            txtRName.Text    = restaurant.RestName;
                            txtRAddress.Text = restaurant.RestAddress;
                            txtRArea.Text    = restaurant.RestArea;
                        }

                        else
                        {
                            alertFailure.Visible = true;
                            lblAlertMsg.Text     = "Unable to retrieve staff profile";
                        }
                    }
                }

                else
                {
                    txtSName.Text             = "admin";
                    txtSName.Enabled          = false;
                    btnChangePassword.Enabled = false;
                    btnDeactivate.Enabled     = false;
                    btnUpdate.Enabled         = false;
                }
            }
        }
コード例 #19
0
 /// <summary>
 /// Khi cell click dgvSchdule (Ben BusView)
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public ScheduleDetailOfBus(BusDTO dto, RouteDTO rDto, BusStationGridView bDto, StaffDTO casher, StaffDTO driver)
 {
     InitializeComponent();
     main_bus_dto      = dto;
     main_route_dto    = rDto;
     main_schedule_dto = bDto;
     main_driver_dto   = driver;
     main_casher_dto   = casher;
     main_staff_bll    = new StaffBLL();
     bus_bll           = new BusBLL();
     staff_form        = null;
 }
コード例 #20
0
        private void StaffInfoForm_Load(object sender, EventArgs e)
        {
            this.Width  = Fuctions.winFormWidth;
            this.Height = Fuctions.winFormHeight;

            StaffBLL staffbll = new StaffBLL();

            staffs = staffbll.getAllStaff();
            staffDataGrid.DataSource = staffs;                              //将数据库中的数据提到列表中,再通过 DataGrid控件显示;

            staffDataGrid.ReadOnly = true;
            staffDataGrid.RowHeadersWidthSizeMode     = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
            staffDataGrid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            staffDataGrid.Width    = Fuctions.dataGridViewWidth;
            staffDataGrid.Height   = Fuctions.dataGridViewHeight;
            staffDataGrid.Location = new Point(Fuctions.dataGridViewLocationX, Fuctions.dataGridViewLocationY);


            staffDataGrid.Columns[0].HeaderText = "主键";   //修改显示的列名
            staffDataGrid.Columns[0].Visible    = false;
            staffDataGrid.Columns[1].HeaderText = "员工";
            staffDataGrid.Columns[2].HeaderText = "性别";
            staffDataGrid.Columns[3].HeaderText = "权限";
            staffDataGrid.Columns[4].HeaderText = "密码";
            staffDataGrid.Columns[4].Visible    = false;
            staffDataGrid.Columns[5].HeaderText = "编号";

            Fuctions.AutoSize(staffDataGrid);


            DataTable  dt  = new DataTable();                               //表中cbb权限内容加载
            DataColumn dc1 = new DataColumn("id");
            DataColumn dc2 = new DataColumn("name");

            dt.Columns.Add(dc1);
            dt.Columns.Add(dc2);
            DataRow dr1 = dt.NewRow();

            dr1["id"]   = "1";
            dr1["name"] = "管理员";
            DataRow dr2 = dt.NewRow();

            dr2["id"]   = "2";
            dr2["name"] = "员工";
            dt.Rows.Add(dr1);
            dt.Rows.Add(dr2);

            cbbStaffDept.DisplayMember = "name";
            cbbStaffDept.ValueMember   = "id";
            cbbStaffDept.DataSource    = dt;
            cbbStaffDept.Text          = "";
        }
コード例 #21
0
        /// <summary>
        /// 查看已删除的员工档案
        /// </summary>
        /// <returns>返回列表视图</returns>
        public ActionResult StaffViewDeleted()
        {
            IStaffBLL bLL = new StaffBLL();

            IOrgBLL orgBLL = new OrgBLL();

            IOccupationBLL occupationBLL = new OccupationBLL();

            List <Staff> staffList = bLL.GetAllStaffDeleted();

            List <Models.Staff> staffListView = new List <Models.Staff>();

            if (staffList != null)
            {
                foreach (var staff in staffList)
                {
                    Models.Staff tempStaff = new Models.Staff
                    {
                        Id = staff.Id,
                        StaffFileNumber = staff.StaffFileNumber,
                        StaffName       = staff.StaffName,
                        FileState       = staff.FileState,
                        IsDel           = staff.IsDel
                    };
                    ThirdOrg  thirdOrg  = orgBLL.GetThirdOrgById(staff.ThirdOrgId);
                    SecondOrg secondOrg = orgBLL.GetSecondOrgById(thirdOrg.ParentOrgId);
                    FirstOrg  firstOrg  = orgBLL.GetFirstOrgById(secondOrg.ParentOrgId);

                    tempStaff.FirstOrg = new Models.FirstOrg {
                        Id = firstOrg.Id, OrgLevel = firstOrg.OrgLevel, OrgName = firstOrg.OrgName
                    };
                    tempStaff.SecondeOrg = new Models.SecondeOrg {
                        Id = secondOrg.Id, OrgName = secondOrg.OrgName, OrgLevel = secondOrg.OrgLevel, ParentOrg = tempStaff.FirstOrg
                    };
                    tempStaff.ThirdOrg = new Models.ThirdOrg {
                        Id = thirdOrg.Id, ParentOrg = tempStaff.SecondeOrg, OrgLevel = thirdOrg.OrgLevel, OrgName = thirdOrg.OrgName
                    };

                    OccupationName occupationName = occupationBLL.GetOccupationNameById(staff.OccId);

                    tempStaff.OccupationName = new Models.OccupationName {
                        Id = occupationName.Id, Name = occupationName.Name
                    };

                    staffListView.Add(tempStaff);
                }
            }

            ViewData["staffListView"] = staffListView;

            return(View());
        }
コード例 #22
0
ファイル: Forget.aspx.cs プロジェクト: Yangshen888/JDGL
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            string     phone = TextBox1.Text;
            StaffModel model = StaffBLL.GetStaffPwd(phone);

            if (model.UserPwd == null)
            {
                Label1.Visible = true;
            }
            else
            {
                Response.Write("<script>alert('您的密码为:" + model.UserPwd + "')</script>");
            }
        }
コード例 #23
0
        /// <summary>
        /// 逻辑删除员工档案
        /// </summary>
        /// <param name="id">主键id</param>
        /// <returns>设置提示信息并重定向</returns>
        public ActionResult DeleteStaff(string id)
        {
            IStaffBLL staffBLL = new StaffBLL();

            if (staffBLL.LoginDeleteStaff(Convert.ToInt32(id)))
            {
                TempData["info"] = "删除成功";
                return(Redirect("/StaffManage/StaffView"));
            }
            else
            {
                TempData["error"] = "删除失败";
                return(Redirect("/StaffManage/StaffView"));
            }
        }
コード例 #24
0
        /// <summary>
        /// 逻辑恢复员工档案
        /// </summary>
        /// <param name="id">档案主键id</param>
        /// <returns>设置提示信息并重定向</returns>
        public ActionResult StaffReturn(string id)
        {
            IStaffBLL bLL = new StaffBLL();

            if (bLL.ReturnStaff(Convert.ToInt32(id)))
            {
                TempData["info"] = "还原成功";
                return(Redirect("/StaffManage/StaffViewDeleted"));
            }
            else
            {
                TempData["error"] = "还原失败";
                return(Redirect("/StaffManage/StaffViewDeleted"));
            }
        }
コード例 #25
0
ファイル: Staff.aspx.cs プロジェクト: thanhgianga303/Todolist
        protected void Insert_Click(object sender, EventArgs e)
        {
            var name     = tbName.Text.Trim();
            var email    = tbEmail.Text.Trim();
            var password = tbPassword.Text.Trim();
            var phone    = tbPhone.Text.Trim();
            var role     = tbRole.Text.Trim();

            Staff    nhanVien = new Staff(name, email, password, phone, role);
            StaffBLL nvBLL    = new StaffBLL();

            nvBLL.Insert(nhanVien);

            bind();
        }
コード例 #26
0
 private void frmSale_Load(object sender, EventArgs e)
 {
     orderBLL       = new OrderBLL();
     orderDetailBLL = new OrderDetailBLL();
     customerBLL    = new CustomerBLL();
     accesoryBLL    = new AccesoryBLL();
     producerBLL    = new ProducerBLL();
     staffBLL       = new StaffBLL();
     categoryBLL    = new CategoryBLL();
     dgv_Accessories.Columns.Add("STT", "STT");
     CreateComboBox();
     //bindingSource.DataSource = accesoryBLL.GetAccessoriesByFilter(0, "CAC", "");
     bindingSource.DataSource = accesoryBLL.GetAllAccessories();
     CreateDataGridViewAccessory(bindingSource);
     CreateDataGridViewCart();
 }
コード例 #27
0
 public frmStaffManager()
 {
     InitializeComponent();
     Custom_Theme();
     staffbll  = new StaffBLL();
     roleTypes = new List <string>()
     {
         "Quản lý", "Nhân viên thủ kho", "Nhân viên bán hàng"
     };
     cbx_Role.DataSource        = roleTypes;
     dtp_BirthDate.Format       = DateTimePickerFormat.Custom;
     bindingSource              = new BindingSource();
     dtp_BirthDate.CustomFormat = "dd/MM/yyyy";
     bindingSource.DataSource   = staffbll.GetAllStaffDto();
     CreateDataGridView();
 }
コード例 #28
0
        protected override List <object> GetDataSource()
        {
            StaffBLL bll = new StaffBLL(AppSettings.Current.ConnStr);

            if (SearchCondition == null)
            {
                _Staffs = bll.GetItems(null).QueryObjects;
            }
            else
            {
                _Staffs = bll.GetItems(SearchCondition).QueryObjects;
            }
            List <object> records = FilterData();

            return(records);
        }
コード例 #29
0
        protected override bool DeletingItem(object item)
        {
            Staff         c   = item as Staff;
            StaffBLL      bll = new StaffBLL(AppSettings.Current.ConnStr);
            CommandResult ret = bll.Delete(c);

            if (ret.Result != ResultCode.Successful)
            {
                MessageBox.Show(ret.Message);
            }
            else
            {
                _Staffs.Remove(c);
            }
            return(ret.Result == ResultCode.Successful);
        }
コード例 #30
0
        public ActionResult Create(Staff.BLDAL.DTO.Staff model)
        {
            if (ModelState.IsValid)
            {
                if (StaffBLL.Staff_Insert(model))
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    return(View(model));
                }
            }

            return(View(model));
        }