Beispiel #1
0
        private void BindData()
        {
            isRefreshFlag = true;

            //获取进程表数据
            List <EapProcess> list = Bll.GetBll().GetProcessStatus();

            if (list == null || list.Count == 0)
            {
                return;
            }

            //系统时间(数据库DB时间)
            lblSystemTime.Text = list[0].DBTIME.ToString();

            dgv.DataSource = list;

            isRefreshFlag = false;
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            EapValueList edit_entity = GetEditEntity();

            if (edit_entity == null)
            {
                return;
            }

            if (em == EditMode.Add)
            {
                string ret_add = Bll.GetBll().AddValueList(edit_entity);
                if (ret_add != string.Empty)
                {
                    if (ret_add.Split(':')[0] == "ORA-00001")
                    {
                        Func.ShowMessage(MessageType.Error, "数据添加失败,原因:值列表ID[" + edit_entity.VLIST_ID + "]已经存在");
                        return;
                    }

                    Func.ShowMessage(MessageType.Error, "数据添加失败,原因[" + ret_add + "]");
                    return;
                }
                //写日志
                Log.Write(MessageType.Information, "添加值列表数据成功,值列表ID[" + edit_entity.VLIST_ID + "]", Config.GetConfig().user.USER_ID);
                Func.ShowMessage(MessageType.Information, "数据添加成功!");
                this.Close();
            }
            else if (em == EditMode.Edit)
            {
                string ret_edit = Bll.GetBll().ModifyValueList(edit_entity);
                if (ret_edit != string.Empty)
                {
                    Func.ShowMessage(MessageType.Error, "数据修改失败,原因[" + ret_edit + "]");
                    return;
                }
                //写日志
                Log.Write(MessageType.Information, "修改值列表数据成功,值列表ID[" + edit_entity.VLIST_ID + "]", Config.GetConfig().user.USER_ID);
                Func.ShowMessage(MessageType.Information, "数据修改成功!");
                this.Close();
            }
        }
        private void btnResetPwd_Click(object sender, EventArgs e)
        {
            EapUser reset_pwd = new EapUser();

            reset_pwd.USER_ID = txtUserID.Text.Trim();
            reset_pwd.PWD     = Func.EncryptString("1", Config.GetConfig().DB_KEY);

            string ret = Bll.GetBll().UpdatePwd(reset_pwd);

            if (ret != string.Empty)
            {
                string msg = "重置密码失败,用户ID[" + reset_pwd.USER_ID + "],原因[" + ret + "]";
                Func.ShowMessage(MessageType.Error, msg);
                Log.Write(MessageType.Error, msg, Eap.Config.GetConfig().user.USER_ID);
                return;
            }

            Func.ShowMessage(MessageType.Information, "重置密码成功,用户ID[" + reset_pwd.USER_ID + "]");
            Log.Write(MessageType.Information, "重置密码成功,用户ID[" + reset_pwd.USER_ID + "]", Eap.Config.GetConfig().user.USER_ID);
        }
        /// <summary>
        /// 绑定该用户生产线权限
        /// </summary>
        private void BindTrimLine()
        {
            List <EapUserTrimLine> list_trim_line = Bll.GetBll().GetLineAuthoritybyUser(user.USER_ID);

            if (list_trim_line == null || list_trim_line.Count == 0)
            {
                return;
            }

            foreach (EapUserTrimLine sub in list_trim_line)
            {
                for (int i = 0; i < chk_Assembly_Line.Items.Count; i++)
                {
                    if (sub.TRIM_LINE.Equals((chk_Assembly_Line.Items[i] as EapValueListDetail).VLIST_DETAIL_VALUE))
                    {
                        chk_Assembly_Line.SetItemChecked(i, true);
                    }
                }
            }
        }
