public FormCustomerAnalysisTable() { InitializeComponent(); dtpStart.Value = DateTime.Now.AddYears(-1); dtpEnd.Value = DateTime.Now.AddYears(1); dtsky.Value = DateTime.Now.AddDays(1); ReadColumnConfig(dataGridView1, "Set_Client"); if (FishEntity.Variable.User.roletype.Equals(FishEntity.Constant.Role_SalesMan)) { cmbTheperson.Enabled = false; } FishBll.Bll.PersonBll bll = new FishBll.Bll.PersonBll(); List <FishEntity.PersonEntity> list1 = bll.id_name(); if (list1 == null) { list1 = new List <FishEntity.PersonEntity>(); } FishEntity.PersonEntity tmep = new FishEntity.PersonEntity(); tmep.username = ""; list1.Insert(0, tmep); cmbTheperson.DataSource = list1; cmbTheperson.DisplayMember = "username"; cmbTheperson.ValueMember = "username"; }
public void User() { if (FishEntity.Variable.User.roletype.Equals(FishEntity.Constant.Role_SalesMan)) { cmbTheperson.Enabled = false; cmbTheperson.Visible = false; label12.Visible = false; } FishBll.Bll.PersonBll bll = new FishBll.Bll.PersonBll(); List <FishEntity.PersonEntity> list1 = bll.id_name(); if (list1 == null) { list1 = new List <FishEntity.PersonEntity>(); } FishEntity.PersonEntity tmep = new FishEntity.PersonEntity(); //tmep.id = 0; tmep.username = "******"; list1.Insert(0, tmep); cmbTheperson.DataSource = list1; cmbTheperson.DisplayMember = "username"; cmbTheperson.ValueMember = "username"; }
private void btnOk_Click(object sender, EventArgs e) { string pwd1 = txtpwd1.Text.Trim(); string pwd2 = txtpwd2.Text.Trim(); if (string.IsNullOrEmpty(pwd1) || string.IsNullOrEmpty(pwd2)) { MessageBox.Show("请输入密码。"); this.DialogResult = System.Windows.Forms.DialogResult.None; return; } if (pwd1 != pwd2) { MessageBox.Show("两次密码输入不一致,请重新设置"); this.DialogResult = System.Windows.Forms.DialogResult.None; return; } string pwdstr = Utility.DesEncryptUtil.EncryptMD5(pwd1); FishBll.Bll.PersonBll bll = new FishBll.Bll.PersonBll(); bool isok = bll.ModifyPassword(_user.id, pwdstr); if (isok) { MessageBox.Show("修改密码成功。"); } }
public FormCompanyList() { InitializeComponent(); menuStrip1.Items.Remove(tmiprint); menuStrip1.Items.Remove(tmiReview); ReadColumnConfig(dataGridView1, "Set_CompanyList"); if (FishEntity.Variable.User.roletype.Equals(FishEntity.Constant.Role_SalesMan)) { cmbTheperson.Enabled = false; } FishBll.Bll.PersonBll bll = new FishBll.Bll.PersonBll(); List <FishEntity.PersonEntity> list1 = bll.id_name(); if (list1 == null) { list1 = new List <FishEntity.PersonEntity>(); } FishEntity.PersonEntity tmep = new FishEntity.PersonEntity(); tmep.username = ""; list1.Insert(0, tmep); cmbTheperson.DataSource = list1; cmbTheperson.DisplayMember = "username"; cmbTheperson.ValueMember = "username"; }
//功能 protected void GetUserRoles() { if (FishEntity.Variable.User == null) { return; } FishBll.Bll.PersonBll bll = new FishBll.Bll.PersonBll(); FishEntity.Variable.Roles = bll.GetPersionRoles(FishEntity.Variable.User.id); }
public override int Query() { FishBll.Bll.PersonBll bll = new FishBll.Bll.PersonBll(); string where = " isdelete=0 "; if (string.IsNullOrEmpty(txtUserName.Text) == false) { where += " and username like '%" + txtUserName.Text.Trim() + "%'"; } List <FishEntity.PersonEntity> list = bll.GetModelList(where); dataGridView1.AutoGenerateColumns = false; dataGridView1.DataSource = list; return(1); }
public override void Review() { FishBll.Bll.PersonBll getnameBll = new FishBll.Bll.PersonBll(); FishEntity.PersonEntity getModel = new FishEntity.PersonEntity(); getModel = getnameBll.Getname(txtcreateman.Text); if (getModel != null) { Review(this.Name, txtNumbering.Text, getModel.username + " " + getModel.realname, txtcode.Text); if (txtNumbering.Text != "") { _Refreshbll = new FishBll.Bll.ProcessStateBll(); _Refreshbll.GetFormCargoFeedbackSheet(txtNumbering.Text); } } base.Review(); }
private void btnOk_Click(object sender, EventArgs e) { lblTipInfo.Visible = lblTipPwd.Visible = lblTipUser.Visible = false; bool isOk = true; if (string.IsNullOrEmpty(txtUserName.Text)) { lblTipUser.Text = "请输入用户名"; lblTipUser.Visible = true; isOk = false; txtUserName.Focus(); } if (string.IsNullOrEmpty(txtPassword.Text)) { lblTipPwd.Text = "请输入密码"; lblTipPwd.Visible = true; isOk = false; txtPassword.Focus(); } if (isOk == false) { this.DialogResult = System.Windows.Forms.DialogResult.None; return; } string username = txtUserName.Text.Trim(); string password = txtPassword.Text; string pwdMD5 = Utility.DesEncryptUtil.EncryptMD5(password); FishBll.Bll.PersonBll bll = new FishBll.Bll.PersonBll(); FishEntity.PersonEntity entity = bll.Login(username, pwdMD5); if (entity == null) { this.DialogResult = System.Windows.Forms.DialogResult.None; lblTipInfo.Text = "登录失败,用户名或密码错误"; lblTipInfo.Visible = true; } FishEntity.Variable.User = entity; SaveUser(entity); }
public void User( ) { FishBll.Bll.PersonBll bll = new FishBll.Bll.PersonBll( ); List <FishEntity.PersonEntity> list1 = bll.id_name( ); if (list1 == null) { list1 = new List <FishEntity.PersonEntity> ( ); } FishEntity.PersonEntity tmep = new FishEntity.PersonEntity( ); tmep.id = 0; tmep.username = "******"; list1.Insert(0, tmep); cmbCodeNumUser.DataSource = list1; cmbCodeNumUser.DisplayMember = "username"; cmbCodeNumUser.ValueMember = "username"; }
public override int Delete() { //return base.Delete(); if ( FishEntity.Variable.User.roletype.Contains(FishEntity.Constant.Role_Admin) == false) { MessageBox.Show("你无权删除。"); return(0); } if (dataGridView1.SelectedRows == null || dataGridView1.SelectedRows.Count < 1) { MessageBox.Show("请选择要删除的行记录"); return(0); } int id = 0; foreach (DataGridViewRow row in dataGridView1.SelectedRows) { id += int.Parse(row.Cells["id"].Value.ToString()); } if (MessageBox.Show("您确定要删除选中的记录吗?", "询问", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel) { return(0); } FishBll.Bll.PersonBll bll = new FishBll.Bll.PersonBll(); if (bll.FlagDelete(id)) { Query(); } else { MessageBox.Show("删除失败。"); } return(1); }
public FormCallRecordsTable() { InitializeComponent(); menuStrip1.Items.Remove(tmiQuery); menuStrip1.Items.Remove(tmiAdd); menuStrip1.Items.Remove(tmiModify); menuStrip1.Items.Insert(menuStrip1.Items.IndexOf(tmiClose), tmiQuery); menuStrip1.Items.Insert(menuStrip1.Items.IndexOf(tmiClose), tmiAdd); menuStrip1.Items.Insert(menuStrip1.Items.IndexOf(tmiClose), tmiModify); ReadColumnConfig(dataGridView1, "Set_CallRecordsTable_1"); //ReadColumnConfig(dataGridView2, "Set_CallRecordsTable_2"); cmbProvince.SelectedValueChanged -= cmbProvince_SelectedValueChanged; InitDataUtil.BindComboBoxData(cmbProvince, FishEntity.Constant.Province, true); cmbProvince.SelectedValueChanged += cmbProvince_SelectedValueChanged; BindArea(); BindCustomerType(FishEntity.Constant.Type); BindHZHB(); List <FishEntity.DictEntity> list = InitDataUtil.DictList.FindAll((i) => { return(i.pcode.Equals(FishEntity.Constant.Paymethod)); }); if (list == null) { list = new List <FishEntity.DictEntity>(); } FishEntity.DictEntity empty = new FishEntity.DictEntity(); empty.name = ""; empty.code = "-1"; list.Insert(0, empty); cmbPayMethod.DataSource = list; cmbPayMethod.DisplayMember = "name"; cmbPayMethod.ValueMember = "code"; if (FishEntity.Variable.User.roletype.Equals(FishEntity.Constant.Role_SalesMan)) { cmbTheperson.Enabled = false; cmbTheperson.Visible = false; label12.Visible = false; } FishBll.Bll.PersonBll bll = new FishBll.Bll.PersonBll(); List <FishEntity.PersonEntity> list1 = bll.id_name(); if (list1 == null) { list1 = new List <FishEntity.PersonEntity>(); } FishEntity.PersonEntity tmep = new FishEntity.PersonEntity(); tmep.username = "******"; list1.Insert(0, tmep); cmbTheperson.DataSource = list1; cmbTheperson.DisplayMember = "username"; cmbTheperson.ValueMember = "username"; }
private void btnOk_Click(object sender, EventArgs e) { if (Check() == false) { this.DialogResult = System.Windows.Forms.DialogResult.None; return; } bool isAdd = false; if (_person == null) { string username = txtUserName.Text.Trim(); FishBll.Bll.PersonBll bll = new FishBll.Bll.PersonBll(); if (bll.Exists(username)) { MessageBox.Show("用户名已经存在,请使用其他名称。"); txtUserName.SelectAll(); txtUserName.Focus(); this.DialogResult = System.Windows.Forms.DialogResult.None; return; } _person = new FishEntity.PersonEntity(); _person.isdelete = 0; isAdd = true; _person.password = Utility.DesEncryptUtil.EncryptMD5("123456"); _person.createman = FishEntity.Variable.User.username; _person.createtime = DateTime.Now; _person.modifyman = _person.createman; _person.modifytime = _person.createtime; } else { string username = txtUserName.Text.Trim(); if (_person.username.Equals(username) == false) { FishBll.Bll.PersonBll bll = new FishBll.Bll.PersonBll(); if (bll.Exists(username)) { MessageBox.Show("用户名已经存在,请使用其他名称。"); txtUserName.SelectAll(); txtUserName.Focus(); this.DialogResult = System.Windows.Forms.DialogResult.None; return; } } _person.modifyman = FishEntity.Variable.User.username; _person.modifytime = DateTime.Now; } int temp = 0; int.TryParse(txtAge.Text, out temp); _person.age = temp; _person.department = txtdepartment.Text; _person.email = txtemail.Text; _person.ename = txtEname.Text; _person.entrytime = dtpEntryDate.Value; _person.phone = txtphone.Text; _person.realname = txtRealName.Text; _person.roledate = string.Empty; string role = string.Empty; if (cbsalesman.Checked) { if (string.IsNullOrEmpty(role) == false) { role += ","; } role += cbsalesman.Text; } if (cbsalesmanger.Checked) { if (string.IsNullOrEmpty(role) == false) { role += ","; } role += cbsalesmanger.Text; } if (ckadmin.Checked) { if (string.IsNullOrEmpty(role) == false) { role += ","; } role += ckadmin.Text; } if (cbFinance.Checked) { if (string.IsNullOrEmpty(role) == false) { role += ","; } role += cbFinance.Text; } if (cbFinancialOfficer.Checked) { if (string.IsNullOrEmpty(role) == false) { role += ","; } role += cbFinancialOfficer.Text; } if (cbLogisticsStaff.Checked) { if (string.IsNullOrEmpty(role) == false) { role += ","; } role += cbLogisticsStaff.Text; } if (cbLogisticsDirector.Checked) { if (string.IsNullOrEmpty(role) == false) { role += ","; } role += cbLogisticsDirector.Text; } _person.roletype = role; _person.sex = rbman.Checked ? "男":"女"; _person.telephone = txtTelephone.Text; _person.username = txtUserName.Text; if (isAdd) { FishBll.Bll.PersonBll bll = new FishBll.Bll.PersonBll(); bool isok = bll.Add(_person); if (isok) { OnRefresh(); } } else { FishBll.Bll.PersonBll bll = new FishBll.Bll.PersonBll(); bool isok = bll.Update(_person); if (isok) { OnRefresh(); } } }