Exemple #1
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            if (dgv.SelectedCells.Count == 0)
            {
                Func.ShowMessage(MessageType.Warning, "没有选中删除数据!");
                return;
            }

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

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

            string str = Bll.GetBll().DelSystemParameter(para_id);

            if (str != string.Empty)
            {
                Func.ShowMessage(MessageType.Error, "删除系统参数数据失败!原因[" + str + "]");
            }
            else
            {
                //写日志
                Log.Write(MessageType.Information, "删除系统参数数据成功,参数ID[" + para_id + "]", Config.GetConfig().user.USER_ID);
                Func.ShowMessage(MessageType.Information, "系统参数数据删除成功");

                page.PageNo = 1;
                BindData();
            }
        }
Exemple #2
0
        private void btnDownload_Click(object sender, EventArgs e)
        {
            string path = Application.StartupPath + "\\" + Config.GetConfig().APP_DOWNLOAD
                          + "\\" + Func.FormatDate(DateTime.Now, false) + Func.FormatTime(DateTime.Now, true, false);

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            foreach (DataGridViewRow row in dgv.Rows)
            {
                //下载选中行的文件
                if ((bool)row.Cells["colSelect"].Value)
                {
                    //获取文件数据
                    EapFile file = Bll.GetBll().DownloadFile(row.Cells["colFileId"].Value.ToString());
                    if (file == null)
                    {
                        Func.ShowMessage(MessageType.Error, "下载文件[" + row.Cells["colFileId"].Value.ToString() + "]失败");
                        return;
                    }

                    //写入文件
                    FileStream fs = new FileStream(path + "\\" + file.FILE_ID, FileMode.Create, FileAccess.Write);
                    fs.Write(file.FILE_DATA, 0, file.FILE_DATA.Length);
                    fs.Close();
                }
            }

            Func.ShowMessage(MessageType.Information, "文件下载成功,下载的文件已保存到目录[" + path + "]");
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (txtNew.Text != txtNewAgain.Text)
            {
                Func.ShowMessage(MessageType.Error, "两次密码不一致!");
                return;
            }

            EapUser user = new EapUser();

            user.USER_ID = Config.GetConfig().user.USER_ID;
            user.PWD     = Func.EncryptString(txtOld.Text.Trim(), Config.GetConfig().DB_KEY);

            if (!Bll.GetBll().IsUserExist(user))
            {
                Func.ShowMessage(MessageType.Error, "当前密码错误!");
                this.txtOld.Focus();
                return;
            }

            user.PWD = Func.EncryptString(txtNew.Text, Config.GetConfig().DB_KEY);

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

            if (ret == string.Empty)
            {
                Func.ShowMessage(MessageType.Information, "密码修改成功!");
                this.Close();
            }
            else
            {
                Func.ShowMessage(MessageType.Error, ret);
            }
        }
        /// <summary>
        /// 判断是否成功添加用户生产线权限
        /// </summary>
        private bool IsQueueUserTrimLine(string user_id)
        {
            List <EapUserTrimLine> list_trim_line = new List <EapUserTrimLine>();
            EapUserTrimLine        UserLine;

            int count = chk_Assembly_Line.Items.Count;

            for (int i = 0; i < count; i++)
            {
                if (chk_Assembly_Line.GetItemChecked(i))
                {
                    UserLine           = new EapUserTrimLine();
                    UserLine.USER_ID   = user_id;
                    UserLine.TRIM_LINE = (chk_Assembly_Line.Items[i] as EapValueListDetail).VLIST_DETAIL_VALUE;
                    list_trim_line.Add(UserLine);
                }
            }

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

            string ret = Bll.GetBll().SaveUserTrimLine(list_trim_line);

            if (ret != string.Empty)
            {
                Func.ShowMessage(MessageType.Error, ret);
                Log.Write(MessageType.Error, "用户总装生产线授权失败,原因[" + ret + "]", Eap.Config.GetConfig().user.USER_ID);
                return(false);
            }

            return(true);
        }