Beispiel #5
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            if (dgvVList.SelectedCells.Count == 0)
            {
                Func.ShowMessage(MessageType.Warning, "没有选中删除数据!");
                return;
            }

            if (!Func.ShowQuestion("确认要删除该记录数据?"))
            {
                return;
            }

            EapValueList del_entity = new EapValueList();
            int          iRowIdex   = dgvVList.CurrentCell.RowIndex;

            del_entity.VLIST_ID   = dgvVList.Rows[iRowIdex].Cells["VLIST_ID"].Value.ToString();
            del_entity.VLIST_NAME = dgvVList.Rows[iRowIdex].Cells["VLIST_NAME"].Value.ToString();

            string str = Bll.GetBll().DelValueList(del_entity.VLIST_ID);

            if (str != string.Empty)
            {
                if (str.Split(':')[0] == "ORA-02292")
                {
                    Func.ShowMessage(MessageType.Error, "删除值列表数据失败!原因:值列表ID[" + del_entity.VLIST_ID + "]存在明细列表数据,无法删除");
                    return;
                }

                Func.ShowMessage(MessageType.Error, "删除值列表数据失败!原因[" + str + "]");
            }
            else
            {
                //写日志
                Log.Write(MessageType.Information, "删除值列表数据成功,值列表ID[" + del_entity.VLIST_ID + "],值列表名称[" + del_entity.VLIST_NAME + "]", Config.GetConfig().user.USER_ID);
                Func.ShowMessage(MessageType.Information, "值列表数据删除成功");

                page.PageNo = 1;
                BindData();
            }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            EapValueListDetail edit_entity = GetEditEntity();

            if (edit_entity == null)
            {
                return;
            }

            string ret_add = Bll.GetBll().AddValueListDetail(edit_entity);

            if (ret_add != string.Empty)
            {
                Func.ShowMessage(MessageType.Error, "数据添加失败,原因[" + ret_add + "]");
                return;
            }
            //写日志
            Log.Write(MessageType.Information, "添加值列表明细数据成功,值列表ID[" + edit_entity.VLIST_ID + "],值列表明细值[" + edit_entity.VLIST_DETAIL_VALUE + "]", Config.GetConfig().user.USER_ID);
            Func.ShowMessage(MessageType.Information, "数据添加成功!");
            this.Close();
        }
Beispiel #7
0
        private void btnSaveButton_Click(object sender, EventArgs e)
        {
            List <EapUserButtonRight> list_button_right = new List <EapUserButtonRight>();
            EapMenu button_right_menu = null;

            GetUsetButtonRight(tvRightButton.Nodes, ref list_button_right, ref button_right_menu);

            if (button_right_menu != null)
            {
                string ret = Bll.GetBll().SaveUserButtonRight(user.USER_ID, list_button_right, button_right_menu);
                if (ret != string.Empty)
                {
                    Func.ShowMessage(MessageType.Error, ret);
                    Log.Write(MessageType.Error, "用户按钮授权失败,原因[" + ret + "]", Eap.Config.GetConfig().user.USER_ID);
                    return;
                }
            }

            Func.ShowMessage(MessageType.Information, "用户按钮授权成功!");
            Log.Write(MessageType.Information, "用户按钮授权成功!", Eap.Config.GetConfig().user.USER_ID);
        }
