Exemplo n.º 1
0
        /// <summary>
        ///点击导入,进行保存
        /// </summary>
        private void Save()
        {
            if (listOrgInfo == null || listOrgInfo.Count() == 0)
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), "没有信息可以导入",
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                return;
            }
            bool flag = true;

            listOrgInfo.ForEach(it =>
            {
                if (!string.IsNullOrWhiteSpace(it.ErrorMsg))
                {
                    flag = false;
                }
            });
            if (!flag)
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), "导入数据存在错误,请参照表格后面的提示信息进行修改",
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                return;
            }
            string        strMsg = string.Empty, Result = string.Empty;
            string        companyID = (acbCompanyName.SelectedItem as T_HR_COMPANY).COMPANYID;
            ComfirmWindow com       = new ComfirmWindow();

            com.OnSelectionBoxClosed += (objcom, result) =>
            {
                RefreshUI(RefreshedTypes.ShowProgressBar);
                client.AddBatchOrgInfoAsync(listOrgInfo, companyID, strMsg);
            };
            com.SelectionBox("导入确认", "是否确认要导入部门岗位信息", ComfirmWindow.titlename, Result);
        }