Exemple #5
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (!Func.ShowQuestion("确定要删除选中的文件吗(警告,不可恢复)?"))
            {
                return;
            }

            foreach (DataGridViewRow row in dgv.Rows)
            {
                //删除选中行的文件
                if ((bool)row.Cells["colSelect"].Value)
                {
                    string ret = Bll.GetBll().DeleteFile(row.Cells["colFileId"].Value.ToString());
                    Log.Write(MessageType.Information, "删除文件[" + row.Cells["colFileId"].Value.ToString() + "]", Config.GetConfig().user.USER_ID);
                    if (ret != string.Empty)
                    {
                        Func.ShowMessage(MessageType.Error, ret);
                        break;
                    }
                }
            }

            page.PageNo = 1;
            BindData();
        }
        private void BindData()
        {
            EapLog entity = new EapLog();

            if (cboLogType.SelectedIndex != -1)
            {
                entity.LOG_TYPE = Convert.ToInt32(((EapItem)(cboLogType.SelectedItem)).ID);
            }
            else
            {
                entity.LOG_TYPE = -1;
            }
            entity.OPERATE_NOTE = txtOperateNote.Text.Trim();
            entity.OPERATE_USER = txtOperateUser.Text.Trim();

            entity.BEGIN_TIME = dtpBeginTime.Value;
            entity.END_TIME   = dtpEndTime.Value;

            int           icnt;
            List <EapLog> list = Bll.GetBll().QueryEapLog(entity, page.PageNo, page.PageSize, out icnt);

            page.RecordCount = icnt;

            dgv.DataSource = list;
        }
        private void frmDepartmentEdit_Load(object sender, EventArgs e)
        {
            try
            {
                //绑定部门类型下拉框
                foreach (EapDepartment sub in Bll.GetBll().GetDepartmant_TYPE())
                {
                    cmbDEPARTMENT_TYPE.Items.Add(new EapItem(sub.DEPARTMENT_TYPE, sub.DEPARTMENT_TYPE));
                }

                //绑定生产线下拉框
                foreach (EapDepartment sub in Bll.GetBll().GetASSEMBLY_LINE())
                {
                    cmbASSEMBLY_LINE.Items.Add(new EapItem(sub.ASSEMBLY_LINE, sub.ASSEMBLY_LINE));
                }

                //绑定状态
                cmbStatus.Items.Add(new EapItem("1", "有效"));
                cmbStatus.Items.Add(new EapItem("0", "无效"));

                if (em == EditMode.Edit)
                {
                    txtDEPARTMENT_NAME.Text = entity.DEPARTMENT_NAME;
                    txtDEPARTMENT_CODE.Text = entity.DEPARTMENT_CODE;
                    cmbDEPARTMENT_TYPE.Text = entity.DEPARTMENT_TYPE;
                    cmbASSEMBLY_LINE.Text   = entity.ASSEMBLY_LINE;
                    foreach (Object obj in cmbStatus.Items)
                    {
                        EapItem item = (EapItem)obj;
                        if (item.ID == entity.STATUS.ToString())
                        {
                            cmbStatus.SelectedItem = obj;
                            break;
                        }
                    }

                    log += "  旧数据:部门编号[" + txtDEPARTMENT_CODE.Text + "],部门名称[" + txtDEPARTMENT_NAME.Text + "],类型[" + cmbDEPARTMENT_TYPE.Text + "],装配线[" + cmbASSEMBLY_LINE.Text + "],状态[" + cmbStatus.Text + "]  ";
                }
                else
                {
                    if (cmbDEPARTMENT_TYPE.Items.Count > 0)
                    {
                        cmbDEPARTMENT_TYPE.SelectedIndex = 0;
                    }

                    if (cmbStatus.Items.Count > 0)
                    {
                        cmbStatus.SelectedIndex = 0;
                    }
                }
            }
            catch (Exception ex)
            {
                Func.ShowMessage(MessageType.Warning, "发生错误,错误原因:" + ex.Message);
            }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            EapUser user = getEapUser();

            if (user == null)
            {
                return;
            }

            if (em == EditMode.Add)
            {
                if (Bll.GetBll().IsUserExist(user.USER_ID))
                {
                    Func.ShowMessage(MessageType.Error, "用户已经存在!");
                    txtUserID.Focus();
                    return;
                }
                string ret = Bll.GetBll().AddUser(user);
                if (ret == "")
                {
                    //用户生产线权限添加失败即退出
                    if (!IsQueueUserTrimLine(user.USER_ID))
                    {
                        return;
                    }
                    Func.ShowMessage(MessageType.Information, "添加用户成功!");
                    Log.Write(MessageType.Information, "添加用户成功,用户ID[" + user.USER_ID + "]", Eap.Config.GetConfig().user.USER_ID);
                    this.Close();
                }
                else
                {
                    Func.ShowMessage(MessageType.Error, ret);
                }
            }
            else if (em == EditMode.Edit)
            {
                string ret = Bll.GetBll().UpdateUser(user);
                if (ret == "")
                {
                    //用户生产线权限添加失败即退出
                    if (!IsQueueUserTrimLine(user.USER_ID))
                    {
                        return;
                    }
                    Func.ShowMessage(MessageType.Information, "修改用户成功!");
                    Log.Write(MessageType.Information, "修改用户成功,用户ID[" + user.USER_ID + "],用户名[" + user.USER_NAME + "],用户状态[" + user.IS_STOP + "]", Eap.Config.GetConfig().user.USER_ID);
                    this.Close();
                }
                else
                {
                    Func.ShowMessage(MessageType.Error, ret);
                }
            }
        }
        /// <summary>
        /// 绑定部门类型下拉框
        /// </summary>
        private void BindDepartmant()
        {
            cmbDEPARTMENT_TYPE.Items.Clear();
            cmbDEPARTMENT_TYPE.Items.Add(new EapItem("-1", "全部"));

            foreach (EapDepartment sub in Bll.GetBll().GetDepartmant_TYPE())
            {
                cmbDEPARTMENT_TYPE.Items.Add(new EapItem(sub.DEPARTMENT_TYPE, sub.DEPARTMENT_TYPE));
            }

            cmbDEPARTMENT_TYPE.SelectedIndex = 0;
        }
        private EapDepartment GetAddEntity()
        {
            EapDepartment ret_entity = new EapDepartment();

            ret_entity.DEPARTMENT_ID   = Bll.GetBll().GetDEPARTMENT_ID();
            ret_entity.DEPARTMENT_CODE = txtDEPARTMENT_CODE.Text;
            ret_entity.DEPARTMENT_NAME = txtDEPARTMENT_NAME.Text;
            ret_entity.DEPARTMENT_TYPE = cmbDEPARTMENT_TYPE.Text;
            ret_entity.ASSEMBLY_LINE   = cmbASSEMBLY_LINE.Text;
            ret_entity.STATUS          = decimal.Parse(((EapItem)cmbStatus.SelectedItem).ID);

            return(ret_entity);
        }
