Esempio n. 1
0
        private void GetDatas()
        {   // 작업장에 할당된 작업자 목록 가져오기
            Emp_Wc_AllocationService service = new Emp_Wc_AllocationService();
            List <WorkerVO>          list    = service.GetAllocatedWorker(GlobalUsage.WcCode);

            // 할당된 작업자
            dgvAllocatedWorker.DataSource = list;
            // 할당대상 작업자
            dgvAllocatableWorker.DataSource = service.GetAllocatableWorker(GlobalUsage.WcCode);

            txtWorkerCnt.TextBoxText = list.Count.ToString();
        }
Esempio n. 2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            UserInfo_Service uservice  = new UserInfo_Service();
            UserInfoVO       logininfo = uservice.GetLoginInfo(txtID.Text, txtPwd.Text);

            if (logininfo == null)
            {
                MessageBox.Show("아이디 비밀번호를 확인해주세요");
                return;
            }
            Emp_Wc_AllocationService service = new Emp_Wc_AllocationService();

            if ((!service.IsAllocated(logininfo.User_ID, GlobalUsage.WcCode)) && !logininfo.User_ID.Equals("master"))
            {
                MessageBox.Show("할당되지 않은 작업자입니다.");
                return;
            }

            GlobalUsage.UserID   = txtID.Text;
            GlobalUsage.UserName = logininfo.User_Name;

            // 세션 set
            Random r = new Random();
            // 신규비밀번호 = 랜덤8자리(영문대문자 + 숫자)
            StringBuilder session = new StringBuilder();

            for (int i = 0; i < 12; i++)
            {
                int rndVal = r.Next(0, 36);
                if (rndVal < 10) //숫자
                {
                    session.Append(rndVal);
                }
                else
                {
                    session.Append((char)(rndVal + 55)); //65~90 : 영어대문자
                }
            }

            Login_History loginhistory = new Login_History()
            {
                Session_ID    = session.ToString(),
                User_ID       = logininfo.User_ID,
                Login_Day     = Convert.ToDateTime(DateTime.Now.ToShortDateString()),
                Login_Date    = DateTime.Now,
                Login_Success = "Y"
            };

            uservice.InsertLogin_History(loginhistory);
            this.DialogResult = DialogResult.OK;
        }