public override int Query() { UIForms.PurchaseApplicationCondition form = new UIForms.PurchaseApplicationCondition(this.Text + "查询"); this.panel1.Enabled = true; if (form.ShowDialog() == DialogResult.OK) { _model = new FishEntity.PurchaseApplicationEntity(); _bll = new FishBll.Bll.PurchaseApplicationBll(); strWhere = form.getStrWhere; _model = _bll.getModel(strWhere); if (_model == null) { MessageBox.Show("请重新查询"); this.panel1.Enabled = false; return(0); } setValue(); //if (string.IsNullOrEmpty(_model.codeNum)) // return 0; //List<FishEntity.PurchaseFishInfo> listFishInfo = _bll.getFishInfoList(_model.codeNum); //if (listFishInfo != null && listFishInfo.Count > 0) // setValueFishInfo(listFishInfo); //List<FishEntity . PurchaseOtherInfo> listOtherInfo = _bll . getOtherInfoList ( _model . codeNum ); //if ( listOtherInfo != null && listOtherInfo . Count > 0 ) // setValueOtherInfo ( listOtherInfo ); } return(base.Query()); }
private void FormPurchaseApplication_Load(object sender, EventArgs e) { this.tmiPrevious.Visible = false; this.tmiNext.Visible = false; if (Megres.oddNum != "") { _model = new FishEntity.PurchaseApplicationEntity(); _bll = new FishBll.Bll.PurchaseApplicationBll(); _fishInfo = new FishEntity.PurchaseFishInfo(); _otherInfo = new FishEntity.PurchaseOtherInfo(); strWhere = " codeNum='" + Megres.oddNum + "'"; _model = _bll.getModel(strWhere); if (_model == null) { MessageBox.Show("请重新查询"); this.panel1.Enabled = false; return; } setValue(); //if (string.IsNullOrEmpty(_model.codeNum)) // return ; //List<FishEntity.PurchaseFishInfo> listFishInfo = _bll.getFishInfoList(_model.codeNum); //if (listFishInfo != null && listFishInfo.Count > 0) // setValueFishInfo(listFishInfo); this.panel1.Enabled = true; } else { strWhere = string.Empty; } //权限控制功能。 Megres.oddNum = string.Empty; }
public PurchaseApplicationCondition(string text) { InitializeComponent( ); this.Text = text; _bll = new FishBll.Bll.PurchaseApplicationBll( ); _bllCon = new FishBll.Bll.PurcurementContractBll( ); }
public FormPurchaseApplication( ) { InitializeComponent( ); _model = new FishEntity.PurchaseApplicationEntity( ); _bll = new FishBll.Bll.PurchaseApplicationBll( ); this.txtprice.LostFocus += txtprice_LostFocus; this.txtpriceMY.LostFocus += txtpriceMY_LostFocus; }
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 a.id " + operate + orderBy; } if (operate != "" && orderBy != "") { _model = new FishEntity.PurchaseApplicationEntity(); _bll = new FishBll.Bll.PurchaseApplicationBll(); _model = _bll.getModel(whereEx); } else { _model = _bll.getModel(strWhere); } if (_model == null) { MessageBox.Show("已经没有记录了"); this.panel1.Enabled = false; return; } setValue(); //if (string.IsNullOrEmpty(_model.codeNum)) // return; //List<FishEntity.PurchaseFishInfo> listFishInfo = _bll.getFishInfoList(_model.codeNum); //if (listFishInfo != null && listFishInfo.Count > 0) // setValueFishInfo(listFishInfo); this.panel1.Enabled = true; whereEx = string.Empty; //List<FishEntity . PurchaseOtherInfo> listOtherInfo = _bll . getOtherInfoList ( _model . codeNum ); //if ( listOtherInfo != null && listOtherInfo . Count > 0 ) // setValueOtherInfo ( listOtherInfo ); }
public override int Add() { controlClear(); this.panel1.Enabled = true; _bll = new FishBll.Bll.PurchaseApplicationBll(); string code = string.Empty; code = _bll.getCodeNum(); if (code != "") { string str = string.Empty; int sum = 0; if (code == string.Empty) { str = DateTime.Now.Year.ToString() + "C" + "0001001"; } else { sum = int.Parse(code) + 1000; code = sum.ToString(); while (code.Length != 7) { code = "0" + code; } str = DateTime.Now.Year.ToString() + "C" + code; } txtCodeNum.Text = str; } tmiSave.Visible = true; if (getname != string.Empty) { if (getname == "采购流程1") { rabProOne.Checked = true; } else if (getname == "采购流程2") { rabProTwo.Checked = true; } } return(base.Add()); }
public override int Add( ) { panel1.Enabled = true; ControlClear( ); //txtcodeNumContract . Text = _bll . getCodeNum ( ); if (getname != "" && getname != null) { FishEntity.PurchaseApplicationEntity fish = new FishEntity.PurchaseApplicationEntity(); FishBll.Bll.PurchaseApplicationBll _Addbll = new FishBll.Bll.PurchaseApplicationBll(); fish = _Addbll.getModel(" codeNum='" + getname + "' "); if (fish != null) { yincang(fish.choise); jincang = fish.choise; txtCodeNum.Text = fish.codeNum; txtsupplier.Text = fish.supplier; txtsupplierUser.Text = fish.supplierUser; txtbuyer.Text = fish.buyer; txtbuyerUser.Text = fish.buyerUser; txtsigndate.Text = fish.signDate.ToString(); txtsignAdd.Text = fish.signAdd; txtpurchase.Text = fish.purchase; txtpurchaseUser.Text = fish.purchaseUser; txtvarieties.Text = fish.varieties; txtheight.Text = fish.Weight.ToString(); txtMoney.Text = fish.AmountOfMoney.ToString(); txtUnitPrice.Text = fish.danjia.ToString(); txtDollar.Text = fish.priceMY.ToString(); txtMoneyMJ.Text = fish.Dollarjine.ToString(); txtproName.Text = fish.proName; //FishBll.Bll.PurchaseApplicationBll bll = new FishBll.Bll.PurchaseApplicationBll(); //List<FishEntity.PurchaseOtherInfo> listOtherInfo = bll.getOtherInfoList(_model.codeNum); //if (listOtherInfo != null && listOtherInfo.Count > 0) // setValue(listOtherInfo); //List<FishEntity.PurchaseContractFishInfo> listFishInfo = _bll.getFishInfoList(_model.codeNum); //if (listFishInfo != null && listFishInfo.Count > 0) // setValue(listFishInfo); } } return(base.Add( )); }
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 PurchaseApplicationCondition( ) { InitializeComponent( ); _bll = new FishBll.Bll.PurchaseApplicationBll( ); }
public override int Query() { _bll = new FishBll.Bll.PurchaseApplicationBll(); strWhere = " 1=1 "; if (!string.IsNullOrEmpty(txtcodenum.Text)) { strWhere += " and codeNum like '%" + txtcodenum.Text + "%' "; } if (!string.IsNullOrEmpty(txtcodeNumContract.Text)) { strWhere += " and codeNumContract like '%" + txtcodeNumContract.Text + "%' "; } if (!string.IsNullOrEmpty(txtsupplier.Text)) { strWhere += " and supplier like '%" + txtsupplier.Text + "%' "; } if (comboBox1.Text.Equals("采购流程1")) { strWhere += " and process like '%" + comboBox1.Text + "%' "; } else if (comboBox1.Text.Equals("采购流程2")) { strWhere += " and process like '%" + comboBox1.Text + "%' "; } if (!string.IsNullOrEmpty(cmbCodeNumUser.Text.Trim())) { strWhere += " and a.createUser='******'"; } if (!string.IsNullOrEmpty(dtpStart.Text.Trim())) { strWhere += " AND a.signDate>='" + dtpStart.Text + "'"; } if (!string.IsNullOrEmpty(dtpEnd.Text.Trim())) { strWhere += " AND a.Signdate<='" + dtpEnd.Text + "'"; } //supplier DataTable table = _bll.getTable(strWhere); strWhere = string.Empty; if (table != null && table.Rows.Count > 0) { dataGridView1.Rows.Clear(); for (int i = 0; i < table.Rows.Count; i++) { int idx = dataGridView1.Rows.Add(); DataGridViewRow row = dataGridView1.Rows[idx]; row.Cells["codeNum"].Value = table.Rows[i]["codeNum"].ToString(); row.Cells["codeNumContract"].Value = table.Rows[i]["codeNumContract"].ToString(); row.Cells["supplier"].Value = table.Rows[i]["supplier"].ToString(); row.Cells["supplierAbb"].Value = table.Rows[i]["supplierAbb"].ToString(); row.Cells["supplierUser"].Value = table.Rows[i]["supplierUser"].ToString(); row.Cells["buyer"].Value = table.Rows[i]["buyer"].ToString(); row.Cells["buyerAbb"].Value = table.Rows[i]["buyerAbb"].ToString(); row.Cells["buyerUser"].Value = table.Rows[i]["buyerUser"].ToString(); row.Cells["signDate"].Value = table.Rows[i]["signDate"].ToString(); row.Cells["signAdd"].Value = table.Rows[i]["signAdd"].ToString(); row.Cells["proName"].Value = table.Rows[i]["proName"].ToString(); row.Cells["bondPro"].Value = table.Rows[i]["bondPro"].ToString(); row.Cells["varieties"].Value = table.Rows[i]["varieties"].ToString(); row.Cells["rebate"].Value = table.Rows[i]["rebate"].ToString(); row.Cells["priceMY"].Value = table.Rows[i]["priceMY"].ToString(); row.Cells["purchase"].Value = table.Rows[i]["purchase"].ToString(); row.Cells["purchaseAbb"].Value = table.Rows[i]["purchaseAbb"].ToString(); row.Cells["purchaseUser"].Value = table.Rows[i]["purchaseUser"].ToString(); row.Cells["conProtein"].Value = table.Rows[i]["conProtein"].ToString(); row.Cells["conTVN"].Value = table.Rows[i]["conTVN"].ToString(); row.Cells["conZA"].Value = table.Rows[i]["conZA"].ToString(); row.Cells["conFFA"].Value = table.Rows[i]["conFFA"].ToString(); row.Cells["conZF"].Value = table.Rows[i]["conZF"].ToString(); row.Cells["conSF"].Value = table.Rows[i]["conSF"].ToString(); row.Cells["conSHY"].Value = table.Rows[i]["conSHY"].ToString(); row.Cells["conS"].Value = table.Rows[i]["conS"].ToString(); row.Cells["conSJ"].Value = table.Rows[i]["conSJ"].ToString(); row.Cells["conHF"].Value = table.Rows[i]["conHF"].ToString(); row.Cells["conLAS"].Value = table.Rows[i]["conLAS"].ToString(); row.Cells["conDAS"].Value = table.Rows[i]["conDAS"].ToString(); row.Cells["createUser"].Value = table.Rows[i]["createUser"].ToString(); row.Cells["id"].Value = table.Rows[i]["id"].ToString(); row.Cells["fishId"].Value = table.Rows[i]["fishId"].ToString(); row.Cells["specifications"].Value = table.Rows[i]["specifications"].ToString(); row.Cells["brand"].Value = table.Rows[i]["brand"].ToString(); row.Cells["country"].Value = table.Rows[i]["country"].ToString(); row.Cells["shipName"].Value = table.Rows[i]["shipName"].ToString(); row.Cells["billName"].Value = table.Rows[i]["billName"].ToString(); row.Cells["Money"].Value = table.Rows[i]["Money"].ToString(); row.Cells["createUser"].Value = table.Rows[i]["createUser"].ToString(); row.Cells["money"].Value = table.Rows[i]["money"].ToString(); row.Cells["num"].Value = table.Rows[i]["num"].ToString(); row.Cells["danjia"].Value = table.Rows[i]["danjia"].ToString(); row.Cells["process"].Value = table.Rows[i]["process"].ToString(); } } else { MessageBox.Show("查无数据!"); } return(base.Query()); }
public override int Query() { _bll = new FishBll.Bll.PurchaseApplicationBll(); DataTable table = _bll.getTable(CodeNum); if (table != null && table.Rows.Count > 0) { dataGridView1.Rows.Clear(); for (int i = 0; i < table.Rows.Count; i++) { int idx = dataGridView1.Rows.Add(); DataGridViewRow row = dataGridView1.Rows[idx]; row.Cells["codeNum"].Value = table.Rows[i]["codeNum"].ToString(); row.Cells["codeNumContract"].Value = table.Rows[i]["codeNumContract"].ToString(); row.Cells["supplier"].Value = table.Rows[i]["supplier"].ToString(); row.Cells["supplierAbb"].Value = table.Rows[i]["supplierAbb"].ToString(); row.Cells["supplierUser"].Value = table.Rows[i]["supplierUser"].ToString(); row.Cells["buyer"].Value = table.Rows[i]["buyer"].ToString(); row.Cells["buyerAbb"].Value = table.Rows[i]["buyerAbb"].ToString(); row.Cells["buyerUser"].Value = table.Rows[i]["buyerUser"].ToString(); row.Cells["signDate"].Value = table.Rows[i]["signDate"].ToString(); row.Cells["signAdd"].Value = table.Rows[i]["signAdd"].ToString(); row.Cells["proName"].Value = table.Rows[i]["proName"].ToString(); row.Cells["bondPro"].Value = table.Rows[i]["bondPro"].ToString(); row.Cells["varieties"].Value = table.Rows[i]["varieties"].ToString(); row.Cells["rebate"].Value = table.Rows[i]["rebate"].ToString(); row.Cells["priceMY"].Value = table.Rows[i]["priceMY"].ToString(); row.Cells["shipDate"].Value = table.Rows[i]["shipDate"].ToString(); row.Cells["arriveDate"].Value = table.Rows[i]["arriveDate"].ToString(); row.Cells["deliveryDate"].Value = table.Rows[i]["deliveryDate"].ToString(); row.Cells["deliveryAdd"].Value = table.Rows[i]["deliveryAdd"].ToString(); row.Cells["deliveryLast"].Value = table.Rows[i]["deliveryLast"].ToString(); row.Cells["conProtein"].Value = table.Rows[i]["conProtein"].ToString(); row.Cells["conTVN"].Value = table.Rows[i]["conTVN"].ToString(); row.Cells["conZA"].Value = table.Rows[i]["conZA"].ToString(); row.Cells["conFFA"].Value = table.Rows[i]["conFFA"].ToString(); row.Cells["conZF"].Value = table.Rows[i]["conZF"].ToString(); row.Cells["conSF"].Value = table.Rows[i]["conSF"].ToString(); row.Cells["conSHY"].Value = table.Rows[i]["conSHY"].ToString(); row.Cells["conS"].Value = table.Rows[i]["conS"].ToString(); row.Cells["conSJ"].Value = table.Rows[i]["conSJ"].ToString(); row.Cells["conHF"].Value = table.Rows[i]["conHF"].ToString(); row.Cells["conLAS"].Value = table.Rows[i]["conLAS"].ToString(); row.Cells["conDAS"].Value = table.Rows[i]["conDAS"].ToString(); row.Cells["remark"].Value = table.Rows[i]["remark"].ToString(); row.Cells["createUser"].Value = table.Rows[i]["createUser"].ToString(); row.Cells["id"].Value = table.Rows[i]["id"].ToString(); row.Cells["fishId"].Value = table.Rows[i]["fishId"].ToString(); row.Cells["price"].Value = table.Rows[i]["price"].ToString(); row.Cells["weight"].Value = table.Rows[i]["weight"].ToString(); row.Cells["priceUSA"].Value = table.Rows[i]["priceUSA"].ToString(); row.Cells["specifications"].Value = table.Rows[i]["specifications"].ToString(); row.Cells["brand"].Value = table.Rows[i]["brand"].ToString(); row.Cells["country"].Value = table.Rows[i]["country"].ToString(); row.Cells["shipName"].Value = table.Rows[i]["shipName"].ToString(); row.Cells["billName"].Value = table.Rows[i]["billName"].ToString(); row.Cells["brand1"].Value = table.Rows[i]["brand1"].ToString(); row.Cells["money"].Value = table.Rows[i]["money"].ToString(); row.Cells["num"].Value = table.Rows[i]["num"].ToString(); row.Cells["jine"].Value = table.Rows[i]["jine"].ToString(); row.Cells["danjia"].Value = table.Rows[i]["danjia"].ToString(); } } else { MessageBox.Show("查无数据!"); } return(base.Query()); }