Exemple #11
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            EapMenu edit_entity = GetEditEntity();

            if (edit_entity == null)
            {
                return;
            }

            if (edit_entity.PARENT_MENU_ID != string.Empty)
            {
                if (!Bll.GetBll().IsExistMenu(edit_entity.PARENT_MENU_ID))
                {
                    Func.ShowMessage(MessageType.Error, "数据保存失败,原因:上级菜单编码[" + edit_entity.PARENT_MENU_ID + "]不存在");
                    return;
                }
            }

            if (em == EditMode.Add)
            {
                string ret_add = Bll.GetBll().AddMenu(edit_entity);
                if (ret_add != string.Empty)
                {
                    if (ret_add.Split(':')[0] == "ORA-00001")
                    {
                        Func.ShowMessage(MessageType.Error, "数据添加失败,原因:菜单编码[" + edit_entity.MENU_ID + "]已经存在");
                        return;
                    }

                    Func.ShowMessage(MessageType.Error, "数据添加失败,原因[" + ret_add + "]");
                    return;
                }
                //写日志
                Log.Write(MessageType.Information, "添加菜单数据成功,菜单编码[" + edit_entity.MENU_ID + "]", Config.GetConfig().user.USER_ID);
                Func.ShowMessage(MessageType.Information, "数据添加成功!");
                this.Close();
            }
            else if (em == EditMode.Edit)
            {
                string ret_edit = Bll.GetBll().ModifyMenu(edit_entity);
                if (ret_edit != string.Empty)
                {
                    Func.ShowMessage(MessageType.Error, "数据修改失败,原因[" + ret_edit + "]");
                    return;
                }
                //写日志
                Log.Write(MessageType.Information, "修改菜单数据成功,菜单编码[" + edit_entity.MENU_ID + "]", Config.GetConfig().user.USER_ID);
                Func.ShowMessage(MessageType.Information, "数据修改成功!");
                this.Close();
            }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            EapParameter edit_entity = GetEditEntity();

            if (edit_entity == null)
            {
                return;
            }

            if (this.txtParaId.Text.Equals("DayCompletionTime"))
            {
                if (!CheckDayCompletionTime())
                {
                    this.txtParaValue.Text = "8:00";
                    return;
                }
            }

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

                    Func.ShowMessage(MessageType.Error, "数据添加失败,原因[" + ret_add + "]");
                    return;
                }
                //写日志
                Log.Write(MessageType.Information, "添加系统参数数据成功,参数ID[" + edit_entity.PARA_ID + "]", Config.GetConfig().user.USER_ID);
                Func.ShowMessage(MessageType.Information, "数据添加成功!");
                this.Close();
            }
            else if (em == EditMode.Edit)
            {
                string ret_edit = Bll.GetBll().ModifySystemParameter(edit_entity);
                if (ret_edit != string.Empty)
                {
                    Func.ShowMessage(MessageType.Error, "数据修改失败,原因[" + ret_edit + "]");
                    return;
                }
                //写日志
                Log.Write(MessageType.Information, "修改系统参数数据成功,参数ID[" + edit_entity.PARA_ID + "]", Config.GetConfig().user.USER_ID);
                Func.ShowMessage(MessageType.Information, "数据修改成功!");
                this.Close();
            }
        }
Exemple #13
0
        private void BindData()
        {
            EapParameter entity = new EapParameter();

            entity.PARA_ID   = txtParaId.Text.Trim();
            entity.PARA_NAME = txtParaName.Text.Trim();

            int icnt;
            List <EapParameter> list = Bll.GetBll().QuerySystemParameter(entity, page.PageNo, page.PageSize, out icnt);

            page.RecordCount = icnt;

            dgv.DataSource = list;
        }
        /// <summary>
        /// 绑定数据
        /// </summary>
        private void BindData()
        {
            EapDepartment entity = new EapDepartment();

            entity.DEPARTMENT_CODE = txtDEPARTMENT_CODE.Text;
            entity.DEPARTMENT_NAME = txtDEPARTMENT_NAME.Text;
            entity.DEPARTMENT_TYPE = cmbDEPARTMENT_TYPE.Text;
            entity.STATUS          = chbSTATUS.Checked?0:1;
            int count = 0;
            List <EapDepartment> list = Bll.GetBll().GetDEPARTMENTList(entity, page.PageNo, page.PageSize, out count);

            page.RecordCount = count;
            dgv.DataSource   = list;
        }
        private void BindData()
        {
            int recordcount = 0;

            EapUser user = new EapUser();

            user.USER_NAME = txtUserName.Text.Trim();
            user.USER_ID   = txtUserID.Text.Trim();

            List <EapUser> list = Bll.GetBll().GetUserList(user, page.PageNo, page.PageSize, out recordcount);

            dgv.DataSource   = list;
            page.RecordCount = recordcount;
        }
Exemple #16
0
        private void BindData()
        {
            EapValueList entity = new EapValueList();

            entity.VLIST_ID   = txtVListId.Text.Trim();
            entity.VLIST_NAME = txtVListName.Text.Trim();

            int icnt;
            List <EapValueList> list = Bll.GetBll().QueryValueList(entity, page.PageNo, page.PageSize, out icnt);

            page.RecordCount = icnt;

            dgvVList.DataSource = list;
        }
        private void BindData()
        {
            EapMenu entity = new EapMenu();

            entity.MENU_ID        = txtMenuId.Text.Trim().ToUpper();
            entity.MENU_NAME      = txtMenuName.Text.Trim();
            entity.PARENT_MENU_ID = txtParentMenuId.Text.Trim().ToUpper();

            int            icnt;
            List <EapMenu> list = Bll.GetBll().QueryMenu(entity, page.PageNo, page.PageSize, out icnt);

            page.RecordCount = icnt;

            dgv.DataSource = list;
        }