Beispiel #8
0
        private void btnDelVListDetail_Click(object sender, EventArgs e)
        {
            if (dgvVListDetail.SelectedCells.Count == 0)
            {
                Func.ShowMessage(MessageType.Warning, "没有选中删除数据!");
                return;
            }

            if (!Func.ShowQuestion("确认要删除该记录数据?"))
            {
                return;
            }

            EapValueListDetail del_entity = new EapValueListDetail();

            del_entity.VLIST_ID = dgvVList.Rows[dgvVList.CurrentCell.RowIndex].Cells["VLIST_ID"].Value.ToString();
            int iRowIndex = dgvVListDetail.CurrentCell.RowIndex;

            del_entity.VLIST_DETAIL_ID    = decimal.Parse(dgvVListDetail.Rows[iRowIndex].Cells["VLIST_DETAIL_ID"].Value.ToString());
            del_entity.VLIST_DETAIL_VALUE = decimal.Parse(dgvVListDetail.Rows[iRowIndex].Cells["VLIST_DETAIL_VALUE"].Value.ToString());
            del_entity.VLIST_DETAIL_NAME  = dgvVListDetail.Rows[iRowIndex].Cells["VLIST_DETAIL_NAME"].Value.ToString();

            string str = Bll.GetBll().DelValueListDetail(del_entity);

            if (str != string.Empty)
            {
                Func.ShowMessage(MessageType.Error, "删除值列表明细数据失败!原因[" + str + "]");
            }
            else
            {
                //写日志
                string msg = "删除值列表明细数据成功,值列表ID[" + del_entity.VLIST_ID + "],值列表明细ID[" + del_entity.VLIST_DETAIL_ID + "],值列表明细值[" + del_entity.VLIST_DETAIL_VALUE + "],值列表明细名称[" + del_entity.VLIST_DETAIL_NAME + "]";
                Log.Write(MessageType.Information, msg, Config.GetConfig().user.USER_ID);
                Func.ShowMessage(MessageType.Information, "值列表明细数据删除成功");

                BindValueListDetail(del_entity.VLIST_ID);
            }
        }
        private void btnDel_Click(object sender, EventArgs e)
        {
            if (dgv.SelectedCells.Count == 0)
            {
                Func.ShowMessage(MessageType.Warning, "没有选中菜单");
                return;
            }

            if (!Func.ShowQuestion("确认要删除该记录数据?"))
            {
                return;
            }

            //判断当前用户是否为admin(系统管理员)
            if (Config.GetConfig().user.USER_ID != "admin")
            {
                Func.ShowMessage(MessageType.Warning, "当前用户不是系统管理员admin,不能删除菜单");
                return;
            }

            string menu_id = dgv.Rows[dgv.CurrentCell.RowIndex].Cells["MENU_ID"].Value.ToString();

            string str = Bll.GetBll().DelMenuByMenuId(menu_id);

            if (str != string.Empty)
            {
                Func.ShowMessage(MessageType.Error, "删除功能菜单数据失败!原因[" + str + "]");
            }
            else
            {
                //写日志
                Log.Write(MessageType.Information, "删除功能菜单数据成功,菜单编码[" + menu_id + "]", Config.GetConfig().user.USER_ID);
                Func.ShowMessage(MessageType.Information, "功能菜单数据删除成功");

                page.PageNo = 1;
                BindData();
            }
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (dgv.SelectedCells.Count == 0)
            {
                Func.ShowMessage(MessageType.Warning, "没有选中一条数据");
                return;
            }

            if (Func.ShowQuestion("确认要进行删除操作吗?") == true)
            {
                string DEPARTMENT_ID = dgv.Rows[dgv.CurrentCell.RowIndex].Cells["DEPARTMENT_ID"].Value.ToString();

                string ret = Bll.GetBll().DeleteDEPARTMENT(DEPARTMENT_ID);
                if (ret != string.Empty)
                {
                    Func.ShowMessage(MessageType.Warning, "删除失败," + ret);
                }
                //成功写入日志
                Log.Write(MessageType.Information, "部门删除成功,删除ID[" + dgv.Rows[dgv.CurrentCell.RowIndex].Cells["DEPARTMENT_ID"].Value.ToString() + "]", Config.GetConfig().user.USER_ID);
                Func.ShowMessage(MessageType.Information, "删除成功");
                BindData();
            }
        }
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnEnter_Click(object sender, EventArgs e)
        {
            if (txtDEPARTMENT_CODE.Text.Trim() == string.Empty)
            {
                Func.ShowMessage(MessageType.Warning, "部门编号不能为空");
                txtDEPARTMENT_CODE.Focus();
                return;
            }

            if (txtDEPARTMENT_NAME.Text.Trim() == string.Empty)
            {
                Func.ShowMessage(MessageType.Warning, "部门名称不能为空");
                txtDEPARTMENT_NAME.Focus();
                return;
            }
            if (cmbASSEMBLY_LINE.Text.Trim() == string.Empty)
            {
                Func.ShowMessage(MessageType.Warning, "装配线不能为空");
                cmbASSEMBLY_LINE.Focus();
                return;
            }


            string ret;

            if (em == EditMode.Edit)
            {
                if (Bll.GetBll().RepeatDEPARTMENT(txtDEPARTMENT_NAME.Text.Trim(), entity.DEPARTMENT_ID))
                {
                    Func.ShowMessage(MessageType.Warning, "部门名称重复,请重新输入");
                    txtDEPARTMENT_NAME.Focus();
                    return;
                }
                entity.DEPARTMENT_CODE = txtDEPARTMENT_CODE.Text;
                entity.DEPARTMENT_NAME = txtDEPARTMENT_NAME.Text;
                entity.DEPARTMENT_TYPE = cmbDEPARTMENT_TYPE.Text;
                entity.ASSEMBLY_LINE   = cmbASSEMBLY_LINE.Text;
                entity.STATUS          = decimal.Parse(((EapItem)cmbStatus.SelectedItem).ID);
                ret = Bll.GetBll().UpdateDEPARTMENT(entity);

                if (ret != string.Empty)
                {
                    Func.ShowMessage(MessageType.Information, "新增失败" + ret);
                    return;
                }

                Func.ShowMessage(MessageType.Information, "保存成功");
                //成功写入日志
                Log.Write(MessageType.Information, "修改部门成功,问题id[" + entity.DEPARTMENT_ID + "],  " + log + "   新数据:部门编号[" + txtDEPARTMENT_CODE.Text + "],部门名称[" + txtDEPARTMENT_NAME.Text + "],类型[" + cmbDEPARTMENT_TYPE.Text + "],装配线[" + cmbASSEMBLY_LINE.Text + "],状态[" + cmbStatus.Text + "] ", Config.GetConfig().user.USER_ID);
                this.Close();
            }
            else
            {
                if (Bll.GetBll().RepeatDEPARTMENT(txtDEPARTMENT_NAME.Text.Trim(), 0))
                {
                    Func.ShowMessage(MessageType.Warning, "部门名称重复,请重新输入");
                    txtDEPARTMENT_NAME.Focus();
                    return;
                }
                entity = GetAddEntity();
                ret    = Bll.GetBll().AddDEPARTMENT(entity);

                if (ret != string.Empty)
                {
                    Func.ShowMessage(MessageType.Information, "新增失败" + ret);
                    return;
                }
                //成功写入日志
                Log.Write(MessageType.Information, "新增部门成功,id=[" + entity.DEPARTMENT_ID + "],部门编号[" + entity.DEPARTMENT_CODE + "],部门名称[" + entity.DEPARTMENT_NAME + "],部门类型[" + entity.DEPARTMENT_TYPE + "],部门状态[" + entity.STATUS + "]", Config.GetConfig().user.USER_ID);
                Func.ShowMessage(MessageType.Information, "新增成功");
                this.Close();
            }
        }
Beispiel #12
0
 /// <summary>
 /// 生成权限菜单
 /// </summary>
 private void GetMenuAuthority()
 {
     list_menu = Bll.GetBll().GetUserAuthority();
     this.tvRightMenu.Nodes.Clear();                //清空所有节点
     BindTransportTree(this.tvRightMenu.Nodes, ""); //创建树
 }
Beispiel #13
0
 /// <summary>
 /// 生成指定窗体权限按钮
 /// </summary>
 private void GetButtonAuthority(EapMenu form_menu)
 {
     list_button = Bll.GetBll().GetFormUserAuthorityButton(form_menu);
     this.tvRightButton.Nodes.Clear();                      //清空所有节点
     CreateButtonTree(this.tvRightButton.Nodes, form_menu); //创建树
 }