?? sellfind.cs
字號:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using GoodsReportManage.ItemClass;
namespace GoodsReportManage.Sell
{
public partial class SellFind : Form
{
public SellFind()
{
InitializeComponent();
}
SqlBaseClass G_SqlClass = new SqlBaseClass();
/// <summary>
/// 在控件中填充選中的DataGridView控件的數(shù)據(jù)
/// </summary>
private void FillControls()
{
try
{
this.labGoodsID.Text = this.dgvStockInfo[1, this.dgvStockInfo.CurrentCell.RowIndex].Value.ToString();
this.labGoodsName.Text = this.dgvStockInfo[2, this.dgvStockInfo.CurrentCell.RowIndex].Value.ToString();
this.labGoodsSpec.Text = this.dgvStockInfo[6, this.dgvStockInfo.CurrentCell.RowIndex].Value.ToString();
this.labNum.Text = this.dgvStockInfo[3, this.dgvStockInfo.CurrentCell.RowIndex].Value.ToString();
this.labRMoney.Text = this.dgvStockInfo[9, this.dgvStockInfo.CurrentCell.RowIndex].Value.ToString();
this.labGoodsPrice.Text = this.dgvStockInfo[8, this.dgvStockInfo.CurrentCell.RowIndex].Value.ToString();
this.labHasPay.Text = this.dgvStockInfo[10, this.dgvStockInfo.CurrentCell.RowIndex].Value.ToString();
}
catch { }
}
private void SellFind_Load(object sender, EventArgs e)
{
string P_Str_cmdtxt = "SELECT SellID as 銷售ID,GoodsID as 教材ID,GoodsName as 教材名稱,GoodsNum as 銷售數(shù)量";
P_Str_cmdtxt += ",GoodsUnit as 教材單位,GoodsTime as 銷售時間,GoodsSpec as 教材規(guī)格,GoodsPrice as 進貨價格,SellPrice as 銷售價格";
P_Str_cmdtxt += ",NeedPay as 應收金額,HasPay as 實收金額,Remark as 備注 FROM tb_Sell";
this.dgvStockInfo.DataSource = G_SqlClass.GetDs(P_Str_cmdtxt).Tables[0];
this.cbxCondition1.SelectedIndex = 0;
this.cbxCondition2.SelectedIndex = 0;
}
private void btnFindOK_Click(object sender, EventArgs e)
{
string P_Str_select = " WHERE SellID LIKE '%"+this.txtSellID.Text+"%' AND GoodsName LIKE '%" + this.txtGoodsName.Text + "%'";
P_Str_select += " AND GoodsID LIKE '%" + this.txtGoodsID.Text + "%' AND GoodsNum LIKE '%" + this.txtStockNum.Text + "%' ";
if (this.txtGoodsPrice.Text != "")
{
P_Str_select += " AND GoodsPrice " + this.cbxCondition1.Items[this.cbxCondition1.SelectedIndex].ToString() + this.txtGoodsPrice.Text + "";
}
if (this.txtSellPrice.Text != "")
{
P_Str_select += "AND SellPrice " + this.cbxCondition2.Items[this.cbxCondition2.SelectedIndex].ToString() + this.txtSellPrice.Text + "";
}
string P_Str_cmdtxt = "SELECT SellID as 銷售ID,GoodsID as 教材ID,GoodsName as 教材名稱,GoodsNum as 銷售數(shù)量";
P_Str_cmdtxt += ",GoodsUnit as 教材單位,GoodsTime as 銷售時間,GoodsSpec as 教材規(guī)格,GoodsPrice as 進貨價格,SellPrice as 銷售價格";
P_Str_cmdtxt += ",NeedPay as 應收金額,HasPay as 實收金額,Remark as 備注 FROM tb_Sell" + P_Str_select;
this.dgvStockInfo.DataSource = G_SqlClass.GetDs(P_Str_cmdtxt).Tables[0];
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void dgvStockInfo_CellClick(object sender, DataGridViewCellEventArgs e)
{
FillControls();
}
private void dgvStockInfo_DoubleClick(object sender, EventArgs e)
{
PropertyClass.GetDgvData = this.dgvStockInfo[2, this.dgvStockInfo.CurrentCell.RowIndex].Value.ToString();
PropertyClass.GetGoodsID = this.dgvStockInfo[1, this.dgvStockInfo.CurrentCell.RowIndex].Value.ToString();
PropertyClass.GetStockUnit = this.dgvStockInfo[4, this.dgvStockInfo.CurrentCell.RowIndex].Value.ToString();
PropertyClass.GetGoodsInPrice = this.dgvStockInfo[7, this.dgvStockInfo.CurrentCell.RowIndex].Value.ToString();
PropertyClass.GetSellPrice = this.dgvStockInfo[8, this.dgvStockInfo.CurrentCell.RowIndex].Value.ToString();
PropertyClass.GetStockSpec = this.dgvStockInfo[6, this.dgvStockInfo.CurrentCell.RowIndex].Value.ToString();
this.Close();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -