本文整理汇总了C#中DataLayer.sql.GetRecords方法的典型用法代码示例。如果您正苦于以下问题:C# sql.GetRecords方法的具体用法?C# sql.GetRecords怎么用?C# sql.GetRecords使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataLayer.sql
的用法示例。
在下文中一共展示了sql.GetRecords方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Users
public Users()
{
InitializeComponent();
cbSDiv.SelectedIndex = 0;
globalData.load = false;
globalData.Div = cbSDiv.SelectedItem.ToString();
sql sql1 = new sql();
DataTable dt = sql1.GetRecords("exec SelRole");
if (dt != null)
{
cbRoles.DataSource = dt;
cbRoles.DisplayMember = "role_name";
cbRoles.ValueMember = "role_id";
cbRoles.SelectedIndex = 4;
}
dt = sql1.GetRecords("exec Region_Select");
if (dt != null)
{
cbRegions.DataSource = dt;
cbRegions.DisplayMember = "reg_nameRus";
cbRegions.ValueMember = "reg_id";
}
loadData1();
loadData2();
globalData.load = true;
}
示例2: rent_fill
/* ХП */
public void rent_fill( string name, int role, ComboBox cb, ComboBox cbUser = null,
ComboBox cbDiv = null,
ComboBox cbReg = null,
ComboBox cbRD = null )
{
sql sql1 = new sql();
DataTable dt = new DataTable();
string reg = "0", rd = "0", div = "0", user = globalData.UserID.ToString();
string _name = "user_name", _id = "user_id";
if (cbDiv != null)
{
if (cbDiv.SelectedValue == null)
div = "0";
else
div = cbDiv.SelectedValue.ToString();
}
if (cbReg != null)
{
if (cbReg.Enabled == false || cbReg.Visible == false || cbReg.SelectedValue == null)
reg = "0";
else
reg = cbReg.SelectedValue.ToString();
}
if (cbRD != null)
{
if (cbRD.Enabled == false || cbRD.Visible == false)
rd = "0";
else
{
if (cbRD.SelectedValue == null)
rd = "0";
else
rd = cbRD.SelectedValue.ToString();
}
}
if (name == "Region" && role == 4)
user = "0";
if (name == "UserForDM")
dt = sql1.GetRecords("exec Rent_Select_" + name + " @p1, @p2, @p3, @p4, @p5, @p6", role, user, div, rd, reg, dtp23.Value.Year.ToString() + "-" + dtp23.Value.Month + "-01");
else
dt = sql1.GetRecords("exec Rent_Select_" + name + " @p1, @p2, @p3, @p4, @p5", role, user, div, rd, reg);
if (name == "Div")
{
_name = "sdiv_code";
_id = "sdiv_id";
}
if (name == "Region")
{
_name = "reg_nameRus";
_id = "reg_id";
}
fillComboBox(dt, cb, _name, _id);
}
示例3: button1_Click
private void button1_Click(object sender, EventArgs e)
{
sql sql1 = new sql();
if (this.Text == "Добавление")
sql1.GetRecords(ins + " @p1 ", textBox1.Text);
else
sql1.GetRecords(upd + " @p1, @p2 ", textBox1.Text, mid);
Close();
}
示例4: button1_Click
private void button1_Click(object sender, EventArgs e)
{
sql sql1 = new sql();
if (this.Text == "Добавление")
sql1.GetRecords(ins + " @p1, @p2 ", textBox1.Text, textBox2.Text);
//sql1.GetRecords("exec InsReports(" + textBox1.Text + ", " + textBox1.Text + ")");
else
sql1.GetRecords(upd + " @p1, @p2, @p3 ", textBox1.Text, textBox2.Text, mid);
Close();
}
示例5: btnClose_Click
private void btnClose_Click(object sender, EventArgs e)
{
if(mes_id != "0")
{
sql sql1 = new sql();
if (cbRead.Checked)
sql1.GetRecords("exec UpdMesHide @p1", mes_id);
else
sql1.GetRecords("exec UpdMesRead @p1", mes_id);
}
}
示例6: btnOK_Click
private void btnOK_Click(object sender, EventArgs e)
{
if ((tbName.Text != "") && (tbSName.Text != ""))
{
sql sql1 = new sql();
if (idLPU != "0")
sql1.GetRecords("exec UpdLPU @p1, @p2, @p3", idLPU, tbSName.Text, tbName.Text);
else
sql1.GetRecords("exec InsLPU @p1, @p2, @p3", tbSName.Text, tbName.Text, idReg);
globalData.update = true;
}
}
示例7: fUser
public fUser(String fio, String login, String role)
{
InitializeComponent();
sql sql1 = new sql();
DataTable dt1 = new DataTable();
dt1 = sql1.GetRecords("exec GetUserReg @p1", fio);
if (dt1.Rows.Count > 0)
{
_dgv1.DataSource = dt1;
lbNameTable.Visible = true;
_dgv1.Visible = true;
lbRD.Visible = true;
lbRDName.Visible = true;
lbRD.Text = sql1.GetRecordsOne("exec GetRDbyUserName @p1", fio);
_dgv1.Columns["reg_nameRus"].ReadOnly = true;
_dgv1.Columns["reg_nameRus"].Width = 170;
if ((role == "Региональный представитель") || (role == "Региональный менеджер"))
lbNameTable.Text = "Регионы продаж";
else if (role == "Региональный директор")
lbNameTable.Text = "Cписок подведомственных регионов";
}
else
{
lbNameTable.Visible = false;
lbRD.Visible = false;
lbRDName.Visible = false;
_dgv1.Visible = false;
}
lbFIO.Text = fio;
lbLogin.Text = login;
lbRole.Text = role;
dt1 = sql1.GetRecords("exec GetDivByUserName @p1", fio);
String temp = "";
foreach (DataRow row in dt1.Rows)
{
if (temp != String.Empty)
temp += ", ";
temp += row[0].ToString();
}
lbDiv.Text = temp;
}
示例8: MoveReport
public MoveReport(int idRep1, int db1, int count1)
{
InitializeComponent();
sql sql1 = new sql();
DataTable dt1 = sql1.GetRecords("exec SelSubRegionByUserID @p1", globalData.UserID);
globalData.load = false;
cbSubReg.DataSource = dt1;
cbSubReg.DisplayMember = "subreg_nameRus";
cbSubReg.ValueMember = "subreg_id";
globalData.load = true;
tbCount.Text = count1.ToString();
count = count1;
idRep = idRep1;
db = db1;
if (globalData.Div == "HC")
{
tbTail.Visible = true;
label3.Visible = true;
tbTail.Text = sql1.GetRecordsOne("exec TailForRaspNew @p1, @p2, @p3", idRep, db, cbSubReg.SelectedValue);
}
else
{
tbTail.Visible = false;
label3.Visible = false;
}
}
示例9: button1_Click
private void button1_Click(object sender, EventArgs e)
{
InputDialog ind = new InputDialog("Дистрибьютор", "Введите код дистр.(Напр.:20440997)\nНе забудьте добавить РЕГИОН!", true);
ind.ShowDialog();
if (ind.DialogResult == DialogResult.Cancel)
return;
String code = globalData.input;
ind = new InputDialog("Дата начала отчётов", "Введите год", true);
ind.ShowDialog();
if (ind.DialogResult == DialogResult.Cancel)
return;
String yearR = globalData.input;
ind = new InputDialog("Дата начала отчётов", "Введите месяц в формате 1,2,3..", true);
ind.ShowDialog();
if (ind.DialogResult == DialogResult.Cancel)
return;
String monthR = globalData.input;
sql sql1 = new sql();
DataTable dt1 = sql1.GetRecords("exec InsRepDistRight @p1, @p2", code, yearR + "-" + monthR + "-01");
}
示例10: btnDel_Click
private void btnDel_Click(object sender, EventArgs e)
{
sql sql1 = new sql();
sql1.GetRecords("exec DelKosCust @p1", dataGridView1.SelectedRows[0].Cells[0].Value.ToString());
loadKosCust();
}
示例11: CodeName_Activated
private void CodeName_Activated(object sender, EventArgs e)
{
sql sql1 = new sql();
dataGridView1.DataSource = sql1.GetRecords(sel);
dataGridView1.Columns[0].Visible = false;
//dataGridView1.FirstDisplayedScrollingRowIndex = clsData.selRow;
}
示例12: fillUsersUlpu
private void fillUsersUlpu()
{
if (dataGridView1.Rows != null)
{
dataGridView1.Rows.Clear();
dataGridView1.Columns.Clear();
}
globalData.load = false;
sql sql1 = new sql();
DataTable dt1 = sql1.GetRecords("exec SelUserByLPUID @p1", cbULPU.SelectedValue);
if (dt1 == null)
{
MessageBox.Show("Ошибка!", "ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
dataGridView1.Columns.Add("user_name", "Региональный представитель");
foreach (DataRow row in dt1.Rows)
{
dataGridView1.Rows.Add(row.ItemArray[1]);
}
dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells);
}
globalData.load = true;
}
示例13: btnOK_Click
private void btnOK_Click(object sender, EventArgs e)
{
sql sql1 = new sql();
if (mat_id == "0")
{
sql1.GetRecords("exec InsMat @p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9", tbMatCode.Text, tbMatName.Text, cbSDiv.SelectedValue, cbPDiv.SelectedValue, cbSBA.SelectedValue, cbMMG.SelectedValue, cbMSG.SelectedValue, cbButton.SelectedValue, cbNom.SelectedValue);
MessageBox.Show("Материал добавлен", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
sql1.GetRecords("exec UpdMat @p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10", mat_id, tbMatCode.Text, tbMatName.Text, cbSDiv.SelectedValue, cbPDiv.SelectedValue, cbSBA.SelectedValue, cbMMG.SelectedValue, cbMSG.SelectedValue, cbButton.SelectedValue, cbNom.SelectedValue);
MessageBox.Show("Информация по материалу обновлена", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
globalData.update = true;
}
示例14: loadButton
private void loadButton()
{
sql sql1 = new sql();
cbButton.DataSource = sql1.GetRecords("exec SelButton @p1", cbSDiv.SelectedValue);
cbButton.DisplayMember = "btn_name";
cbButton.ValueMember = "btn_id";
}
示例15: btnSearchCust_Click
private void btnSearchCust_Click(object sender, EventArgs e)
{
sql sql1 = new sql();
DataTable dt = sql1.GetRecords("exec SelMergeCust @p1, @p2", textBox6.Text, textBox5.Text);
_dgvMerge.DataSource = dt;
}