public FishEntity.SalesRequisitionEntity GetModelzy(string codeNum) { StringBuilder strSql = new StringBuilder(); strSql.Append("select Numbering,rabZy from t_salesorder "); strSql.AppendFormat(" where {0} ", codeNum); DataSet ds = MySqlHelper.Query(strSql.ToString()); if (ds.Tables[0].Rows.Count > 0) { FishEntity.SalesRequisitionEntity model = new FishEntity.SalesRequisitionEntity(); if (ds.Tables[0].Rows[0] != null) { DataRow row = ds.Tables[0].Rows[0]; if (row["Numbering"] != null) { model.Numbering = row["Numbering"].ToString(); } if (row["rabZy"] != null && row["rabZy"].ToString() != "") { model.RabZy = bool.Parse(row["rabZy"].ToString()); } } return(model); } else { return(null); } }
public override int Add() { panel1.Enabled = true; tmiSave.Visible = true; tmiClose.Visible = true; tmiCancel.Visible = true; tmiDelete.Visible = false; tmiReview.Visible = false; tmiAdd.Visible = false; tmiModify.Visible = false; tmiQuery.Visible = false; txtcode.Text = string.Empty; txtremarks.Text = string.Empty; txtConfirmTheWeight.Text = string.Empty; if (getname != "") { FishBll.Bll.SalerequisitionBll getbll = new FishBll.Bll.SalerequisitionBll(); FishEntity.SalesRequisitionEntity _fish1 = new FishEntity.SalesRequisitionEntity(); _fish1 = getbll.Getname(getname); if (_fish1 != null) { txtNumbering.Text = _fish1.Numbering; txtCodeOdd.Text = _fish1.code; txtFishMealId.Text = _fish1.Product_id; } } return(1); }
public override int Add() { tmiQuery.Visible = false; tmiDelete.Visible = false; tmiModify.Visible = false; tmiAdd.Visible = false; tmiSave.Visible = true; tmiCancel.Visible = true; panel1.Enabled = true; txtcode.Text = string.Empty; dtpoccurDate.Value = DateTime.Now; txtEventName.Text = string.Empty; txtSolvTtheProblem.Text = string.Empty; txtRemarks.Text = string.Empty; txtContractNo.Text = string.Empty; txtFishMealId.Text = string.Empty; if (getname != "") { FishBll.Bll.SalerequisitionBll _bll1 = new FishBll.Bll.SalerequisitionBll(); FishEntity.SalesRequisitionEntity _fish1 = new FishEntity.SalesRequisitionEntity(); _fish1 = _bll1.Getname(getname); if (_fish1 != null) { txtCodeOdd.Text = _fish1.code; txtNumbering.Text = _fish1.Numbering; txtFishMealId.Text = _fish1.Product_id; } } return(1); }
private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex < 0) { return; } _fish = new FishEntity.SalesRequisitionEntity(); if (dataGridView1.CurrentRow == null) { return; } if (dataGridView1.Rows[e.RowIndex].Cells["code"].Value != null) { _fish.code = dataGridView1.Rows[e.RowIndex].Cells["code"].Value.ToString(); _fish.rebate = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["rebate"].Value.ToString()); _fish.HeTongDanJia = dataGridView1.Rows[e.RowIndex].Cells["unitprice"].Value.ToString(); _fish.Freight = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["Freight"].Value.ToString()); _fish.demand = dataGridView1.Rows[e.RowIndex].Cells["demand"].Value.ToString(); _fish.Purchasingunits = dataGridView1.Rows[e.RowIndex].Cells["Purchasingunits"].Value.ToString(); _fish.Purchasecontractnumber = dataGridView1.Rows[e.RowIndex].Cells["Purchasecontractnumber"].Value.ToString(); _fish.accountnumber = dataGridView1.Rows[e.RowIndex].Cells["accountnumber"].Value.ToString(); _fish.Bank = dataGridView1.Rows[e.RowIndex].Cells["Bank"].Value.ToString(); _fish.supplier = dataGridView1.Rows[e.RowIndex].Cells["supplier"].Value.ToString(); _fish.SupplierContact = dataGridView1.Rows[e.RowIndex].Cells["SupplierContact"].Value.ToString(); _fish.supplierId = dataGridView1.Rows[e.RowIndex].Cells["supplierId"].Value.ToString(); _fish.SupplierContactId = dataGridView1.Rows[e.RowIndex].Cells["SupplierContactId"].Value.ToString(); _fish.demandId = dataGridView1.Rows[e.RowIndex].Cells["demandId"].Value.ToString(); _fish.DemandContact = dataGridView1.Rows[e.RowIndex].Cells["DemandContact"].Value.ToString(); _fish.DemandContactId = dataGridView1.Rows[e.RowIndex].Cells["DemandContactId"].Value.ToString(); _fish.Purchasingcontacts = dataGridView1.Rows[e.RowIndex].Cells["Purchasingcontacts"].Value.ToString(); _fish.PurchasingcontactsId = dataGridView1.Rows[e.RowIndex].Cells["PurchasingcontactsId"].Value.ToString(); _fish.PurchasingunitsId = dataGridView1.Rows[e.RowIndex].Cells["PurchasingunitsId"].Value.ToString(); } this.DialogResult = System.Windows.Forms.DialogResult.OK; }
public override int Add() { panel1.Enabled = true; tmiSave.Visible = true; tmiClose.Visible = true; tmiCancel.Visible = true; tmiDelete.Visible = false; tmiReview.Visible = false; tmiAdd.Visible = false; tmiModify.Visible = false; tmiQuery.Visible = false; txtcode.Text = string.Empty; txtsponsor.Text = FishEntity.Variable.User.username; txtacceptor.Text = string.Empty; txtprocessresult.Text = string.Empty; txtevaluation.Text = string.Empty; txtattendance.Text = string.Empty; txtreview.Text = string.Empty; txtremarks.Text = string.Empty; txtConfirmTheWeight.Text = string.Empty; if (getname != "") { FishBll.Bll.SalerequisitionBll getbll = new FishBll.Bll.SalerequisitionBll(); FishEntity.SalesRequisitionEntity _fish1 = new FishEntity.SalesRequisitionEntity(); _fish1 = getbll.Getname(getname); if (_fish1 != null) { txtNumbering.Text = _fish1.Numbering; txtCodeOdd.Text = _fish1.code; } } return(1); }
public FishEntity.SalesRequisitionEntity getTHD(string getname) { StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT a.Numbering,c.product_id,a.code,demand,demandId,b.Variety,cm,zjh,tdh,c.Quantity FROM t_salesorder a LEFT JOIN t_purchaserequisition b ON a.Purchasecontractnumber = b.ContractNo LEFT JOIN t_happening c on a.Numbering=c.NumberingOne "); strSql.Append("where a.Numbering= '" + getname + "'"); DataSet ds = MySqlHelper.Query(strSql.ToString()); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { FishEntity.SalesRequisitionEntity model = new FishEntity.SalesRequisitionEntity(); DataRow row = ds.Tables[0].Rows[0]; if (row["Numbering"] != null) { model.Numbering = row["Numbering"].ToString(); } if (row["code"] != null) { model.code = row["code"].ToString(); } if (row["product_id"] != null) { model.Product_id = row["product_id"].ToString(); } if (row["demand"] != null) { model.demand = row["demand"].ToString(); } if (row["demandId"] != null) { model.demandId = row["demandId"].ToString(); } if (row["Variety"] != null) { model.Variety = row["Variety"].ToString(); } if (row["cm"] != null) { model.cm = row["cm"].ToString(); } if (row["Quantity"] != null) { model.Quantity = row["Quantity"].ToString(); } if (row["zjh"] != null) { model.zjh = row["zjh"].ToString(); } if (row["tdh"] != null) { model.tdh = row["tdh"].ToString(); } return(model); } else { return(null); } }
public override int Add( ) { panel1.Enabled = true; txtOddNum.Text = _bll.getCode( ); txtDepartMent.SelectedValue = false; txtPayCode.Text = string.Empty; txtNumbering.Text = string.Empty; dtpPayment.Value = DateTime.Now; txtPayAcount.Text = string.Empty; txtPayUnit.Text = string.Empty; txtPayUnit.Tag = string.Empty; txtcontacts.Text = string.Empty; txtcontacts.Tag = string.Empty; txtbackDeposit.Text = string.Empty; txtprice.Text = string.Empty; txtweight.Text = string.Empty; txtPurchasingUnit.Text = string.Empty; txtPurchasingUnit.Tag = string.Empty; txtapplyMoney.Text = string.Empty; inputRMB.Text = string.Empty; dtpDate.Value = DateTime.Now; txtRemark.Text = string.Empty; texOther.Text = string.Empty; txtpurchasecode.Text = string.Empty; rabYuFu.Checked = rabQuanKuan.Checked = rabWeiKuan.Checked = rabGongZhang.Checked = rabSiZhang.Checked = rabChengDui.Checked = rabXianJin.Checked = rabQiTa.Checked = rabZZSFP.Checked = rabPTFP.Checked = rabSJ.Checked = false; tmiQuery.Visible = false; tmiAdd.Visible = false; tmiModify.Visible = false; tmiDelete.Visible = false; tmiClose.Visible = false; tmiSave.Visible = true; tmiCancel.Visible = true; tmiExport.Visible = false; tmiNext.Visible = false; tmiPrevious.Visible = false; state = "add"; _model = _bll.getXSSQD(_getname); if (_model != null) { txtPayCode.Text = _model.code; txtNumbering.Text = _model.Numbering; txtPayUnit.Text = _model.demand; txtPayUnit.Tag = _model.demandId; txtcontacts.Text = _model.DemandContact; txtcontacts.Tag = _model.DemandContactId; txtpurchasecode.Text = _model.Purchasecontractnumber; txtPurchasingUnit.Text = _model.Purchasingunits; txtPurchasingUnit.Tag = _model.PurchasingunitsId; txtPayAcount.Text = _model.accountnumber.ToString(); txtbackDeposit.Text = _model.Bank; txtprice.Text = _model.UnitPrice; } return(base.Add( )); }
private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex < 0) return; _fish = new FishEntity.SalesRequisitionEntity(); if (dataGridView1.CurrentRow == null) { return; } if (dataGridView1.Rows[e.RowIndex].Cells["code"].Value != null) { _fish.code = dataGridView1.Rows[e.RowIndex].Cells["code"].Value.ToString(); _fish.rebate = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["rebate"].Value.ToString()); _fish.HeTongDanJia = dataGridView1.Rows[e.RowIndex].Cells["unitprice"].Value.ToString(); _fish.Freight = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["Freight"].Value.ToString()); _fish.demand = dataGridView1.Rows[e.RowIndex].Cells["demand"].Value.ToString(); _fish.Purchasingunits = dataGridView1.Rows[e.RowIndex].Cells["Purchasingunits"].Value.ToString(); _fish.Purchasecontractnumber = dataGridView1.Rows[e.RowIndex].Cells["Purchasecontractnumber"].Value.ToString(); _fish.accountnumber = dataGridView1.Rows[e.RowIndex].Cells["accountnumber"].Value.ToString(); _fish.Bank = dataGridView1.Rows[e.RowIndex].Cells["Bank"].Value.ToString(); _fish.supplier = dataGridView1.Rows[e.RowIndex].Cells["supplier"].Value.ToString(); _fish.SupplierContact = dataGridView1.Rows[e.RowIndex].Cells["SupplierContact"].Value.ToString(); _fish.supplierId = dataGridView1.Rows[e.RowIndex].Cells["supplierId"].Value.ToString(); _fish.SupplierContactId = dataGridView1.Rows[e.RowIndex].Cells["SupplierContactId"].Value.ToString(); _fish.demandId = dataGridView1.Rows[e.RowIndex].Cells["demandId"].Value.ToString(); _fish.DemandContact = dataGridView1.Rows[e.RowIndex].Cells["DemandContact"].Value.ToString(); _fish.DemandContactId = dataGridView1.Rows[e.RowIndex].Cells["DemandContactId"].Value.ToString(); _fish.Purchasingcontacts = dataGridView1.Rows[e.RowIndex].Cells["Purchasingcontacts"].Value.ToString(); _fish.PurchasingcontactsId = dataGridView1.Rows[e.RowIndex].Cells["PurchasingcontactsId"].Value.ToString(); _fish.PurchasingunitsId = dataGridView1.Rows[e.RowIndex].Cells["PurchasingunitsId"].Value.ToString(); _fish.CNumbering = dataGridView1.Rows[e.RowIndex].Cells["CNumbering"].Value.ToString(); _fish.Numbering = dataGridView1.Rows[e.RowIndex].Cells["Numbering"].Value.ToString(); _fish.Product_id = dataGridView1.Rows[e.RowIndex].Cells["product_id"].Value.ToString(); _fish.Country = dataGridView1.Rows[e.RowIndex].Cells["Country"].Value.ToString(); _fish.pp = dataGridView1.Rows[e.RowIndex].Cells["pp"].Value.ToString(); _fish.Productname = dataGridView1.Rows[e.RowIndex].Cells["productname"].Value.ToString(); _fish.Funit = dataGridView1.Rows[e.RowIndex].Cells["Funit"].Value.ToString(); _fish.Variety = dataGridView1.Rows[e.RowIndex].Cells["Variety"].Value.ToString(); _fish.Quantity = dataGridView1.Rows[e.RowIndex].Cells["Quantity"].Value.ToString(); _fish.Amonut = dataGridView1.Rows[e.RowIndex].Cells["amonut"].Value.ToString(); _fish.DemandAbbreviation = dataGridView1.Rows[e.RowIndex].Cells["XFshortname"].Value.ToString(); _fish.SupplierAbbreviation = dataGridView1.Rows[e.RowIndex].Cells["GFshortname"].Value.ToString(); _fish . MoneyYFK = dataGridView1 . Rows [ e . RowIndex ] . Cells [ "moneyYFK" ] . Value == null ? 0 : ( string . IsNullOrEmpty ( dataGridView1 . Rows [ e . RowIndex ] . Cells [ "moneyYFK" ] . Value . ToString ( ) ) == true ? 0 : Convert . ToDecimal ( dataGridView1 . Rows [ e . RowIndex ] . Cells [ "moneyYFK" ] . Value ) ); _fish .delivery = dataGridView1.Rows[e.RowIndex].Cells["delivery"].Value.ToString(); _fish.Db = dataGridView1.Rows[e.RowIndex].Cells["db"].Value.ToString(); _fish.Za = dataGridView1.Rows[e.RowIndex].Cells["za"].Value.ToString(); _fish.Sz = dataGridView1.Rows[e.RowIndex].Cells["sz"].Value.ToString(); _fish.Tvn = dataGridView1.Rows[e.RowIndex].Cells["tvn"].Value.ToString(); _fish.Hf = dataGridView1.Rows[e.RowIndex].Cells["Hf"].Value.ToString(); _fish.Sf = dataGridView1.Rows[e.RowIndex].Cells["Sf"].Value.ToString(); _fish.Shy = dataGridView1.Rows[e.RowIndex].Cells["Shy"].Value.ToString(); _fish.Zf = dataGridView1.Rows[e.RowIndex].Cells["Zf"].Value.ToString(); } this.DialogResult = System.Windows.Forms.DialogResult.OK; }
public override int Add( ) { clearControl( ); txtcode.Text = _bll.getCode( ); if (getname != null && getname != "") { FishEntity.SalesRequisitionEntity _model = new FishEntity.SalesRequisitionEntity(); _bll = new FishBll.Bll.ReturnReceiptBll(); _model = _bll.getTHD(getname); if (_model != null) {//22 txtcodeNumContract.Text = _model.code; txtreturnParty.Text = _model.demand; txtreturnParty.Tag = _model.demandId; txtreturnPartyJ.Text = _model.DemandAbbreviation; txtreceive.Text = _model.supplier; txtreceiveJ.Text = _model.SupplierAbbreviation; txtreceive.Tag = _model.supplierId; txtfishId.Text = _model.Product_id; txtcodeNum.Text = _model.Numbering; txtcountry.Text = _model.Country; txtbrand.Text = _model.pp; txtspeci.Text = _model.Funit; txtproName.Text = _model.Productname; txtcondb.Text = _model.Db; txtconza.Text = _model.Za; txtcons.Text = _model.Sz; txtcontvn.Text = _model.Tvn; txtconhf.Text = _model.Hf; txtconsf.Text = _model.Sf; txtconshy.Text = _model.Shy; txtconzf.Text = _model.Zf; txtprice.Text = _model.HeTongDanJia; txtdeliAdd.Text = _model.delivery; if (_model.RabZy == true) { rabchengpin.Visible = false; } panel1.Enabled = true; } if (getname != null && getname != "") { FishEntity.OnepoundEntity _modeloo = new FishEntity.OnepoundEntity(); _bll = new FishBll.Bll.ReturnReceiptBll(); _modeloo = _bll.getjingz(getname); if (_modeloo != null) { txtShipmentsTons.Text = _modeloo.Competition; } } } tmiSave.Visible = true; return(base.Add( )); }
public override int Add() { tmiQuery.Visible = false; tmiDelete.Visible = false; tmiModify.Visible = false; tmiAdd.Visible = false; tmiSave.Visible = true; tmiCancel.Visible = true; panel1.Enabled = true; txtcode.Text = string.Empty; txtFishMealId.Text = string.Empty; cmbCountry.SelectedValue = string.Empty; cmbBrands.SelectedValue = string.Empty; cmbspecies.SelectedValue = string.Empty; cmbspecification.SelectedValue = string.Empty; dtpIssuingtime.Value = DateTime.Now; txtcontactsunit.Text = string.Empty; txtcontactsunit.Tag = string.Empty; txtwarehouse.Text = string.Empty; txtferryname.Text = string.Empty; txtlistname.Text = string.Empty; txtcornerno.Text = string.Empty; txtTon.Text = string.Empty; txtRedemptionWeight.Text = string.Empty; txtpackagenumber.Text = string.Empty; txtRemarks.Text = string.Empty; txtSerialNumber.Text = string.Empty; txtShipNotice.Text = string.Empty; txtStoragecosts.Text = string.Empty; txtCodeOdd.Text = string.Empty; txtRecipient.Text = string.Empty; if (getname != "") { getfish = _bll.getDHT(getname); if (getfish != null) { txtNumbering.Text = getfish.Numbering; txtcontactsunit.Text = getfish.demand; txtcontactsunit.Tag = getfish.demandId; txtlistname.Text = getfish.tdh; txtCodeOdd.Text = getfish.code; txtTon.Text = getfish.Quantity; txtcornerno.Text = getfish.zjh; cmbspecies.SelectedValue = getfish.Variety; txtferryname.Text = getfish.cm; txtFishMealId.Text = getfish.Product_id; } } return(1); }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex < 0 || e.RowIndex < 0) { return; } bool isOk = true; if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("product_id", StringComparison.OrdinalIgnoreCase) == true) { FormSalesTables form = new FormSalesTables(); if (form.ShowDialog() != DialogResult.OK) { return; } FishEntity.SalesRequisitionEntity head = form.fish; if (head == null) { return; } for (int i = 0; i < dataGridView1.Rows.Count - 1; i++) { //if (!string.IsNullOrEmpty(dataGridView1.Rows[i].Cells["product_id"].Value.ToString()) && dataGridView1.Rows[i].Cells["product_id"].Value.ToString() == head.Product_id) //{ if (i != e.RowIndex) { isOk = false; break; } //} } if (isOk == false) { return; } dataGridView1.Rows[e.RowIndex].Cells["product_id"].Value = head.Product_id; dataGridView1.Rows[e.RowIndex].Cells["productname"].Value = head.Productname; dataGridView1.Rows[e.RowIndex].Cells["Funit"].Value = head.Funit; dataGridView1.Rows[e.RowIndex].Cells["Variety"].Value = head.Variety; dataGridView1.Rows[e.RowIndex].Cells["Quantity"].Value = head.Quantity; dataGridView1.Rows[e.RowIndex].Cells["unitprice"].Value = head.UnitPrice; dataGridView1.Rows[e.RowIndex].Cells["amonut"].Value = head.Amonut; } }
public override int Add( ) { txtOddNum.Text = _bll.GetCode( ); panel1.Enabled = true; tmiQuery.Visible = false; tmiAdd.Visible = false; tmiModify.Visible = false; tmiDelete.Visible = false; tmiClose.Visible = false; tmiSave.Visible = true; tmiCancel.Visible = true; tmiExport.Visible = false; //tmiNext . Visible = false; //tmiPrevious . Visible = false; AddSet(); state = "add"; if (getname != "") { FishEntity.SalesRequisitionEntity _model = new FishEntity.SalesRequisitionEntity(); _bll = new FishBll.Bll.ReceiptRecordBll(); _model = _bll.getFKSQD(getname); if (_model != null) { txtNumbering.Text = _model.Numbering; txtCodeOdd.Text = _model.code; txtDemaUndnit.Text = _model.demand; txtDemaUndnit.Tag = _model.demandId; txtDemandSideContact.Text = _model.DemandContact; txtDemandSideContact.Tag = _model.DemandContactId; txtPrice.Text = _model.Portprice.ToString(); txtGoodsPrice.Text = _model.Portprice.ToString(); txtFreight.Text = _model.Freight.ToString(); txtRebate.Text = _model.rebate.ToString(); txtCompany.Text = _model.supplier; txtCompany.Tag = _model.supplierId; txtANum.Text = _model.accountnumber; txtFishMealId.Text = _model.Product_id; } } return(base.Add( )); }
void GenerateContect( ) { result = _bll.Exist(txtNumbering.Text); if (result == true) { _rolewhere += " Numbering= '" + txtNumbering.Text + "' "; if (FishEntity.Variable.User.roletype.Equals(FishEntity.Constant.Role_SalesMan)) { _rolewhere += string.Format(" and createman='{0}' ", FishEntity.Variable.User.username); } FishEntity.SalesRequisitionEntity _list = _bll.GetList(_rolewhere); if (_list == null) { return; } headSetValue(_list); } else { MessageBox.Show("编号:" + txtNumbering.Text + "不存在,请核实"); } }
void headSetValue(FishEntity.SalesRequisitionEntity _list) { txtcode.Text = _list.code; txtsupplier.Text = _list.supplier; txtsupplier.Tag = _list.supplierId; txtdemand.Text = _list.demand; txtdemand.Tag = _list.demandId; txtSignplace.Text = _list.Signplace; if (_list.Signdate != null) { dtpSigndate.Value = DateTime.Parse(_list.Signdate.ToString( )); } if (_list.rebateBool == true) { //labrebateBool . Visible = true; //texrebate . Visible = true; //texrebate . Text = _list . rebate . ToString ( ); } else { //labrebateBool . Visible = false; //texrebate . Visible = false; } if (_list.Freightbool == true) { labFreightBool.Visible = true; texFreight.Visible = true; texFreight.Text = _list.Freight.ToString(); } else { labFreightBool.Visible = false; texFreight.Visible = false; } if (_list.PortpriceBool == true) { labPortpriceBool.Visible = true; texPortprice.Visible = true; texPortprice.Text = _list.Portprice.ToString( ); } else { labPortpriceBool.Visible = false; texPortprice.Visible = false; } if (_list.WithSkinbool == true) { labWithSkinBool.Visible = true; texWithSkin.Visible = true; texWithSkin.Text = _list.WithSkin.ToString(); } else { labWithSkinBool.Visible = false; texWithSkin.Visible = false; } if (_list.Stockpilebool == true) { labelStockpilebool.Visible = true; texdt.Visible = true; labeldty.Visible = true; texdt.Text = _list.dt.ToString(); } else { labelStockpilebool.Visible = false; texdt.Visible = false; labeldty.Visible = false; texdt.Text = _list.dt.ToString(); } if (_list.Informationbool == true) { } texDeliveryPlace.Text = _list.delivery; textransport.Text = _list.transport; texDeliveryDeadline.Text = _list.deadline.ToString( ); texBanDan.Text = _list.Settlementmethod; texOpenbank.Text = _list.Bank; texCollectUnit.Text = _list.Receipt; texAcountNum.Text = _list.accountnumber.ToString( ); gnjc = _list.deIndex; setbool = _list; }
void setValue( ) { txtcode.Text = _model.code; txtcodeNum.Text = _model.codeNum; txtcodeNumContract.Text = _model.codeNumContract; txtreturnParty.Text = _model.returnParty; txtreturnPartyJ.Text = _model.returnPartyJ; txtreceive.Text = _model.receive; txtreceiveJ.Text = _model.receiveJ; if (_model.duanxuan == "自营") { rabziying.Checked = true; } else if (_model.duanxuan == "自制") { rabzizhi.Checked = true; } else if (_model.duanxuan == "成品") { rabchengpin.Checked = true; } if (_model.signDate > DateTime.MinValue && _model.signDate < DateTime.MaxValue) { txtsignDate.Value = Convert.ToDateTime(_model.signDate); } _model.varieties = txtvarieties.Text; txtproName.Text = _model.proName; txtspeci.Text = _model.speci; txttons.Text = _model.tons.ToString( ); txtShipmentsTons.Text = _model.ShipmentsTons.ToString(); txtLiNumber.Text = _model.LiNumber.ToString(); txtprice.Text = _model.price.ToString( ); txtmoney.Text = _model.money.ToString( ); txtcountry.Text = _model.country; txtbrand.Text = _model.brand; txtdeliAdd.Text = _model.deliAdd; txtfishId.Text = _model.fishId; txtfreight.Text = _model.freight.ToString( ); txtcost.Text = _model.cost.ToString( ); txtloss.Text = _model.loss.ToString( ); txtcondb.Text = _model.condb; txtconza.Text = _model.conza; txtcons.Text = _model.cons; txtcontvn.Text = _model.contvn; txtconhf.Text = _model.conhf; txtconsf.Text = _model.consf; txtconshy.Text = _model.conshy; txtconzf.Text = _model.conzf; txtreturnGoodsAdd.Text = _model.returnGoodsAdd; txtremark.Text = _model.remark; panel1.Enabled = true; if (txtcodeNum.Text != "") { FishEntity.SalesRequisitionEntity mo = null; mo = _bll.GetModelzy(" Numbering = '" + txtcodeNum.Text + "'"); if (mo != null) { if (mo.RabZy == true) { rabchengpin.Enabled = false; rabchengpin.Checked = false; } } } }
/// <summary> /// 新增一单记录 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool Add(FishEntity.SalesRequisitionEntity model, List <FishEntity.SalesRequisitionBodyEntity> modeList) { return(dal.Add(model, modeList)); }
public override int Add( ) { panel1.Enabled = true; txtOddNum.Text = _bll.getCode( ); txtDepartMent.SelectedValue = false; txtPayCode.Text = string.Empty; txtNumbering.Text = string.Empty; dtpPayment.Value = DateTime.Now; txtPayAcount.Text = string.Empty; txtPayUnit.Text = string.Empty; txtPayUnit.Tag = string.Empty; txtcontacts.Text = string.Empty; txtcontacts.Tag = string.Empty; txtbackDeposit.Text = string.Empty; txtprice.Text = string.Empty; txtweight.Text = string.Empty; txtFishMealId.Text = string.Empty; txtPurchasingUnit.Text = string.Empty; txtPurchasingUnit.Tag = string.Empty; txtapplyMoney.Text = string.Empty; inputRMB.Text = string.Empty; dtpDate.Value = DateTime.Now; txtRemark.Text = string.Empty; texOther.Text = string.Empty; txtpurchasecode.Text = string.Empty; txtCNumbering.Text = string.Empty; txtBond.Text = string.Empty; rabBaoZheng.Checked = rabHuoKuan.Checked = rabYuFu.Checked = rabQuanKuan.Checked = rabWeiKuan.Checked = rabGongZhang.Checked = rabSiZhang.Checked = rabChengDui.Checked = rabXianJin.Checked = rabQiTa.Checked = rabZZSFP.Checked = rabPTFP.Checked = rabSJ.Checked = false; tmiQuery.Visible = false; tmiAdd.Visible = false; tmiModify.Visible = false; tmiDelete.Visible = false; tmiClose.Visible = false; tmiSave.Visible = true; tmiCancel.Visible = true; tmiExport.Visible = false; tmiNext.Visible = false; tmiPrevious.Visible = false; state = "add"; if (XCNumbering == "X") { _model = _bll.getXSSQD(_getname); if (_model != null) { txtPayCode.Text = _model.code; txtFishMealId.Text = _model.Product_id; txtNumbering.Text = _model.Numbering; txtPayUnit.Text = _model.demand; txtPayUnit.Tag = _model.demandId; txtcontacts.Text = _model.DemandContact; txtcontacts.Tag = _model.DemandContactId; txtpurchasecode.Text = _model.Purchasecontractnumber; txtPurchasingUnit.Text = _model.Purchasingunits; txtPurchasingUnit.Tag = _model.PurchasingunitsId; txtPayAcount.Text = _model.accountnumber.ToString(); txtbackDeposit.Text = _model.Bank; txtCNumbering.Text = _model.CNumbering; } } else if (XCNumbering == "C") { FishEntity.PurcurementContractEntity getmodel = new FishEntity.PurcurementContractEntity(); FishBll.Bll.PurchaseApplicationBll getbll = new FishBll.Bll.PurchaseApplicationBll(); getmodel = getbll.getCGSQD(" where a.codenum='" + _getname + "' "); if (getmodel != null) { //txtFishMealId.Text=getmodel. txtBond.Text = getmodel.bondPro.ToString(); txtpurchasecode.Text = getmodel.codeNumContract; txtPurchasingUnit.Text = getmodel.supplier; txtCNumbering.Text = getmodel.codeNum; txtPayAcount.Text = getmodel.Account; txtbackDeposit.Text = getmodel.Bank; } } return(base.Add( )); }
public override int Add() { tmiQuery.Visible = false; tmiDelete.Visible = false; tmiModify.Visible = false; tmiAdd.Visible = false; tmiSave.Visible = true; tmiCancel.Visible = true; cmbspecies.SelectedValue = string.Empty; txtRemarks.Text = string.Empty; txtshipno.Text = string.Empty; txtCode.Text = string.Empty; dtpfactureDate.Value = DateTime.Now;//出 dtpfactoryDate.Value = DateTime.Now; txtCarnumber.Text = string.Empty; txtGrossweight.Text = string.Empty; txtTareweight.Text = string.Empty; txtCompetition.Text = string.Empty; txtOwner.Text = string.Empty; txtAddress.Text = string.Empty; Serialnumber.Text = string.Empty; cmbCountry.SelectedValue = string.Empty; cmbName.SelectedValue = string.Empty; txtSpecification.Text = string.Empty; Buyers.Text = string.Empty; Sellers.Text = string.Empty; txtOwner.Tag = string.Empty; Buyers.Tag = string.Empty; Sellers.Tag = string.Empty; Quantity.Text = string.Empty; Pileangle.Text = string.Empty; BillOfLadingid.Text = string.Empty; txtCodeOdd.Text = string.Empty; if (getname != "") { model = _bll.getBT(getname); if (model != null) { txtNumbering.Text = model.Numbering; txtCodeOdd.Text = model.code; Buyers.Text = model.Purchasingunits; Buyers.Tag = model.PurchasingunitsId; Sellers.Text = model.demand; Sellers.Tag = model.demandId; BillOfLadingid.Text = model.tdh; Pileangle.Text = model.zjh; txtshipno.Text = model.cm; cmbspecies.SelectedValue = model.Goods; cmbCountry.SelectedValue = model.Country; cmbName.SelectedValue = model.pp; } else { tmiAdd.Visible = false; tmiSave.Visible = false; tmiCancel.Visible = false; } } panel1.Enabled = true; return(1); }
public FishEntity.SalesRequisitionEntity getFKSQD(string getname) { StringBuilder strSql = new StringBuilder(); strSql.Append("select a.code,a.Numbering,a.demand,a.demandId,a.DemandContact,a.DemandContactId,a.supplier,a.supplierId,a.accountnumber,a.Freight,a.rebate,b.unitprice from t_salesorder a inner join t_happening b on a.Numbering=b.NumberingOne "); strSql.Append("where a.Numbering= '" + getname + "'"); DataSet ds = MySqlHelper.Query(strSql.ToString()); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { FishEntity.SalesRequisitionEntity model = new FishEntity.SalesRequisitionEntity(); DataRow row = ds.Tables[0].Rows[0]; if (row["Numbering"] != null) { model.Numbering = row["Numbering"].ToString(); } if (row["code"] != null) { model.code = row["code"].ToString(); } if (row["demand"] != null) { model.demand = row["demand"].ToString(); } if (row["demandId"] != null) { model.demandId = row["demandId"].ToString(); } if (row["DemandContact"] != null) { model.DemandContact = row["DemandContact"].ToString(); } if (row["DemandContactId"] != null) { model.DemandContactId = row["DemandContactId"].ToString(); } if (row["supplier"] != null) { model.supplier = row["supplier"].ToString(); } if (row["supplierId"] != null) { model.supplierId = row["supplierId"].ToString(); } if (row["accountnumber"] != null) { model.accountnumber = row["accountnumber"].ToString(); } if (row["Freight"] != null && row["Freight"].ToString() != "") { model.Freight = decimal.Parse(row["Freight"].ToString()); } if (row["rebate"] != null && row["rebate"].ToString() != "") { model.rebate = decimal.Parse(row["rebate"].ToString()); } if (row["unitprice"] != null && row["unitprice"].ToString() != "") { model.Portprice = decimal.Parse(row["unitprice"].ToString()); } return(model); } else { return(null); } }
public FishEntity.SalesRequisitionEntity getBT(string getname) { StringBuilder strSql = new StringBuilder(); strSql.Append("select a.Numbering,a.code,a.demand,a.demandId,a.Purchasingunits,a.PurchasingunitsId,b.pp,b.Country,listname,Species,Cornerno,ferryname from t_salesorder a inner join t_happening b on a.Numbering =b.NumberingOne inner join t_billoflading c on a.Numbering=c.Numbering "); strSql.Append("where a.Numbering= '" + getname + "'"); DataSet ds = MySqlHelper.Query(strSql.ToString()); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { FishEntity.SalesRequisitionEntity model = new FishEntity.SalesRequisitionEntity(); DataRow row = ds.Tables[0].Rows[0]; if (row["Numbering"] != null) { model.Numbering = row["Numbering"].ToString(); } if (row["code"] != null) { model.code = row["code"].ToString(); } if (row["demand"] != null) { model.demand = row["demand"].ToString(); } if (row["demandId"] != null) { model.demandId = row["demandId"].ToString(); } if (row["Purchasingunits"] != null) { model.Purchasingunits = row["Purchasingunits"].ToString(); } if (row["PurchasingunitsId"] != null) { model.PurchasingunitsId = row["PurchasingunitsId"].ToString(); } if (row["pp"] != null) { model.pp = row["pp"].ToString(); } if (row["Country"] != null) { model.Country = row["Country"].ToString(); } if (row["listname"] != null) { model.tdh = row["listname"].ToString(); } if (row["Species"] != null) { model.Goods = row["Species"].ToString(); } if (row["Cornerno"] != null) { model.zjh = row["Cornerno"].ToString(); } if (row["ferryname"] != null) { model.cm = row["ferryname"].ToString(); } return(model); } else { return(null); } }
public void setSaleValue(FishEntity.SalesRequisitionBodyEntity _model, bool state, FishEntity.SalesRequisitionEntity setbool) { label.Text = string.Empty; txtSignplace.Text = texProcudts.Text = _model.Funit; if (_model.db.ToString() != "" && _model.db.ToString() != null && setbool.Dbbool == true) { label.Text += "蛋白≥" + _model.db.ToString() + ","; } if (_model.tvn.ToString() != "" && _model.tvn.ToString() != null && setbool.Tvnbool == true) { label.Text += "TVN≤" + _model.tvn.ToString() + ","; } if (_model.za.ToString() != "" && _model.za.ToString() != null && setbool.Zabool == true) { label.Text += "组胺≤" + _model.za.ToString() + ","; } if (_model.ffa.ToString() != "" && _model.ffa.ToString() != null && setbool.Ffabool == true) { label.Text += "FFA≤" + _model.ffa.ToString() + ","; } if (_model.zf.ToString() != "" && _model.zf.ToString() != null && setbool.Zfbool == true) { label.Text += "脂肪≤" + _model.zf.ToString() + ","; } if (_model.sf.ToString() != "" && _model.sf.ToString() != null && setbool.Sfbool == true) { label.Text += "水分≤" + _model.sf.ToString() + ","; } if (_model.shy.ToString() != "" && _model.shy.ToString() != null && setbool.Shybool == true) { label.Text += "沙和盐≤" + _model.shy.ToString() + ","; } if (_model.sz.ToString() != "" && _model.sz.ToString() != null && setbool.Szbool == true) { label.Text += "沙子≤" + _model.sz.ToString() + ","; } label.Text += "国外SGS,不得发霉、有异味或掺杂其他杂物,且应符合国家质量标准。"; //texZA . Text = _model . za . ToString ( ); //texFFA . Text = _model . ffa . ToString ( ); //texZF . Text = _model . zf . ToString ( ); //texSF . Text = _model . sf . ToString ( ); //texSHY . Text = _model . shy . ToString ( ); //texS . Text = _model . sz . ToString ( ); if (state == true) { texProduct.Text = _model.Funit; label1.Text = string.Empty; if (_model.cdb.ToString() != "" && _model.cdb.ToString() != null && setbool.Cdbbool == true) { label1.Text += "粗蛋白≥" + _model.cdb.ToString() + ","; } if (_model.tvnOne.ToString() != "" && _model.tvnOne.ToString() != null && setbool.Tvnbool == true) { label1.Text += "TVN≤" + _model.tvnOne.ToString() + ","; } if (_model.hf.ToString() != "" && _model.hf.ToString() != null && setbool.Hfbool == true) { label1.Text += "灰份≤" + _model.hf.ToString() + ","; } if (setbool.ZaOnebool == true && _model.ZaOne.ToString() != "" && _model.ZaOne != null) { label1.Text += "组胺≤" + _model.ZaOne.ToString() + ","; } if (setbool.FfaOnebool == true && _model.FfaOne.ToString() != "" && _model.FfaOne != null) { label1.Text += "FFA≤" + _model.FfaOne.ToString() + ","; } if (setbool.ZfOnebool == true && _model.ZfOne.ToString() != "" && _model.ZfOne != null) { label1.Text += "脂肪≤" + _model.ZfOne.ToString() + ","; } if (setbool.SfOnebool == true && _model.SfOne.ToString() != "" && _model.SfOne != null) { label1.Text += "水分≤" + _model.SfOne.ToString() + ","; } if (setbool.ShyOnebool == true && _model.ShyOne.ToString() != "" && _model.ShyOne != null) { label1.Text += "沙和盐≤" + _model.ShyOne.ToString() + ","; } if (setbool.SzOnebool == true && _model.SzOne.ToString() != "" && _model.SzOne != null) { label1.Text += "沙子≤" + _model.SzOne.ToString() + ","; } if (label1.Text != "") { label1.Text += "国内检测指标平均值。"; } } else { texProduct.Text = string.Empty; //texCDB . Text = string . Empty; //textTVN . Text = string . Empty; //texHF . Text = string . Empty; } texCM.Text = _model.cm.ToString(); if (_model.tdh == null) { texTDH.Text = string.Empty; } else { texTDH.Text = _model.tdh.ToString(); } if (_model.zjh.ToString() != "" && _model.zjh.ToString() != null) { texZJH.Text = _model.zjh.ToString(); } texPP.Text = _model.pp; texCountry.Text = _model.Country; if (setbool.Informationbool == true) { if (texCM.Text != "" && texCM.Text != null) { label18.Visible = true; texCM.Visible = true; } if (texTDH.Text != "" && texTDH.Text != null) { label19.Visible = true; texTDH.Visible = true; } if (texZJH.Text != "" && texZJH.Text != null) { label20.Visible = true; texZJH.Visible = true; } if (texCountry.Text != "" && texCountry.Text != null) { label22.Visible = true; texCountry.Visible = true; } if (texPP.Text != "" && texPP.Text != null) { label21.Visible = true; texPP.Visible = true; } } else { label18.Visible = false; texCM.Visible = false; label19.Visible = false; texTDH.Visible = false; label20.Visible = false; texZJH.Visible = false; label22.Visible = false; texCountry.Visible = false; label21.Visible = false; texPP.Visible = false; } }
public FishEntity.SalesRequisitionEntity getXSSQD(string getname) { StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT b.Product_id,a.Numbering,a.code,CNumbering,demand,demandId,DemandContact,DemandContactId,Purchasecontractnumber,Purchasingunits,PurchasingunitsId,a.accountnumber,Bank,UnitPrice from t_salesorder a left join t_happening b on a.Numbering = b.NumberingOne "); strSql.Append("where a.Numbering= '" + getname + "'"); DataSet ds = MySqlHelper.Query(strSql.ToString()); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { FishEntity.SalesRequisitionEntity model = new FishEntity.SalesRequisitionEntity(); DataRow row = ds.Tables[0].Rows[0]; if (row["Numbering"] != null) { model.Numbering = row["Numbering"].ToString(); } if (row["CNumbering"] != null) { model.CNumbering = row["CNumbering"].ToString(); } if (row["code"] != null) { model.code = row["code"].ToString(); } if (row["demand"] != null) { model.demand = row["demand"].ToString(); } if (row["demandId"] != null) { model.demandId = row["demandId"].ToString(); } if (row["DemandContact"] != null) { model.DemandContact = row["DemandContact"].ToString(); } if (row["DemandContactId"] != null) { model.DemandContactId = row["DemandContactId"].ToString(); } if (row["Purchasecontractnumber"] != null) { model.Purchasecontractnumber = row["Purchasecontractnumber"].ToString(); } if (row["Purchasingunits"] != null) { model.Purchasingunits = row["Purchasingunits"].ToString(); } if (row["PurchasingunitsId"] != null) { model.PurchasingunitsId = row["PurchasingunitsId"].ToString(); } if (row["accountnumber"] != null) { model.accountnumber = row["accountnumber"].ToString(); } if (row["Bank"] != null)// { model.Bank = row["Bank"].ToString(); } if (row["UnitPrice"] != null) { model.UnitPrice = row["UnitPrice"].ToString(); } if (row["Product_id"] != null) { model.Product_id = row["Product_id"].ToString(); } return(model); } else { return(null); } }
/// <summary> /// 出库单 /// </summary> /// <param name="getname"></param> /// <returns></returns> public FishEntity.SalesRequisitionEntity getCKD(string getname) { StringBuilder strSql = new StringBuilder(); strSql.Append("select a.Numbering,a.code,a.demand,a.demandId,a.Purchasingunits,a.PurchasingunitsId,c.Brands,c.Country,c.speci,c.pageNum,c.billName,pileNum,shipName,b.product_id from t_salesorder a inner join t_happening b on a.Numbering =b.NumberingOne inner join t_outboundorder c on a.Numbering=c.codenum "); strSql.Append("where a.Numbering= '" + getname + "'"); DataSet ds = MySqlHelper.Query(strSql.ToString()); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { FishEntity.SalesRequisitionEntity model = new FishEntity.SalesRequisitionEntity(); DataRow row = ds.Tables[0].Rows[0]; if (row["Numbering"] != null) { model.Numbering = row["Numbering"].ToString(); } if (row["product_id"] != null) { model.Product_id = row["product_id"].ToString(); } if (row["code"] != null) { model.code = row["code"].ToString(); } if (row["demand"] != null) { model.demand = row["demand"].ToString(); } if (row["demandId"] != null) { model.demandId = row["demandId"].ToString(); } if (row["Purchasingunits"] != null) { model.Purchasingunits = row["Purchasingunits"].ToString(); } if (row["PurchasingunitsId"] != null) { model.PurchasingunitsId = row["PurchasingunitsId"].ToString(); } if (row["Brands"] != null) { model.pp = row["Brands"].ToString(); } if (row["Country"] != null) { model.Country = row["Country"].ToString(); } //if (row["billName"] != null) //{ // model.Goods = row["billName"].ToString(); //} if (row["speci"] != null) { model.Pinzhi = row["speci"].ToString(); } if (row["pageNum"] != null) { model.baoshu = row["pageNum"].ToString(); } if (row["pileNum"] != null) { model.zjh = row["pileNum"].ToString(); } if (row["billName"] != null) { model.tdh = row["billName"].ToString(); } if (row["shipName"] != null) { model.cm = row["shipName"].ToString(); } return(model); } else { return(null); } }
/// <summary> /// 新增带入数据 /// </summary> /// <param name="getname"></param> /// <returns></returns> public FishEntity.SalesRequisitionEntity getTHD(string getname) { StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT a.Numbering,a.code,a.demand,a.demandId,a.DemandAbbreviation,a.supplier,a.supplierId,a.SupplierAbbreviation,b.product_id,b.Funit,b.Country,b.pp,b.productname,b.db,b.za,b.sz,b.tvn,b.hf,b.sf,b.shy,b.zf,b.unitprice,a.delivery,a.rabZy,a.rabZz FROM t_salesorder a INNER JOIN t_happening b ON a.Numbering = b.NumberingOne "); strSql.Append("where a.Numbering= '" + getname + "'"); DataSet ds = MySqlHelper.Query(strSql.ToString()); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { FishEntity.SalesRequisitionEntity model = new FishEntity.SalesRequisitionEntity(); DataRow row = ds.Tables[0].Rows[0]; if (row["Numbering"] != null && row["Numbering"].ToString() != "") { model.Numbering = row["Numbering"].ToString(); } else { return(null); } if (row["CODE"] != null && row["CODE"].ToString() != "") { model.code = row["CODE"].ToString(); } else { return(null); } if (row["Funit"] != null) { model.Funit = row["Funit"].ToString(); } if (row["rabZz"] != null) { model.RabZz = bool.Parse(row["rabZz"].ToString()); } if (row["rabZy"] != null) { model.RabZy = bool.Parse(row["rabZy"].ToString()); } if (row["demand"] != null && row["demand"].ToString() != "") { model.demand = row["demand"].ToString(); } if (row["demandId"] != null) { model.demandId = row["demandId"].ToString(); } if (row["DemandAbbreviation"] != null) { model.DemandAbbreviation = row["DemandAbbreviation"].ToString(); } if (row["supplier"] != null && row["supplier"].ToString() != "") { model.supplier = row["supplier"].ToString(); } if (row["supplierId"] != null) { model.supplierId = row["supplierId"].ToString(); } if (row["SupplierAbbreviation"] != null) { model.SupplierAbbreviation = row["SupplierAbbreviation"].ToString(); } if (row["product_id"] != null) { model.Product_id = row["product_id"].ToString(); } if (row["Country"] != null) { model.Country = row["Country"].ToString(); } if (row["pp"] != null) { model.pp = row["pp"].ToString(); } if (row["productname"] != null) { model.Productname = row["productname"].ToString(); } if (row["db"] != null) { model.Db = row["db"].ToString(); } if (row["za"] != null) { model.Za = row["za"].ToString(); } if (row["sz"] != null) { model.Sz = row["sz"].ToString(); } if (row["tvn"] != null) { model.Tvn = row["tvn"].ToString(); } if (row["hf"] != null) { model.Hf = row["hf"].ToString(); } if (row["sf"] != null) { model.Sf = row["sf"].ToString(); } if (row["shy"] != null) { model.Shy = row["shy"].ToString(); } if (row["zf"] != null) { model.Zf = row["zf"].ToString(); } if (row["unitprice"] != null) { model.HeTongDanJia = row["unitprice"].ToString(); } if (row["delivery"] != null) { model.delivery = row["delivery"].ToString(); } return(model); } else { return(null); } }
public FishEntity.SalesRequisitionEntity getCKD(string getname) { StringBuilder strSql = new StringBuilder(); strSql.Append("select a.Numbering,a.code,a.demand,a.demandId,a.Signdate,b.product_id,b.Country,b.pp,b.Quantity,b.cm,b.zjh,b.tdh,b.Funit from t_salesorder a LEFT JOIN t_happening b ON a.Numbering=b.NumberingOne "); strSql.Append("where " + getname + ""); DataSet ds = MySqlHelper.Query(strSql.ToString()); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { FishEntity.SalesRequisitionEntity model = new FishEntity.SalesRequisitionEntity(); DataRow row = ds.Tables[0].Rows[0]; if (row["Numbering"] != null) { model.Numbering = row["Numbering"].ToString(); } if (row["code"] != null) { model.code = row["code"].ToString(); } if (row["product_id"] != null) { model.Product_id = row["product_id"].ToString(); } if (row["demand"] != null) { model.demand = row["demand"].ToString(); } if (row["demandId"] != null) { model.demandId = row["demandId"].ToString(); } if (row["Signdate"] != null) { model.Signdate = DateTime.Parse(row["Signdate"].ToString()); } if (row["cm"] != null) { model.cm = row["cm"].ToString(); } if (row["Quantity"] != null) { model.Quantity = row["Quantity"].ToString(); } if (row["zjh"] != null) { model.zjh = row["zjh"].ToString(); } if (row["tdh"] != null) { model.tdh = row["tdh"].ToString(); } if (row["Country"] != null) { model.Country = row["Country"].ToString(); } if (row["pp"] != null) { model.pp = row["pp"].ToString(); } return(model); } else { return(null); } }
void getValue(int i, FishEntity.ProcessStateEntity _list) { int idx = dataGridView1.Rows.Add(); DataGridViewRow row = dataGridView1.Rows[idx]; row.Cells["id"].Value = _list.id; row.Cells["code"].Value = _list.code; row.Cells["Numbering"].Value = _list.Numbering; switch (_list.Effect) { case "有效": row.Cells["effect"].Value = false; break; case "无效": row.Cells["effect"].Value = true; break; default: row.Cells["effect"].Value = false; break; } _createmanSet = _createmanGet.createmanGet(_list.Numbering); if (_createmanSet != null) { row.Cells["xssqBool"].Value = _createmanSet.createman.ToString(); row.Cells["demand"].Value = _createmanSet.demand.ToString(); row.Cells["Signdate"].Value = _createmanSet.Signdate.ToString(); row.Cells["Purchasecontractnumber"].Value = _createmanSet.Purchasecontractnumber.ToString(); } row.Cells["xssqExBool"].Value = string.Empty; //送审提交Name _ReviewModel = _Reviewbll.UserName(_list.Numbering); if (_ReviewModel != null) { row.Cells["xshtBool"].Value = _ReviewModel.userName.ToString(); } row.Cells["xshtExBool"].Value = string.Empty; row.Cells["fksqBool"].Value = string.Empty; row.Cells["fksqExBool"].Value = string.Empty; row.Cells["thdCode"].Value = _list.ThdCode; row.Cells["thdBool"].Value = string.Empty; row.Cells["bdCode"].Value = _list.BdCode; row.Cells["bdBool"].Value = string.Empty; row.Cells["bdExBool"].Value = string.Empty; row.Cells["hwfkCode"].Value = _list.HwfkCode; row.Cells["hwfkBool"].Value = string.Empty; row.Cells["hwfkExBool"].Value = string.Empty; row.Cells["wtfkCode"].Value = _list.WtfkCode; row.Cells["wtfkBool"].Value = string.Empty; row.Cells["wtfkExBool"].Value = string.Empty; row.Cells["skjlBool"].Value = string.Empty; row.Cells["skjlExBool"].Value = string.Empty; row.Cells["tchsBool"].Value = string.Empty; row.Cells["tchsExBool"].Value = string.Empty; if (_list.xssqBool == true) { dataGridView1.Rows[i].Cells["xssqBool"].Style.BackColor = Color.FromName("Red"); } else { dataGridView1.Rows[i].Cells["xssqBool"].Style.BackColor = Color.FromName("Blue"); } if (_list.xssqExBool == true) { dataGridView1.Rows[i].Cells["xssqExBool"].Style.BackColor = Color.FromName("Red"); } else { dataGridView1.Rows[i].Cells["xssqExBool"].Style.BackColor = Color.FromName("Blue"); } if (_list.xshtBool == true) { dataGridView1.Rows[i].Cells["xshtBool"].Style.BackColor = Color.FromName("Red"); } else { dataGridView1.Rows[i].Cells["xshtBool"].Style.BackColor = Color.FromName("Blue"); } if (_list.xshtExBool == true) { dataGridView1.Rows[i].Cells["xshtExBool"].Style.BackColor = Color.FromName("Red"); } else { dataGridView1.Rows[i].Cells["xshtExBool"].Style.BackColor = Color.FromName("Blue"); } switch (_list.fksqBool) { case '1': dataGridView1.Rows[i].Cells["fksqBool"].Style.BackColor = Color.FromName("Red"); break; case '2': dataGridView1.Rows[i].Cells["fksqBool"].Style.BackColor = Color.FromName("yellow"); break; case '0': dataGridView1.Rows[i].Cells["fksqBool"].Style.BackColor = Color.FromName("Blue"); break; case '3': dataGridView1.Rows[i].Cells["fksqBool"].Style.BackColor = Color.FromName("green"); break; default: /// <summary> /// null /// </summary> dataGridView1.Rows[i].Cells["fksqBool"].Style.BackColor = Color.FromName("Blue"); break; } if (_list.fksqExBool == true) { dataGridView1.Rows[i].Cells["fksqExBool"].Style.BackColor = Color.FromName("Red"); } else { dataGridView1.Rows[i].Cells["fksqExBool"].Style.BackColor = Color.FromName("Blue"); } switch (_list.thdBool) { case '1': dataGridView1.Rows[i].Cells["thdBool"].Style.BackColor = Color.FromName("Red"); break; case '2': dataGridView1.Rows[i].Cells["thdBool"].Style.BackColor = Color.FromName("yellow"); break; case '0': dataGridView1.Rows[i].Cells["thdBool"].Style.BackColor = Color.FromName("Blue"); break; default: /// <summary> /// null /// </summary> dataGridView1.Rows[i].Cells["thdBool"].Style.BackColor = Color.FromName("Blue"); break; } switch (_list.bdBool) { case '1': dataGridView1.Rows[i].Cells["bdBool"].Style.BackColor = Color.FromName("Red"); break; case '2': dataGridView1.Rows[i].Cells["bdBool"].Style.BackColor = Color.FromName("yellow"); break; case '0': dataGridView1.Rows[i].Cells["bdBool"].Style.BackColor = Color.FromName("Blue"); break; default: /// <summary> /// null /// </summary> dataGridView1.Rows[i].Cells["bdBool"].Style.BackColor = Color.FromName("Blue"); break; } if (_list.bdExBool == true) { dataGridView1.Rows[i].Cells["bdExBool"].Style.BackColor = Color.FromName("Red"); dataGridView1.Rows[i].Cells["bdBool"].Style.BackColor = Color.FromName("Red"); } else { dataGridView1.Rows[i].Cells["bdExBool"].Style.BackColor = Color.FromName("Blue"); } switch (_list.hwfkBool) { case '1': dataGridView1.Rows[i].Cells["hwfkBool"].Style.BackColor = Color.FromName("Red"); break; case '2': dataGridView1.Rows[i].Cells["hwfkBool"].Style.BackColor = Color.FromName("yellow"); break; case '0': dataGridView1.Rows[i].Cells["hwfkBool"].Style.BackColor = Color.FromName("Blue"); break; default: /// <summary> /// null /// </summary> dataGridView1.Rows[i].Cells["hwfkBool"].Style.BackColor = Color.FromName("Blue"); break; } if (_list.hwfkExBool == true) { dataGridView1.Rows[i].Cells["hwfkExBool"].Style.BackColor = Color.FromName("Red"); } else { dataGridView1.Rows[i].Cells["hwfkExBool"].Style.BackColor = Color.FromName("Blue"); } switch (_list.wtfkBool) { case '1': dataGridView1.Rows[i].Cells["wtfkBool"].Style.BackColor = Color.FromName("Red"); break; case '2': dataGridView1.Rows[i].Cells["wtfkBool"].Style.BackColor = Color.FromName("yellow"); break; case '0': dataGridView1.Rows[i].Cells["wtfkBool"].Style.BackColor = Color.FromName("Blue"); break; default: /// <summary> /// null /// </summary> dataGridView1.Rows[i].Cells["wtfkBool"].Style.BackColor = Color.FromName("Blue"); break; } if (_list.wtfkExBool == true) { dataGridView1.Rows[i].Cells["wtfkExBool"].Style.BackColor = Color.FromName("Red"); } else { dataGridView1.Rows[i].Cells["wtfkExBool"].Style.BackColor = Color.FromName("Blue"); } switch (_list.skjlBool) { case '1': dataGridView1.Rows[i].Cells["skjlBool"].Style.BackColor = Color.FromName("Red"); break; case '2': dataGridView1.Rows[i].Cells["skjlBool"].Style.BackColor = Color.FromName("yellow"); break; case '0': dataGridView1.Rows[i].Cells["skjlBool"].Style.BackColor = Color.FromName("Blue"); break; default: /// <summary> /// null /// </summary> dataGridView1.Rows[i].Cells["skjlBool"].Style.BackColor = Color.FromName("Blue"); break; } if (_list.skjlExBool == true) { dataGridView1.Rows[i].Cells["skjlExBool"].Style.BackColor = Color.FromName("Red"); } else { dataGridView1.Rows[i].Cells["skjlExBool"].Style.BackColor = Color.FromName("Blue"); } if (_list.tchsBool == true) { dataGridView1.Rows[i].Cells["tchsBool"].Style.BackColor = Color.FromName("Red"); } else { dataGridView1.Rows[i].Cells["tchsBool"].Style.BackColor = Color.FromName("Blue"); } if (_list.tchsExBool == true) { dataGridView1.Rows[i].Cells["tchsExBool"].Style.BackColor = Color.FromName("Red"); } else { dataGridView1.Rows[i].Cells["tchsExBool"].Style.BackColor = Color.FromName("Blue"); } }