Ejemplo n.º 1
0
 public FluentRecordBase AddServWorkerRequest()
 {
     //
     // DEPENDENCIES
     if (_repoWR == null)
     {
         AddRepoWorkerRequest();
     }
     if (_uow == null)
     {
         AddUOW();
     }
     _servWR = new WorkerRequestService(_repoWR, _uow);
     return(this);
 }
Ejemplo n.º 2
0
        private void worker_del_button_Click(object sender, EventArgs e)
        {
            if (workers_dataGridView.SelectedRows.Count == 0)
            {
                Common.ErrAlert("请选择一行再删除!");
                return;
            }
            WorkerListData worker = workerListData.ToList()[workers_dataGridView.SelectedRows[0].Index];

            if (null == worker)
            {
                Common.ErrAlert("加载选择的工人数据发生错误!");
                return;
            }
            if (null == WorkerProjectInfo)
            {
                Common.ErrAlert("请选择项目后再操作!");
                return;
            }
            if (MessageBox.Show(string.Format("真的要删除工人 {0} 吗?", worker.workerName), "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
            {
                return;
            }
            CommonResponseData commonResponseData = new CommonResponseData();

            WorkerRequestService.RequestDelAction(worker, loginUser, ref commonResponseData);
            if (null == commonResponseData)
            {
                Common.ErrAlert("网络或服务异常,请联系管理员!");
                return;
            }
            if (!commonResponseData.success)
            {
                Common.ErrAlert("删除失败!\n" + commonResponseData.message);
                return;
            }
            Common.SuccessAlert("删除成功!");
            LoadWorkersData(workers_projects_comboBox);
        }
Ejemplo n.º 3
0
        private void workerData_backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker backgroundWorker = sender as BackgroundWorker;

            if (backgroundWorker.CancellationPending)
            {
                e.Cancel = true;
                return;
            }

            if (null == loginUser)
            {
                e.Cancel = true;
                return;
            }

            WorkersResponse workerListResponse = new WorkersResponse();

            WorkerRequestService.Response(loginUser, WorkerProjectCode, workers_pageUserControl, ref workerListResponse);
            if (null == workerListResponse)
            {
                return;
            }
            if (null == workerListResponse.data)
            {
                return;
            }
            if (!IsHandleCreated)
            {
                return;
            }
            Invoke(new Action(() =>
            {
                WorkerListEvent(workerListResponse);
            }));
        }
Ejemplo n.º 4
0
        private void submit_button_Click(object sender, EventArgs e)
        {
            if (string.Empty.Equals(idCardNumber_textBox.Text) ||
                string.Empty.Equals(workerName_textBox.Text) ||
                string.Empty.Equals(address_textBox.Text) ||
                string.Empty.Equals(startTime_textBox.Text) ||
                string.Empty.Equals(endTime_textBox.Text) ||
                string.Empty.Equals(is_sue_textBox.Text) ||
                string.Empty.Equals(nationName_textBox.Text) ||
                null == idcardNumber_pictureBox.BackgroundImage
                )
            {
                Common.ErrAlert("请先读取二代身份证后再提交!");
                return;
            }
            if (null == picbPreview.Image)
            {
                Common.ErrAlert("请先抓拍人员现场照后再提交!");
                return;
            }
            ImageBase64 = Common.ImageToBase64(picbPreview.Image);
            CommonResponseData   commonResponse       = new CommonResponseData();
            WorkerAddRequestData workerAddRequestData = new WorkerAddRequestData
            {
                idCardPhoto           = Common.ImageToBase64(idcardNumber_pictureBox.BackgroundImage),
                idCardNumber          = idCardNumber_textBox.Text.Trim(),
                ocvFace               = ImageBase64,
                idCardType            = 1,
                workerName            = workerName_textBox.Text.Trim(),
                nation                = Common.GetNationNum(nations, nationName_textBox.Text.Trim()).num.ToString(),
                address               = address_textBox.Text.Trim(),
                isSue                 = is_sue_textBox.Text.Trim(),
                startTime             = startTime_textBox.Text.Trim(),
                endTime               = endTime_textBox.Text.Trim().Equals("长期") ? "99991231" : endTime_textBox.Text.Trim(),
                projectCode           = workerProjectInfo.projectCode,
                teamSysNo             = team_comboBox.SelectedValue.ToString(),
                workTypeCode          = workerType_comboBox.SelectedValue.ToString(),
                gender                = Common.GetGenderFromIDCardNumber(idCardNumber_textBox.Text.Trim()).Equals("男") ? 0 : 1,
                birthday              = Common.GetBirthdayFromIDCardNumber(idCardNumber_textBox.Text.Trim()),
                loginOrganizationCode = loginUser.OrganizationCode//新增的字段
            };

            WorkerRequestService.RequestAddAction(workerAddRequestData, loginUser, ref commonResponse);
            if (null != commonResponse)
            {
                if (commonResponse.success)
                {
                    Common.SuccessAlert("操作成功!");
                }
                else
                {
                    Common.ErrAlert("操作失败!\n" + commonResponse.message);
                }
                DialogResult = DialogResult.OK;
            }
            else
            {
                Common.SuccessAlert("操作异常,请联系管理员!");
                DialogResult = DialogResult.None;
            }
        }