/// <summary> /// 注册磁扣信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnInsert_Click(object sender, EventArgs e) { string cardId = txtCardId.Text.Trim(); QC_CardUseType useType = cmbCardType.SelectedItem as QC_CardUseType; if (useType == null) { MessageBox.Show("使用类型不能为空"); return; } string cardType = useType.CUTCode; if (string.IsNullOrEmpty(cardId)) { MessageBox.Show("卡号不能为空"); return; } if (string.IsNullOrEmpty(cardType)) { MessageBox.Show("使用类型不能为空"); return; } QC_IC_Info card = QC_IC_Info.FindByCardId(txtCardId.Text.Trim()); if (card != null) { MessageBox.Show(string.Format("卡号{0}已经注册,不能重复注册。", cardId)); return; } QC_IC_Info icCard = new QC_IC_Info(); icCard.CardID = cardId; icCard.CardType = cardType; icCard.RegUser = FrmMain.localinfo.user.Name; icCard.RegTime = DateTime.Now; icCard.Save(); icInfoDatas.Insert(0, icCard); txtCardId.Text = ""; //if (this.cmbCardType.Properties.Items.Count > 0) //{ // cmbCardType.SelectedIndex = 0; //} // MessageBox.Show("注册完成"); }
private void UC_MatCheckStandard_Load(object sender, EventArgs e) { matFlView.LoadDataByWhere("invclasscode like '1%'"); // materials.LoadData(); this.treeList1.DataSource = matFlView; foreach (TreeListNode item in this.treeList1.Nodes) { if (SelectTreeNode(item)) { break; } } if (LocalInfo.Current.user.ID != "16870") { textEdit3.Enabled = false; } // this.gridMaterial.DataSource = materialView; this.gridMaterial.DataSource = materials; supplierDoc.LoadData(); QC_SupplierDoc allSupplier = new QC_SupplierDoc(); allSupplier.CustName = "所有厂家"; allSupplier.CustShortName = "所有厂家"; supplierDoc.Insert(0, allSupplier); this.qCSupplierDocBindingSource.DataSource = supplierDoc; //this.gridCheckItem.DataSource = matCheckItemView; //this.gridCheckGroup.DataSource = matCheckGroupView; //this.qCMatQualityLevelViewBindingSource.DataSource = matQualityLevelView; // this.gridQualityRule.DataSource = matQualityRule; repositoryItemGridLookUpEdit1.DataSource = matQualityLevelViewBindingSource; // matQualityRule.ListChanged += matQualityRule_ListChanged; }