• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DataLayer.sql类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DataLayer.sql的典型用法代码示例。如果您正苦于以下问题:C# sql类的具体用法?C# sql怎么用?C# sql使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



sql类属于DataLayer命名空间,在下文中一共展示了sql类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: button4_Click

        /* Перенести с-ф в другой регион */
        private void button4_Click(object sender, EventArgs e)
        {
            if (globalData.UserAccess == 1)
            {
                try
                {
                    globalData.update = false;
                    sql sql1 = new sql();
                    string res = String.Empty;
                    int err1 = 0;

                    foreach (DataGridViewCell cell in _dgvRefDoc.SelectedCells)
                    {
                        if ((_dgvRefDoc.Rows[cell.RowIndex].Cells[0].Value == null && _dgvRefDoc.Rows[cell.RowIndex].Cells[1].Value == null) ||
                            (_dgvRefDoc.Rows[cell.RowIndex].Cells[0].Value.ToString() == "" && _dgvRefDoc.Rows[cell.RowIndex].Cells[1].Value.ToString() == ""))
                            res = sql1.GetRecordsOne("exec UpdReportRefDoc @p1, @p2, @p3, @p4, @p5, @p6", _dgvRefDoc.Rows[cell.RowIndex].Cells[2].Value.ToString(), _dgvRefDoc.Rows[cell.RowIndex].Cells[3].Value.ToString(), comboBox1.SelectedValue, globalData.UserID, dateTimePicker1.Value.Year.ToString() + "-" + dateTimePicker1.Value.Month.ToString() + "-01", cbSDiv.SelectedValue);

                        if (res == "1")
                            err1++;
                    }

                    if (err1 != 0)
                        MessageBox.Show("Кол-во ошибок " + err1.ToString(), "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);

                }
                catch (Exception err)
                {
                    MessageBox.Show("Не удалось обновить продажу. Системная ошибка: " + err.ToString(), "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    this.Close();
                }
            }
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:33,代码来源:RefDoc.cs


示例2: 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();
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:7,代码来源:KosCust.cs


示例3: 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;
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:34,代码来源:Users.cs


示例4: 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");
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:26,代码来源:RepDistRight.cs


示例5: 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;
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:32,代码来源:ULPUforUsers.cs


示例6: 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;
            }
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:30,代码来源:MoveReport.cs


示例7: 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;
 }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:7,代码来源:CodeName.cs


示例8: btnSave_Click

        private void btnSave_Click(object sender, EventArgs e)
        {
            sql sql1 = new sql();

            globalData.load = true;

            DataTable dt1 = new DataTable();

            string lpu = String.Empty;
            string reg = String.Empty;

            if (tbRegion.Visible == false)
            {
                lpu = "-3";
                reg = cbLPU.SelectedValue.ToString();
            }
            else
            {
                lpu = cbLPU.SelectedValue.ToString();
                reg = tbRegion.Text;
            }

            if (index == 0)
            {
                dt1 = sql1.GetRecords("exec InsMarkAct 0, @p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13",
                    tbName.Text, globalData.UserID2, globalData.Div, reg, lpu, tbPlan1.Text.Replace(",", "."), tbPlan2.Text.Replace(",", "."), tbPlan3.Text.Replace(",", "."), tbPlan4.Text.Replace(",", "."),
                    tbFact1.Text.Replace(",", "."), tbFact2.Text.Replace(",", "."), tbFact3.Text.Replace(",", "."), tbFact4.Text.Replace(",", "."));

                if (dt1 == null)
                    MessageBox.Show("Не удалось добавить маркетинговое мероприятие.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                else
                    MessageBox.Show("Маркетинговое мероприятие добавлено.", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            else
            {
                dt1 = sql1.GetRecords("exec UpdMarkAct @p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13, @p14",
                    index,
                    db,
                    globalData.UserID2,
                    tbName.Text,
                    lpu,
                    reg,
                    tbPlan1.Text.Replace(",", "."),
                    tbPlan2.Text.Replace(",", "."),
                    tbPlan3.Text.Replace(",", "."),
                    tbPlan4.Text.Replace(",", "."),
                    tbFact1.Text.Replace(",", "."),
                    tbFact2.Text.Replace(",", "."),
                    tbFact3.Text.Replace(",", "."),
                    tbFact4.Text.Replace(",", "."));

                if (dt1 == null)
                    MessageBox.Show("Не удалось отредактировать маркетинговое мероприятие.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                else
                    MessageBox.Show("Маркетинговое мероприятие обновлено.", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:59,代码来源:AddEditMarkAct.cs


示例9: 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);
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:60,代码来源:RRRent.cs


示例10: 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";
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:8,代码来源:AddEditMat.cs


示例11: 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;
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:8,代码来源:Merge.cs


示例12: btnSearchMat_Click

        private void btnSearchMat_Click(object sender, EventArgs e)
        {
            sql sql1 = new sql();

            DataTable dt = sql1.GetRecords("exec SelMergeMat @p1, @p2, @p3", textBox1.Text, textBox2.Text, textBox3.Text);

            _dgvMerge.DataSource = dt;
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:8,代码来源:Merge.cs


示例13: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            sql sql1 = new sql();

             if (tbYear.Text != String.Empty)
                 sql1.GetRecordsOne("exec SetNextYear @p1, @p2, @p3, @p4", tbYear.Text, cbLPU.Checked, cbNom.Checked, cbUsers.Checked);
             else
                 MessageBox.Show("Введите год!", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:9,代码来源:Settings.cs


示例14: AddRowReport

        public AddRowReport(String rep_id, String db_id, bool edit)
        {
            InitializeComponent();

            repID = Convert.ToInt32(rep_id);
            idDB = Convert.ToInt32(db_id);

            sql sql1 = new sql();
            DataTable dt1 = sql1.GetRecords("exec selRepKosByID @p1, @p2", rep_id, db_id);

            dateTimePicker1.Value = Convert.ToDateTime(dt1.Rows[0].ItemArray[0].ToString());

            loaddata();

            cbComp.SelectedValue = Convert.ToInt32(dt1.Rows[0].ItemArray[1].ToString());
            cbCust.SelectedValue = Convert.ToInt32(dt1.Rows[0].ItemArray[2].ToString());
            tbDist.Text = dt1.Rows[0].ItemArray[3].ToString();
            cbSubReg.SelectedValue = Convert.ToInt32(dt1.Rows[0].ItemArray[4].ToString());

            if (globalData.Div != "OM")
                cbLPU.SelectedValue = Convert.ToInt32(dt1.Rows[0].ItemArray[5].ToString());

            if (Convert.ToInt32(dt1.Rows[0].ItemArray[6].ToString()) != 0)
            {
                cbGroup.SelectedValue = Convert.ToInt32(dt1.Rows[0].ItemArray[6].ToString());
                cbNom.SelectedValue = Convert.ToInt32(dt1.Rows[0].ItemArray[7].ToString());
            }
            else
                cbGroup.SelectedValue = Convert.ToInt32(dt1.Rows[0].ItemArray[7].ToString());

            changeEnable();

            load = false;

            tbCount.Text = dt1.Rows[0].ItemArray[9].ToString();
            tbPriceEuro.Text = dt1.Rows[0].ItemArray[10].ToString();
            tbPriceRub.Text = dt1.Rows[0].ItemArray[11].ToString();

            load = true;

            if (((!edit) || (dateTimePicker1.Value != Convert.ToDateTime(globalData.CurDate))) && (globalData.UserAccess != 1))
            {
                tbCount.Enabled = false;
                tbPriceEuro.Enabled = false;
                tbPriceRub.Enabled = false;
                cbGroup.Enabled = false;
                cbNom.Enabled = false;
            }
            else
            {
                tbCount.Enabled = true;
                tbPriceEuro.Enabled = true;
                tbPriceRub.Enabled = true;
                cbGroup.Enabled = true;
                cbNom.Enabled = true;
            }
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:57,代码来源:AddRowReport.cs


示例15: btnDelUserLPU_Click

        private void btnDelUserLPU_Click(object sender, EventArgs e)
        {
            int managerID = Convert.ToInt32(manager.SelectedValue);
            int userID = Convert.ToInt32(_dgv2.Rows[_dgv2.SelectedCells[0].RowIndex].Cells[0].Value);

            sql sql1 = new sql();
            sql1.GetRecords("exec delUserManager @p1, @p2", managerID, userID);

            loadUserManager(managerID);
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:10,代码来源:userManager.cs


示例16: fillList

        private void fillList()
        {
            sql sql1 = new sql();
            DataTable dt = sql1.GetRecords("exec SelVisitPlanMonthByUser @p1, @p2", new DateTime(date.Year, date.Month, 1), idUser);

            foreach (DataRow row in dt.Rows)
            {
                visitList.Add(new Visit(Convert.ToInt32(row[0]), idUser));
            }
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:10,代码来源:VisitList.cs


示例17: 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();
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:10,代码来源:AEName.cs


示例18: loadData

        private void loadData()
        {
            sql sql1 = new sql();

            _dgv1.DataSource = sql1.GetRecords("exec SelTrackers");

            _dgv1.Columns["trac_id"].Visible = false;
            _dgv1.Columns["user_id"].Visible = false;
            _dgv1.Columns["trac_number"].HeaderText = "Номер";
            _dgv1.Columns["user_name"].HeaderText = "Пользователь";
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:11,代码来源:Trackers.cs


示例19: 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();
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:11,代码来源:AECodeName.cs


示例20: AEReport

        public AEReport(string idRep1, string idDB1)
        {
            try
            {
                InitializeComponent();

                loadData();

                idRep = idRep1;
                idDB = idDB1;

                sql sql1 = new sql();
                DataTable dt1 = sql1.GetRecords("exec GetReportByID @p1, @p2", idRep, idDB);

                if (dt1 == null)
                {
                    MessageBox.Show("Не удалось загрузить данные.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    this.Close();
                }

                cbReg.SelectedValue = Convert.ToInt32(dt1.Rows[0].ItemArray[0]);
                cbSubReg.SelectedValue = Convert.ToInt32(dt1.Rows[0].ItemArray[1]); ;
                dateTimePicker1.Value = Convert.ToDateTime(dt1.Rows[0].ItemArray[2]);
                cbSDiv.SelectedValue = Convert.ToInt32(dt1.Rows[0].ItemArray[3]);

                if (dt1.Rows[0].ItemArray[4].ToString() == "0")
                {
                    lbCheck.Text = "Продажа не распределена";
                    btnOK.Enabled = true;
                }
                else
                {
                    lbCheck.Text = "Продажа распределена. Количество распределений - " + dt1.Rows[0].ItemArray[4].ToString();
                    btnOK.Enabled = false;
                }
            }
            catch (Exception err)
            {
                MessageBox.Show("Не загрузить данные. Системная ошибка: " + err.ToString(), "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }

            if (globalData.UserAccess == 1)
            {
                dateTimePicker1.Enabled = true;
                cbReg.Enabled = true;
            }

            if ((globalData.UserAccess == 5) || (globalData.UserAccess == 6))
            {
                dateTimePicker1.Enabled = false;
                cbReg.Enabled = false;
            }
        }
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:54,代码来源:AEReport.cs



注:本文中的DataLayer.sql类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DataTier.Data类代码示例发布时间:2022-05-24
下一篇:
C# DataLayer.Sql类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap