private void FormWarehouseReceipt_Load(object sender, EventArgs e) { if (Megres.oddNum != "") { MenuCode = "M499"; ControlButtomRoles(); strWhere = " codeNum='" + Megres.oddNum + "'"; _model = _bll.GetModel(strWhere); if (_model == null) { MessageBox.Show("没有记录了"); } else { setValue(); //List<FishEntity.PicInfoAll> dicPic = _bll.GetModel(_model.id, this.Name); //if (dicPic == null || dicPic.Count < 1) //{ //} //else { // //setValue(dicPic); //} } } else { strWhere = string.Empty; } //权限控制功能。 Megres.oddNum = string.Empty; }
public FormBarnAssociation() { ReadColumnConfig(dataGridView1, "Set_100"); _model = new FishEntity.WarehouseReceiptEntity(); _bll = new FishBll.Bll.WarehouseReceiptBll(); InitializeComponent(); }
//void setValue ( List<FishEntity . PicInfoAll> dicPic ) //{ // dataGridView1 . Rows . Clear ( ); // foreach ( FishEntity . PicInfoAll entity in dicPic ) // { // int idx = dataGridView1 . Rows . Add ( ); // dataGridView1 . Rows [ idx ] . Cells [ "tableId" ] . Value = entity . tableId; // dataGridView1 . Rows [ idx ] . Cells [ "tableName" ] . Value = entity . tableName; // dataGridView1 . Rows [ idx ] . Cells [ "picInfo" ] . Value = entity . picInfo; // dataGridView1 . Rows [ idx ] . Cells [ "categroy" ] . Value = entity . categroy; // dataGridView1 . Rows [ idx ] . Cells [ "remark" ] . Value = entity . remark; // } //} void QueryOne(string operate, string orderBy) { string whereEx = string.Empty; if (string.IsNullOrEmpty(strWhere)) { whereEx = "1=1"; } else { whereEx = strWhere; } if (_model != null) { whereEx = whereEx + " AND codeNumContract " + operate + orderBy; } _model = _bll.GetModel(whereEx); if (_model == null) { MessageBox.Show("已经没有记录了"); return; } setValue( ); List <FishEntity.PicInfoAll> dicPic = _bll.GetModel(_model.id, this.Name); if (dicPic.Count < 1) { return; } //setValue ( dicPic ); }
private void txtsupCom_Click(object sender, EventArgs e) { FormCompanyList form = new FormCompanyList(); if (form.ShowDialog() == DialogResult.OK) { _model = form.getModelWare; txtsupCom.Text = _model.SupCom; } }
private void txtAnalysisUnit_Click(object sender, EventArgs e) { FormCompanyList form = new FormCompanyList(); if (form.ShowDialog() == DialogResult.OK) { _model = form.getModelWare; txtAnalysisUnit.Text = _model.AnalysisUnit; } }
private void txtshipMent_Click(object sender, EventArgs e) { FormCompanyList form = new FormCompanyList(); if (form.ShowDialog() == DialogResult.OK) { _model = form.getModelWare; txtshipMent.Text = _model.shipMent; txtshipMentUser.Text = _model.shipMentUser; } }
public FormWarehouseReceipt(string name) { InitializeComponent(); getname = name; _model = new FishEntity.WarehouseReceiptEntity(); _bll = new FishBll.Bll.WarehouseReceiptBll(); _pic = new FishEntity.PicInfoAll(); InitDataUtil.BindComboBoxData(cmbStartingCountry, FishEntity.Constant.CountryType, true); InitDataUtil.BindComboBoxData(cmbDestinationCountry, FishEntity.Constant.CountryType, true); InitDataUtil.BindComboBoxData(cmbcountryOfOrigin, FishEntity.Constant.CountryType, true); InitDataUtil.BindComboBoxData(txtcommodityTons, FishEntity.Constant.Goods, true); InitDataUtil.BindComboBoxData(txtProductionProcess, FishEntity.Constant.TechClass, true); }
public FormWarehouseReceipt() { InitializeComponent( ); _model = new FishEntity.WarehouseReceiptEntity( ); _bll = new FishBll.Bll.WarehouseReceiptBll( ); _pic = new FishEntity.PicInfoAll( ); InitDataUtil.BindComboBoxData(cmbStartingCountry, FishEntity.Constant.CountryType, true); InitDataUtil.BindComboBoxData(cmbDestinationCountry, FishEntity.Constant.CountryType, true); InitDataUtil.BindComboBoxData(cmbcountryOfOrigin, FishEntity.Constant.CountryType, true); InitDataUtil.BindComboBoxData(txtcommodityTons, FishEntity.Constant.Goods, true); InitDataUtil.BindComboBoxData(txtProductionProcess, FishEntity.Constant.TechClass, true); this.dtpReportingTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom; this.dtpReportingTime.CustomFormat = " "; this.dtpTestTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom; this.dtpTestTime.CustomFormat = " "; this.dtpFumigationDate.Format = System.Windows.Forms.DateTimePickerFormat.Custom; this.dtpFumigationDate.CustomFormat = " "; }
public override int Add( ) { dtpReportingTime.Value = dtpTestTime.Value = dtpFumigationDate.Value = DateTime.Now; //clearControl ( ); txtcode.Text = _bll.getCode( ); _bll = new FishBll.Bll.WarehouseReceiptBll(); _model = new FishEntity.WarehouseReceiptEntity();//select codeNum,codeNumContract from t_purchaseApplication if (getname != "" && getname != null) { _model = _bll.ADDModel(" codenum='" + getname + "' "); if (_model != null) { txtcodeNum.Text = _model.codeNum; txtcodeNumContract.Text = _model.codeNumContract; } } return(base.Add( )); }
//codeNum public FormBarnAssociation(string codeNum) { InitializeComponent(); ReadColumnConfig(dataGridView1, "Set_100"); tmiQuery.Visible = false; tmiSave.Visible = false; tmiReview.Visible = false; tmiprint.Visible = false; tmiPrevious.Visible = false; tmiNext.Visible = false; tmiModify.Visible = false; tmiExport.Visible = false; tmiDelete.Visible = false; tmiClose.Visible = false; tmiCancel.Visible = false; tmiAdd.Visible = true; _model = new FishEntity.WarehouseReceiptEntity(); _bll = new FishBll.Bll.WarehouseReceiptBll(); name = codeNum; Query(); }
public override int Query( ) { FormWarehouseReceiptQuery form = new FormWarehouseReceiptQuery(this.Text + "查询"); if (form.ShowDialog( ) == DialogResult.OK) { strWhere = form.getWhere; _model = _bll.GetModel(strWhere); if (_model == null) { MessageBox.Show("没有记录了"); return(0); } setValue( ); //List<FishEntity . PicInfoAll> dicPic = _bll . GetModel ( _model . id ,this . Name ); //if ( dicPic == null || dicPic . Count < 1 ) // return 0; //setValue ( dicPic ); } return(base.Query( )); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(FishEntity.WarehouseReceiptEntity modelstring, string tableName) { return(dal.Update(modelstring, tableName)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(FishEntity.WarehouseReceiptEntity model, string name) { return(dal.Add(model, name)); }
//private void btnAdd_Click ( object sender ,EventArgs e ) //{ // errorProvider1 . Clear ( ); // if ( string . IsNullOrEmpty ( txtLeiBie . Text ) ) // { // errorProvider1 . SetError ( txtLeiBie ,"请选择类别" ); // return; // } // _pic = new FishEntity . PicInfoAll ( ); // _pic . tableId = txtcode . Tag == null ? 0 : Convert . ToInt32 ( txtcode . Tag ); // _pic . picInfo = PictureOpreation . ReadPicture ( pic ); // _pic . tableName = this . Name; // _pic . categroy = txtLeiBie . Text; // _pic . remark = txtBeiZhu . Text; // int idx = dataGridView1 . Rows . Add ( ); // dataGridView1 . Rows [ idx ] . Cells [ "tableId" ] . Value = _pic . tableId; // dataGridView1 . Rows [ idx ] . Cells [ "tableName" ] . Value = _pic . tableName; // dataGridView1 . Rows [ idx ] . Cells [ "picInfo" ] . Value = _pic . picInfo; // dataGridView1 . Rows [ idx ] . Cells [ "categroy" ] . Value = _pic . categroy; // dataGridView1 . Rows [ idx ] . Cells [ "remark" ] . Value = _pic . remark; //} //private void btnEdit_Click ( object sender ,EventArgs e ) //{ // errorProvider1 . Clear ( ); // if ( string . IsNullOrEmpty ( txtLeiBie . Text ) ) // { // errorProvider1 . SetError ( txtLeiBie ,"请选择类别" ); // return; // } // _pic = new FishEntity . PicInfoAll ( ); // _pic . tableId = txtcode . Tag == null ? 0 : Convert . ToInt32 ( txtcode . Tag ); // _pic . picInfo = PictureOpreation . ReadPictureToByte ( pic ); // _pic . tableName = this . Name; // _pic . categroy = txtLeiBie . Text; // _pic . remark = txtBeiZhu . Text; // dataGridView1 . Rows [ selectIdx ] . Cells [ "picInfo" ] . Value = _pic . picInfo; // dataGridView1 . Rows [ selectIdx ] . Cells [ "categroy" ] . Value = _pic . categroy; // dataGridView1 . Rows [ selectIdx ] . Cells [ "remark" ] . Value = _pic . remark; //} //private void btnDelete_Click ( object sender ,EventArgs e ) //{ // dataGridView1 . Rows . RemoveAt ( selectIdx ); // pic . Image = null; // txtBeiZhu . Text = txtLeiBie . Text = string . Empty; //} //private void dataGridView1_CellClick ( object sender ,DataGridViewCellEventArgs e ) //{ // if ( e . ColumnIndex < 0 || e . RowIndex < 0 ) // return; // selectIdx = e . RowIndex; // txtLeiBie . Text = dataGridView1 . Rows [ e . RowIndex ] . Cells [ "categroy" ] . Value . ToString ( ); // txtBeiZhu . Text = dataGridView1 . Rows [ e . RowIndex ] . Cells [ "remark" ] . Value . ToString ( ); // pic . Image = PictureOpreation . ReadPicture ( dataGridView1 . Rows [ e . RowIndex ] . Cells [ "picInfo" ] . Value == null ? null : ( byte [ ] ) dataGridView1 . Rows [ e . RowIndex ] . Cells [ "picInfo" ] . Value ); //} #endregion #region Method //void clearControl ( ) //{ // foreach ( Control tc in panel3 . Controls ) // { // if ( tc . GetType ( ) == typeof ( TextBox ) ) // { // TextBox tb = tc as TextBox; // tb . Text = string . Empty; // } // if ( tc . GetType ( ) == typeof ( PictureBox ) ) // { // PictureBox pc = tc as PictureBox; // pc . Image = null; // } // } // dataGridView1 . Rows . Clear ( ); //} bool getValue( ) { _model = new FishEntity.WarehouseReceiptEntity( ); decimal outResult = 0M; //int outResult = 0; errorProvider1.Clear( ); if (string.IsNullOrEmpty(txtcodeNumContract.Text)) { errorProvider1.SetError(txtcodeNumContract, "不可为空"); return(false); } if (string.IsNullOrEmpty(txtfishId.Text)) { errorProvider1.SetError(txtfishId, "不可为空"); return(false); } _model.id = txtcode.Tag == null ? 0 : Convert.ToInt32(txtcode.Tag); _model.code = txtcode.Text; _model.codeNumContract = txtcodeNumContract.Text; _model.codeNum = txtcodeNum.Text; _model.fishId = txtfishId.Text; //_model . quaIden = txtquaIden . Text; _model.commodityTons = txtcommodityTons.Text; if (!string.IsNullOrEmpty(txtcommodityPack.Text) && decimal.TryParse(txtcommodityPack.Text, out outResult) == false) { errorProvider1.SetError(txtcommodityPack, "请重新填写"); return(false); } _model.commodityPack = outResult; _model.commodity = txtcommodity.Text; //_model . speci = txtspeci . Text; _model.countryOfOrigin = cmbcountryOfOrigin.Text; _model.billName = txtbillName.Text; //_model . sign = txtsign . Text; _model.shipMent = txtshipMent.Text; _model.shipMentUser = txtshipMentUser.Text; //_model . checkAddDate = txtcheckAddDate . Text; //_model . sampling = txtsampling . Text; outResult = 0M; if (!string.IsNullOrEmpty(txtdb.Text) && decimal.TryParse(txtdb.Text, out outResult) == false) { errorProvider1.SetError(txtdb, "请重新填写"); return(false); } _model.db = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtwater.Text) && decimal.TryParse(txtwater.Text, out outResult) == false) { errorProvider1.SetError(txtwater, "请重新填写"); return(false); } _model.water = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtzf.Text) && decimal.TryParse(txtzf.Text, out outResult) == false) { errorProvider1.SetError(txtzf, "请重新填写"); return(false); } _model.zf = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtfreshness.Text) && decimal.TryParse(txtfreshness.Text, out outResult) == false) { errorProvider1.SetError(txtfreshness, "请重新填写"); return(false); } _model.freshness = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtsy.Text) && decimal.TryParse(txtsy.Text, out outResult) == false) { errorProvider1.SetError(txtsy, "请重新填写"); return(false); } _model.sy = outResult; _model.oxi = txtoxi.Text; outResult = 0M; if (!string.IsNullOrEmpty(txtweight.Text) && decimal.TryParse(txtweight.Text, out outResult) == false) { errorProvider1.SetError(txtweight, "请重新填写"); return(false); } _model.weight = outResult; //_model . package = txtpackage . Text; outResult = 0M; if (!string.IsNullOrEmpty(txtavgWeight.Text) && decimal.TryParse(txtavgWeight.Text, out outResult) == false) { errorProvider1.SetError(txtavgWeight, "请重新填写"); return(false); } _model.avgWeight = outResult; _model.shipper = txtshipper.Text; _model.shipperNum = txtshipperNum.Text; _model.billNames = txtbillNames.Text; _model.contractNum = txtcontractNum.Text; _model.goodsNum = txtgoodsNum.Text; _model.consi = txtconsi.Text; _model.preShip = txtpreShip.Text; _model.oceanShip = txtoceanShip.Text; //_model . navNum = txtnavNum . Text; //_model . agent = txtagent . Text; _model.receipt = txtreceipt.Text; //_model . shipHar = txtshipHar . Text; //_model . unShopHar = txtunShopHar . Text; //_model . desTi = txtdesTi . Text; _model.lastDesTi = txtlastDesTi.Text; outResult = 0M; //if ( !string . IsNullOrEmpty ( txtnum . Text ) && decimal . TryParse ( txtnum . Text ,out outResult ) == false ) //{ // errorProvider1 . SetError ( txtnum ,"请重新填写" ); // return false; //} _model.num = outResult; _model.containNum = txtcontainNum.Text; _model.paper = txtpaper.Text; outResult = 0M; if (!string.IsNullOrEmpty(txtconWeight.Text) && decimal.TryParse(txtconWeight.Text, out outResult) == false) { errorProvider1.SetError(txtconWeight, "请重新填写"); return(false); } _model.conWeight = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtpakeWeight.Text) && decimal.TryParse(txtpakeWeight.Text, out outResult) == false) { errorProvider1.SetError(txtpakeWeight, "请重新填写"); return(false); } _model.pakeWeight = outResult; //_model . seal = txtseal . Text; outResult = 0M; if (!string.IsNullOrEmpty(txtfreight.Text) && decimal.TryParse(txtfreight.Text, out outResult) == false) { errorProvider1.SetError(txtfreight, "请重新填写"); return(false); } _model.freight = outResult; _model.freightAdd = txtfreightAdd.Text; _model.shipName = txtshipname.Text; outResult = 0M; //if ( !string . IsNullOrEmpty ( txtprice . Text ) && decimal . TryParse ( txtprice . Text ,out outResult ) == false ) //{ // errorProvider1 . SetError ( txtprice ,"请重新填写" ); // return false; //} _model.price = outResult; _model.ForUnit = txtforUnit.Text; _model.SupCom = txtsupCom.Text; _model.Receive = txtreceive.Text; _model.ReceiveAdd = txtreceiveAdd.Text; //_model . QuaIndex = txtquaIndex . Text; _model.ContractNums = txtcontractNums.Text; outResult = 0M; if (!string.IsNullOrEmpty(txtpriceMJ.Text) && decimal.TryParse(txtpriceMJ.Text, out outResult) == false) { errorProvider1.SetError(txtpriceMJ, "请重新填写"); return(false); } _model.PriceMJ = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtFOB.Text) && decimal.TryParse(txtFOB.Text, out outResult) == false) { errorProvider1.SetError(txtFOB, "请重新填写"); return(false); } _model.FOB = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtCFR.Text) && decimal.TryParse(txtCFR.Text, out outResult) == false) { errorProvider1.SetError(txtCFR, "请重新填写"); return(false); } _model.CFR = outResult; _model.AnalysisUnit = txtAnalysisUnit.Text; _model.AnalysisAddress = txtAnalysisAddress.Text; _model.AnalysisWebsite = txtAnalysisWebsite.Text; _model.ReportingTime = dtpReportingTime.Value; _model.Telephone = txtTelephone.Text; _model.Mailbox = txtMailbox.Text; _model.ReportAddress = txtReportAddress.Text; _model.Fax = txtFax.Text; _model.ProductionProcess = txtProductionProcess.Text; _model.StartingCountry = cmbStartingCountry.Text; _model.StartingCity = txtStartingCity.Text; _model.DestinationCountry = cmbDestinationCountry.Text; _model.DestinationCity = txtDestinationCity.Text; _model.ForwardingUnit = txtforwardingUnit.Text; _model.TestTime = dtpTestTime.Value; _model.CheckAddress = txtCheckAddress.Text; _model.SamplingContent = txtSamplingContent.Text; _model.InspectionUnit = txtInspectionUnit.Text; outResult = 0M; if (!string.IsNullOrEmpty(txtSGS_TVN.Text) && decimal.TryParse(txtSGS_TVN.Text, out outResult) == false) { errorProvider1.SetError(txtSGS_TVN, "请重新填写"); return(false); } _model.SGS_TVN = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtSGS_Sand.Text) && decimal.TryParse(txtSGS_Sand.Text, out outResult) == false) { errorProvider1.SetError(txtSGS_Sand, "请重新填写"); return(false); } _model.SGS_Sand = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtSGS_Histamine.Text) && decimal.TryParse(txtSGS_Histamine.Text, out outResult) == false) { errorProvider1.SetError(txtSGS_Histamine, "请重新填写"); return(false); } _model.SGS_Histamine = outResult; _model.WeighingMethod = txtWeighingMethod.Text; outResult = 0M; if (!string.IsNullOrEmpty(txtAverageNetWeight.Text) && decimal.TryParse(txtAverageNetWeight.Text, out outResult) == false) { errorProvider1.SetError(txtAverageNetWeight, "请重新填写"); return(false); } _model.AverageNetWeight = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtAverageSkinWeight.Text) && decimal.TryParse(txtAverageSkinWeight.Text, out outResult) == false) { errorProvider1.SetError(txtAverageSkinWeight, "请重新填写"); return(false); } _model.AverageSkinWeight = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtTotalWeight.Text) && decimal.TryParse(txtTotalWeight.Text, out outResult) == false) { errorProvider1.SetError(txtTotalWeight, "请重新填写"); return(false); } _model.TotalWeight = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtTotalSkinWeight.Text) && decimal.TryParse(txtTotalSkinWeight.Text, out outResult) == false) { errorProvider1.SetError(txtTotalSkinWeight, "请重新填写"); return(false); } _model.TotalSkinWeight = outResult; _model.FumigationAddress = txtFumigationAddress.Text; _model.ChemicalConcentration = txtChemicalConcentration.Text; _model.FumigationDate = dtpFumigationDate.Value; _model.FumigationTime = dtpFumigationTime.Text; _model.FumigatingTemperature = txtFumigatingTemperature.Text; outResult = 0M; if (!string.IsNullOrEmpty(txtLabel_Antioxidant.Text) && decimal.TryParse(txtLabel_Antioxidant.Text, out outResult) == false) { errorProvider1.SetError(txtLabel_Antioxidant, "请重新填写"); return(false); } _model.Label_Antioxidant = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtQuote_FFA.Text) && decimal.TryParse(txtQuote_FFA.Text, out outResult) == false) { errorProvider1.SetError(txtQuote_FFA, "请重新填写"); return(false); } _model.Quote_FFA = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtQuote_SandSalt.Text) && decimal.TryParse(txtQuote_SandSalt.Text, out outResult) == false) { errorProvider1.SetError(txtQuote_SandSalt, "请重新填写"); return(false); } _model.Quote_SandSalt = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtQuote_Sand.Text) && decimal.TryParse(txtQuote_Sand.Text, out outResult) == false) { errorProvider1.SetError(txtQuote_Sand, "请重新填写"); return(false); } _model.Quote_Sand = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtContractAntioxidant.Text) && decimal.TryParse(txtContractAntioxidant.Text, out outResult) == false) { errorProvider1.SetError(txtContractAntioxidant, "请重新填写"); return(false); } _model.ContractAntioxidant = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtLabel_Protein.Text) && decimal.TryParse(txtLabel_Protein.Text, out outResult) == false) { errorProvider1.SetError(txtLabel_Protein, "请重新填写"); return(false); } _model.Label_Protein = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtLabel_Water.Text) && decimal.TryParse(txtLabel_Water.Text, out outResult) == false) { errorProvider1.SetError(txtLabel_Water, "请重新填写"); return(false); } _model.Label_Water = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtLabel_Fat.Text) && decimal.TryParse(txtLabel_Fat.Text, out outResult) == false) { errorProvider1.SetError(txtLabel_Fat, "请重新填写"); return(false); } _model.Label_Fat = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtLabel_FFA.Text) && decimal.TryParse(txtLabel_FFA.Text, out outResult) == false) { errorProvider1.SetError(txtLabel_FFA, "请重新填写"); return(false); } _model.Label_FFA = outResult; outResult = 0M; if (!string.IsNullOrEmpty(txtLabel_SandSalt.Text) && decimal.TryParse(txtLabel_SandSalt.Text, out outResult) == false) { errorProvider1.SetError(txtLabel_SandSalt, "请重新填写"); return(false); } _model.Label_SandSalt = outResult; return(true); }