Exemple #18
0
        //设置权限
        private void SetUserButtonRight(string UserID)
        {
            ClearTreeViewChecked(tvRightButton.Nodes);
            kg = false;
            List <EapUserButtonRight> list = Bll.GetBll().GetButtonAuthoritybyUser(UserID);

            if (list.Count > 0)
            {
                foreach (EapUserButtonRight m in list)                         //设置当前角色的选择项
                {
                    SearchNodeAndCheck(this.tvRightButton.Nodes, m.BUTTON_ID); //递归查找并选中
                }
            }
            kg = true;//处理完成,可以选择节点复选框
        }
Exemple #19
0
        private void btnUpload_Click(object sender, EventArgs e)
        {
            OpenFileDialog pfd = new OpenFileDialog();

            pfd.Multiselect = true;
            pfd.Filter      = "所有支持的文件(*.dll,*.exe,*.config,*.bat)|*.dll;*.exe;*.config;*.bat";

            if (pfd.ShowDialog() == DialogResult.OK)
            {
                foreach (string path in pfd.FileNames)
                {
                    FileInfo fi = new FileInfo(path);

                    //获取文件信息
                    EapFile eapfile = new EapFile();
                    eapfile.FILE_ID      = fi.Name;
                    eapfile.FILE_VERSION = FileVersionInfo.GetVersionInfo(path).FileVersion;
                    if (eapfile.FILE_VERSION == null)
                    {
                        eapfile.FILE_VERSION = string.Empty;
                    }
                    eapfile.FILE_EDIT_TIME = fi.LastWriteTime;

                    //读取文件
                    FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
                    if (fs.Length == 0)
                    {
                        Func.ShowMessage(MessageType.Error, "不能上传空文件");
                        break;
                    }
                    eapfile.FILE_DATA = new byte[fs.Length];
                    fs.Read(eapfile.FILE_DATA, 0, System.Convert.ToInt32(fs.Length));
                    fs.Close();

                    //上传文件
                    string ret = Bll.GetBll().UploadFile(eapfile);
                    Log.Write(MessageType.Information, "上传文件[" + eapfile.FILE_ID + "]", Config.GetConfig().user.USER_ID);
                    if (ret != string.Empty)
                    {
                        Func.ShowMessage(MessageType.Error, ret);
                        break;
                    }
                }

                page.PageNo = 1;
                BindData();
            }
        }
Exemple #20
0
        private void BindData()
        {
            EapFile query = getQuery();

            if (query == null)
            {
                return;
            }

            chkAllSelect.Checked = false;

            int icnt;

            dgv.DataSource   = Bll.GetBll().GetAppFiles(query, page.PageNo, page.PageSize, out icnt);
            page.RecordCount = icnt;
        }
Exemple #21
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            list_menu_right.Clear();
            GetUsetMenuRight(tvRightMenu.Nodes);

            string ret = Bll.GetBll().SaveUserMenuRight(user.USER_ID, list_menu_right);

            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);
        }
Exemple #22
0
        /// <summary>
        /// 初始化进程刷新超时时间
        /// </summary>
        private void InitProcessRefreshTimeout()
        {
            EapParameter process_refresh_timeout_para = Bll.GetBll().GetProcessRefreshTime();

            if (process_refresh_timeout_para != null)
            {
                try
                {
                    process_refresh_timeout = Convert.ToInt32(process_refresh_timeout_para.PARA_VALUE) * 60 * 1000;
                    lblRefreshTimeout.Text  = "进程刷新超时时间:" + process_refresh_timeout_para.PARA_VALUE + "分钟";
                }
                catch
                {
                    process_refresh_timeout = 5 * 60 * 1000;
                    lblRefreshTimeout.Text  = "进程刷新超时时间:5 分钟";
                }
            }
        }
Exemple #23
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);
                    }
                }
            }
        }
Exemple #27
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();
            }
        }
Exemple #28
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);
        }
        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();
        }
Exemple #30
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);
            }
        }