protected void loadData() { string nowdatestyle; if (this.radioButton1.Checked) { nowdatestyle = "录入"; } else { nowdatestyle = "锁定"; } NewFrm.Show(this); this.ly_invoiceTableAdapter.Fill(this.lYMaterielRequirements.ly_invoice, DateTime.Parse(this.dateTimePicker1.Text).Date, DateTime.Parse(this.dateTimePicker2.Text).Date, nowdatestyle); if (SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "发票总管理权限")) { if ("0002" == SQLDatabase.nowUserDepartmentBig()) { this.lyinvoiceBindingSource.Filter = "submit=True"; } } else { string salespeople = SQLDatabase.nowUserName(); lyinvoiceBindingSource.Filter = "sava_people='" + salespeople + "'"; } NewFrm.Hide(this); }
private void LY_Material_Plan_Load(object sender, EventArgs e) { this.ly_material_plan_mainTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.lY_dayget_material_sel_newTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.ly_plan_getmaterialPlanGxhOutTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.ly_plan_getmaterialPlanGxhInTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; if (!SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "计划领料审批")) { this.ly_material_plan_mainBindingSource.Filter = "制定人='" + SQLDatabase.nowUserName() + "'"; } else { if ("000" == SQLDatabase.NowUserID || "998" == SQLDatabase.NowUserID || "66" == SQLDatabase.NowUserID) { this.ly_material_plan_mainBindingSource.Filter = ""; } else if ("999" == SQLDatabase.NowUserID) { this.ly_material_plan_mainBindingSource.Filter = "部门='0003'"; } else { this.ly_material_plan_mainBindingSource.Filter = "部门='" + SQLDatabase.nowUserDepartmentBig() + "'"; } } this.ly_material_plan_mainTableAdapter.Fill(this.lYPlanMange.ly_material_plan_main, "GXJH"); SetFormState("View"); }
private void toolStripTextBox1_KeyUp(object sender, KeyEventArgs e) { string filterString; string clifilter = ""; if (SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "营业综合信息")) { clifilter = ""; } else { clifilter = "salesperson_code='" + SQLDatabase.NowUserID + "'"; } if ("" == clifilter) { filterString = GetDataGridviewMultiFilterString.DGVMultiFilterString(this.ly_sales_clientDataGridView, this.toolStripTextBox1.Text); } else { filterString = clifilter + " and (" + GetDataGridviewMultiFilterString.DGVMultiFilterString(this.ly_sales_clientDataGridView, this.toolStripTextBox1.Text) + ")"; } //if (null == filterString) // filterString = this.treeView1.SelectedNode.Tag.ToString(); this.ly_sales_clientBindingSource.Filter = filterString; }
private void ly_inma0010DataGridView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { DataGridView dgv = sender as DataGridView; if (!SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "财务分摊锁定")) { MessageBox.Show("无权限!"); return; } if ("lockFlag" == dgv.CurrentCell.OwningColumn.Name) { if ("True" == dgv.CurrentRow.Cells["lockFlag"].Value.ToString()) { dgv.CurrentRow.Cells["lockFlag"].Value = "False"; dgv.CurrentRow.Cells["lockpeo"].Value = DBNull.Value; dgv.CurrentRow.Cells["locktime"].Value = DBNull.Value; } else { dgv.CurrentRow.Cells["lockFlag"].Value = "True"; dgv.CurrentRow.Cells["lockpeo"].Value = SQLDatabase.nowUserName(); dgv.CurrentRow.Cells["locktime"].Value = DateTime.Now; } this.ly_inma0010DataGridView.EndEdit(); this.Validate(); this.tfentanBindingSource.EndEdit(); this.t_fentanTableAdapter.Update(this.lYMaterialMange.t_fentan); return; } }
private void LY_MaterialBom_Load(object sender, EventArgs e) { //this.ly_item_allcostTableAdapter.Fill(this.lYMaterialMange.ly_item_allcost, itemnoToolStripTextBox.Text); this.ly_item_allcostTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.ly_prod_deptTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.ly_prod_deptTableAdapter.Fill(this.lYMaterialMange.ly_prod_dept); this.ly_sales_matingBom_CostTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.bom_material_selTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.ly_bm0031TableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.ly_inma0010cpTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; if (SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "物料成本计算")) { this.toolStripButton6.Visible = true; } else { this.toolStripButton6.Visible = false; } this.ly_inma0010cpTableAdapter.Fill(this.lYMaterialMange.ly_inma0010cp); }
private void LY_Quality_Control_PurchaseRep_Load(object sender, EventArgs e) { this.dateTimePicker1.MinDate = DateTime.Parse("2019-01-01"); this.dateTimePicker1.Text = DateTime.Parse("2019-06-01").ToString(); this.dateTimePicker2.Text = DateTime.Today.Date.ToString(); //this.dateTimePicker3.MinDate = DateTime.Parse("2019-01-01"); this.dateTimePicker3.Text = new DateTime(DateTime.Now.Year, 1, 1).ToString("yyyy-MM-dd"); this.dateTimePicker4.Text = DateTime.Today.Date.ToString(); this.getOrderByBussCodeAllTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.getOrderWzbhByBussCodeAllTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.getOrderByBussCodeAll_ByOutTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; string salespeople = SQLDatabase.NowUserID; if (SQLDatabase.CheckHaveRight(salespeople, "设置客户期初应收")) { } else if (SQLDatabase.CheckHaveRight(salespeople, "查看客户期初应收")) { tabPage4.Parent = null; tabPage2.Parent = null; this.dataGridView5.Columns[19].Visible = false; } else { this.dataGridView5.Columns[19].Visible = false; tabPage4.Parent = null; tabPage2.Parent = null; } }
private void button2_Click(object sender, EventArgs e) { NewFrm.Show(this); string salespeople = SQLDatabase.NowUserID; if (SQLDatabase.CheckHaveRight(salespeople, "设置客户期初应收")) { this.getOrderWzbhByBussCodeAllTableAdapter.Fill(this.lYSalseMange.GetOrderWzbhByBussCodeAll, this.dateTimePicker1.Value , this.dateTimePicker2.Value.AddDays(1), ""); } else if (SQLDatabase.CheckHaveRight(salespeople, "查看客户期初应收")) { this.getOrderWzbhByBussCodeAllTableAdapter.Fill(this.lYSalseMange.GetOrderWzbhByBussCodeAll, this.dateTimePicker1.Value , this.dateTimePicker2.Value.AddDays(1), ""); } else { this.getOrderWzbhByBussCodeAllTableAdapter.Fill(this.lYSalseMange.GetOrderWzbhByBussCodeAll, this.dateTimePicker1.Value , this.dateTimePicker2.Value.AddDays(1), salespeople); } NewFrm.Hide(this); }
private void ly_stocktake_mainDataGridView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { DataGridView dgv = sender as DataGridView; if ("完成" == dgv.CurrentCell.OwningColumn.Name) { if (!SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "盘点数据批准")) { MessageBox.Show("没有盘点数据批准权限...", "注意"); return; } if ("True" != dgv.CurrentRow.Cells["完成"].Value.ToString()) { string message = "确定盘点完成吗?"; string caption = "提示..."; MessageBoxButtons buttons = MessageBoxButtons.YesNo; DialogResult result; result = MessageBox.Show(message, caption, buttons, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (result == DialogResult.Yes) { //dgv.CurrentRow.Cells["discount_money"].Value = dgv.CurrentRow.Cells["apply_money"].Value; dgv.CurrentRow.Cells["完成"].Value = "True"; this.ly_stocktake_detailDataGridView.ReadOnly = true; SaveChenged(); } } else { string message = "取消盘点完成吗吗?"; string caption = "提示..."; MessageBoxButtons buttons = MessageBoxButtons.YesNo; DialogResult result; result = MessageBox.Show(message, caption, buttons, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (result == DialogResult.Yes) { //dgv.CurrentRow.Cells["discount_money"].Value = DBNull.Value; //dgv.CurrentRow.Cells["apply_money"].Value = DBNull.Value; dgv.CurrentRow.Cells["完成"].Value = "False"; this.ly_stocktake_detailDataGridView.ReadOnly = false; setDetailColumn(); SaveChenged(); } } return; } }
private void ly_inma0010_sortDataGridView_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridView dgv = sender as DataGridView; if ("总检标识" == dgv.CurrentCell.OwningColumn.Name) { if (!SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "质检总检标识审核")) { MessageBox.Show("无检验标识审核权限...", "注意"); return; } if ("True" == dgv.CurrentRow.Cells["总检标识"].Value.ToString()) { dgv.CurrentRow.Cells["总检标识"].Value = "False"; } else { dgv.CurrentRow.Cells["总检标识"].Value = "True"; } this.ly_inma0010_sortDataGridView.EndEdit(); this.Validate(); this.ly_inma0010_sortBindingSource.EndEdit(); this.ly_inma0010_sortTableAdapter.Update(this.lYMaterielRequirements.ly_inma0010_sort); return; } }
private void LY_Material_Plan_Load(object sender, EventArgs e) { this.ly_material_plan_mainTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.lY_dayget_material_selTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.ly_plan_getmaterialTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; if ("0003" == SQLDatabase.nowUserDepartmentBig() || "000" == SQLDatabase.NowUserID || "999" == SQLDatabase.NowUserID || "998" == SQLDatabase.NowUserID || "66" == SQLDatabase.NowUserID) { this.客户名称TextBox.Visible = true; 客户名称Label.Visible = true; this.客户编码TextBox.Visible = true; this.营业员码TextBox.Visible = true; 营业员Label.Visible = true; this.营业员TextBox.Visible = true; this.button8.Visible = true; } else { this.客户名称TextBox.Visible = false; 客户名称Label.Visible = false; this.客户编码TextBox.Visible = false; this.营业员码TextBox.Visible = false; 营业员Label.Visible = false; this.营业员TextBox.Visible = false; this.button8.Visible = false; } if (!SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "计划领料审批")) { this.ly_material_plan_mainBindingSource.Filter = "制定人='" + SQLDatabase.nowUserName() + "'"; //this.完成CheckBox.Visible = false; } else { if ("000" == SQLDatabase.NowUserID || "998" == SQLDatabase.NowUserID || "66" == SQLDatabase.NowUserID) { this.ly_material_plan_mainBindingSource.Filter = ""; } else if ("999" == SQLDatabase.NowUserID) { this.ly_material_plan_mainBindingSource.Filter = "部门='0003'"; } else { this.ly_material_plan_mainBindingSource.Filter = "部门='" + SQLDatabase.nowUserDepartmentBig() + "'"; } //this.完成CheckBox.Visible = true ; } this.ly_material_plan_mainTableAdapter.Fill(this.lYPlanMange.ly_material_plan_main, "LLJH"); SetFormState("View"); }
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { //this.ly_sales_clientBindingSource.Filter = e.Node.Tag.ToString() ; this.nowfilterStr = e.Node.Tag.ToString(); if (e.Node.Level == 2) { //this.ly_sales_clientDataGridView.Columns["yhbm"].Visible = false; //this.ly_sales_clientDataGridView.Columns["yhmc"].Visible = false; this.nowusercode = this.nowfilterStr.Substring(this.nowfilterStr.Length - 4, 3); this.nowfillstragecode = "single"; //this.ly_sales_contract_main1DataGridView.SelectionChanged -= ly_sales_contract_main1DataGridView_SelectionChanged; //this.ly_sales_contract_main1TableAdapter.Fill(this.lYSalseMange.ly_sales_contract_main1, this.nowusercode,"single", this.dateTimePicker1.Value , this.dateTimePicker2.Value ); //AddSummationRow_New(ly_sales_contract_main1BindingSource, ly_sales_contract_main1DataGridView); //this.ly_sales_contract_main1DataGridView.SelectionChanged += ly_sales_contract_main1DataGridView_SelectionChanged; } else if (e.Node.Level == 1) { //this.ly_sales_clientDataGridView.Columns["yhbm"].Visible = true ; //this.ly_sales_clientDataGridView.Columns["yhmc"].Visible = true ; this.nowusercode = this.nowfilterStr.Substring(this.nowfilterStr.Length - 3, 2); this.nowfillstragecode = "region"; //this.ly_sales_contract_main1DataGridView.SelectionChanged -= ly_sales_contract_main1DataGridView_SelectionChanged; //this.ly_sales_contract_main1TableAdapter.Fill(this.lYSalseMange.ly_sales_contract_main1, this.nowusercode, "region", this.dateTimePicker1.Value, this.dateTimePicker2.Value); //AddSummationRow_New(ly_sales_contract_main1BindingSource, ly_sales_contract_main1DataGridView); //this.ly_sales_contract_main1DataGridView.SelectionChanged += ly_sales_contract_main1DataGridView_SelectionChanged; } else if (e.Node.Level == 0) { //this.ly_sales_clientDataGridView.Columns["yhbm"].Visible = true; //this.ly_sales_clientDataGridView.Columns["yhmc"].Visible = true; this.nowusercode = ""; this.nowfillstragecode = "full"; if (SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "营业区域信息")) { this.nowusercode = this.nowfilterStr.Substring(this.nowfilterStr.Length - 3, 2); this.nowfillstragecode = "region"; } //this.ly_sales_contract_main1DataGridView.SelectionChanged -= ly_sales_contract_main1DataGridView_SelectionChanged; //this.ly_sales_contract_main1TableAdapter.Fill(this.lYSalseMange.ly_sales_contract_main1, this.nowusercode, "full", this.dateTimePicker1.Value, this.dateTimePicker2.Value); //AddSummationRow_New(ly_sales_contract_main1BindingSource, ly_sales_contract_main1DataGridView); //this.ly_sales_contract_main1DataGridView.SelectionChanged += ly_sales_contract_main1DataGridView_SelectionChanged; } //this.ly_sales_standard_Report_giveTableAdapter.Fill(this.lYSalseMange.ly_sales_borrow_detail_all, this.nowusercode, this.nowfillstragecode, this.dateTimePicker1.Value, this.dateTimePicker2.Value); this.ly_sales_repairstandard_ReportTableAdapter.Fill(this.lYSalseMange2.ly_sales_repairstandard_Report, this.nowusercode, this.nowfillstragecode, this.dateTimePicker3.Value, this.dateTimePicker4.Value.AddDays(1)); AddSummationRow_New(ly_sales_repairstandard_ReportBindingSource, ly_sales_contract_standard_ReportDataGridView); }
private void toolStripButton1_Click(object sender, EventArgs e) { if (!SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "盘点数据批准")) { MessageBox.Show("没有盘点数据批准权限...", "注意"); return; } this.SetFormState("Edit"); }
private void toolStripButton12_Click(object sender, EventArgs e) { if (ly_payable_NPDataGridView.CurrentRow == null) { return; } if (!SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "非采购供应商账款删除")) { MessageBox.Show("无删除权限", "注意"); return; } else { string salespeople = this.ly_payable_NPDataGridView.CurrentRow.Cells["录入人"].Value.ToString(); if (!string.IsNullOrEmpty(salespeople)) { if (salespeople != SQLDatabase.nowUserName()) { MessageBox.Show("请录入人:" + salespeople + "删除", "注意"); return; } } } //if (ly_fpDataGridView.CurrentRow.Cells["lock_flag"].Value.ToString() == "True") //{ // MessageBox.Show("已经锁定无法操作...", "注意"); // return; //} //if (ly_invoice_detailDataGridView.Rows.Count > 0) //{ // MessageBox.Show("该发票已经绑定入库单...", "注意"); // return; //} string caption = "提示..."; MessageBoxButtons buttons = MessageBoxButtons.YesNo; DialogResult result; string message = "确定要删除吗"; result = MessageBox.Show(message, caption, buttons, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (result == DialogResult.Yes) { this.ly_payable_NPBindingSource.RemoveCurrent(); this.ly_payable_NPTableAdapter.Update(this.lYFinancialMange.ly_payable_NP); } else { return; } }
private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e) { if (ly_fpDataGridView.CurrentRow == null) { return; } if (SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "发票总管理权限")) { } else { string salespeople = this.ly_fpDataGridView.CurrentRow.Cells["录入人"].Value.ToString(); if (!string.IsNullOrEmpty(salespeople)) { if (salespeople != SQLDatabase.nowUserName()) { MessageBox.Show("请录入人:" + salespeople + "删除", "注意"); return; } } } if (ly_fpDataGridView.CurrentRow.Cells["lock_flag"].Value.ToString() == "True") { MessageBox.Show("已经锁定无法操作...", "注意"); return; } if (ly_invoice_detailDataGridView.Rows.Count > 0) { MessageBox.Show("该发票已经绑定入库单...", "注意"); return; } string caption = "提示..."; MessageBoxButtons buttons = MessageBoxButtons.YesNo; DialogResult result; string message = "确定要删除吗"; result = MessageBox.Show(message, caption, buttons, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (result == DialogResult.Yes) { this.lyinvoiceBindingSource.RemoveCurrent(); save(); } else { return; } }
private void LY_MaterialAdd_Load(object sender, EventArgs e) { this.ly_salesregionTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.ly_salesregionTableAdapter.Fill(this.lYSalseMange.ly_salesregion); this.ly_sales_gift_styleTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.ly_sales_gift_styleTableAdapter.Fill(this.lYSalseMange2.ly_sales_gift_style); this.ly_sales_contract_styleTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.ly_sales_contract_styleTableAdapter.Fill(this.lYSalseMange.ly_sales_contract_style); this.ly_salesregion_secondTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.ly_salesregion_secondTableAdapter.Fill(this.lYSalseMange.ly_salesregion_second); this.ly_salespersonTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.ly_salespersonTableAdapter.Fill(this.lYSalseMange.ly_salesperson); this.ly_sales_clientTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; if (SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "营业综合信息")) { this.lysalespersonBindingSource.Filter = ""; } else { this.lysalespersonBindingSource.Filter = "编码='" + SQLDatabase.NowUserID + "'"; } this.ly_sales_clientTableAdapter.Fill(this.lYSalseMange.ly_sales_client); if ("增加" == runmode) { this.Text = "新增客户信息"; this.ly_sales_clientBindingSource.AddNew(); this.salesclient_code = GetSalesclientCode(); this.客户编码TextBox.Text = this.salesclient_code; this.operatorTextBox.Text = SQLDatabase.nowUserName(); this.sys_dateDateTimePicker.Value = SQLDatabase.GetNowdate(); } else { this.ly_sales_clientTableAdapter.Fill(this.lYSalseMange.ly_sales_client); this.ly_sales_clientBindingSource.Filter = "客户编码='" + salesclient_code + "'"; this.Text = "修改客户信息"; } }
private void toolStripButton53_Click(object sender, EventArgs e) { this.ly_invoice_contrat_lockTableAdapter.Fill(this.lYMaterielRequirements.ly_invoice_contrat_lock, this.dateTimePicker1.Value, this.dateTimePicker2.Value.AddDays(1)); if (SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "发票总管理权限")) { } else { string salespeople = SQLDatabase.nowUserName(); lyinvoicecontratlockBindingSource.Filter = "采购员='" + salespeople + "'"; } }
private void ly_material_plan_mainDataGridView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { DataGridView dgv = sender as DataGridView; if (null == dgv.CurrentRow) { return; } if (!SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "改制计划审批")) { MessageBox.Show("无批准权限...", "注意"); return; } //if (this.ly_sales_contract_mainDataGridView.CurrentRow.Cells["录入人c"].Value.ToString() != SQLDatabase.nowUserName()) //{ // MessageBox.Show("请" + this.ly_sales_contract_mainDataGridView.CurrentRow.Cells["录入人c"].Value.ToString() + "修改...", "注意"); // return; //} if ("启用" == dgv.CurrentCell.OwningColumn.Name) { if ("True" == dgv.CurrentRow.Cells["启用"].Value.ToString()) { dgv.CurrentRow.Cells["启用"].Value = "False"; dgv.CurrentRow.Cells["批准人"].Value = DBNull.Value; dgv.CurrentRow.Cells["批准日期"].Value = DBNull.Value; } else { dgv.CurrentRow.Cells["启用"].Value = "True"; dgv.CurrentRow.Cells["批准人"].Value = SQLDatabase.nowUserName(); dgv.CurrentRow.Cells["批准日期"].Value = SQLDatabase.GetNowdate(); } this.ly_material_plan_mainDataGridView.EndEdit(); this.ly_material_plan_mainBindingSource.EndEdit(); this.ly_material_plan_mainTableAdapter.Update(this.lYPlanMange.ly_material_plan_main); return; } }
private void 设置产品系列ToolStripMenuItem_Click(object sender, EventArgs e) { if (!SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "设置产品系列")) { return; } DataGridView dgv = ly_inma0010DataGridView; string nowitemno; string sel = "SELECT distinct series_code as 系列编码,series_name as 系列名称 FROM ly_inma0010_series "; QueryForm queryForm = new QueryForm(); queryForm.Sel = sel; queryForm.Constr = SQLDatabase.Connectstring; queryForm.ShowDialog(); dgv.Columns["系列码"].SortMode = DataGridViewColumnSortMode.NotSortable; NewFrm.Show(this); foreach (DataGridViewRow dgr in dgv.Rows) { if (true == dgr.Selected) { nowitemno = dgr.Cells["物资编号"].Value.ToString(); this.itemlist.Add(nowitemno); NewFrm.Notify(this, "正在更新: (" + nowitemno + ")" + " 产品系列"); Update_ser(nowitemno, queryForm.Result, queryForm.Result1); } } this.ly_inma0010cpTableAdapter.Fill(this.lYMaterialMange.ly_inma0010cp); NewFrm.Hide(this); int nowindex = 0; foreach (string nowitem in itemlist) { nowindex = this.ly_inma0010cpBindingSource.Find("物资编号", nowitem); dgv.Rows[nowindex].Selected = true; } }
private void Yonghu_Load(object sender, EventArgs e) { this.ly_sales_clientTableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.ly_sales_clientTableAdapter.Fill(this.lYSalseMange.ly_sales_client); string selAllString; if (SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "营业综合信息")) { selAllString = "SELECT a.salesregion_code, a.salesregion_code+':'+a.salesregion_name as salesregion_name,b.yhbm,b.yhbm+':'+b.yhmc as yhmc FROM ly_salesregion a left join T_users b on a.salesregion_code=b.salesregion_code ORDER BY salesregion_code "; } else if (SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "营业区域信息")) { selAllString = "SELECT a.salesregion_code, a.salesregion_code+':'+a.salesregion_name as salesregion_name,b.yhbm,b.yhbm+':'+b.yhmc as yhmc FROM ly_salesregion a left join T_users b on a.salesregion_code=b.salesregion_code where b.salesregion_code='" + SQLDatabase.nowSalesregioncode() + "' ORDER BY salesregion_code "; } else { selAllString = "SELECT a.salesregion_code, a.salesregion_code+':'+a.salesregion_name as salesregion_name,b.yhbm,b.yhbm+':'+b.yhmc as yhmc FROM ly_salesregion a left join T_users b on a.salesregion_code=b.salesregion_code where b.yhbm='" + SQLDatabase.NowUserID + "' ORDER BY salesregion_code "; } SqlDataAdapter salesregionAdapter = new SqlDataAdapter(selAllString, SQLDatabase.Connectstring); DataSet salesregionData = new DataSet(); salesregionAdapter.Fill(salesregionData); System.Windows.Forms.TreeNode TNode = new System.Windows.Forms.TreeNode(); TNode.Text = "中原精密有限公司"; if (SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "营业综合信息")) { TNode.Tag = ""; } else if (SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "营业区域信息")) { TNode.Tag = "salesregion_code='" + SQLDatabase.nowSalesregioncode() + "'"; } else { TNode.Tag = "salesperson_code='" + SQLDatabase.NowUserID + "'"; } this.treeView1.Nodes.Add(TNode); MakeTreeView(salesregionData.Tables[0], null, TNode); this.treeView1.ExpandAll(); SetViewState("View"); }
private void 除子件ToolStripMenuItem_Click(object sender, EventArgs e) { if (!SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "指定物料负责人")) { return; } DataGridView dgv = ly_inma0010DataGridView; string nowitemno; string sel = "SELECT distinct yhbm as 代码,yhmc as 名称 FROM T_users where bumen='0007' order by yhbm"; QueryForm queryForm = new QueryForm(); queryForm.Sel = sel; queryForm.Constr = SQLDatabase.Connectstring; queryForm.ShowDialog(); dgv.Columns["负责人"].SortMode = DataGridViewColumnSortMode.NotSortable; NewFrm.Show(this); foreach (DataGridViewRow dgr in dgv.Rows) { if (true == dgr.Selected) { nowitemno = dgr.Cells["物资编号"].Value.ToString(); this.itemlist.Add(nowitemno); NewFrm.Notify(this, "正在更新: (" + nowitemno + ")" + " 负责人"); Update_work_people(nowitemno, queryForm.Result1); } } this.ly_inma0010cpTableAdapter.Fill(this.lYMaterialMange.ly_inma0010cp); NewFrm.Hide(this); int nowindex = 0; foreach (string nowitem in itemlist) { nowindex = this.ly_inma0010cpBindingSource.Find("物资编号", nowitem); dgv.Rows[nowindex].Selected = true; } }
private void 公司编码Label_MouseDoubleClick(object sender, MouseEventArgs e) { if (SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "营业综合信息")) { LY_Company_Info queryForm = new LY_Company_Info(); // queryForm.Cardnumber = this.xD_Sel_SellBalanceDataGridView.CurrentRow.Cells["编号"].Value.ToString(); queryForm.StartPosition = FormStartPosition.CenterParent; queryForm.ShowDialog(); this.ly_company_informationTableAdapter.Fill(this.lYSalseMange.ly_company_information); } }
private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e) { string message = "确定删除当前记录吗?"; string caption = "提示..."; MessageBoxButtons buttons = MessageBoxButtons.YesNo; DialogResult result; if (!checkLock()) { MessageBox.Show("已经锁定无法修改...", "注意"); return; } if (!SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "指定物料负责人")) { string salespeople = this.ly_inma0010DataGridView.CurrentRow.Cells["负责人"].Value.ToString(); if (!string.IsNullOrEmpty(salespeople)) { if (salespeople != SQLDatabase.nowUserName()) { MessageBox.Show("请负责人:" + salespeople + "操作", "注意"); return; } } else { MessageBox.Show("请联系技术部领导进行负责人指定...", "注意"); return; } } result = MessageBox.Show(message, caption, buttons, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (result == DialogResult.Yes) { try { this.ly_inma0010cpBindingSource.RemoveCurrent(); ly_inma0010DataGridView.EndEdit(); ly_inma0010cpBindingSource.EndEdit(); this.ly_inma0010cpTableAdapter.Update(this.lYMaterialMange.ly_inma0010cp); } catch (SqlException ex) { MessageBox.Show(ex.Message.ToString(), "注意"); } } }
private void ly_purchase_contract_inspectionRepDataGridView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { DataGridView dgv = sender as DataGridView; if (dgv.CurrentRow == null) { return; } if (SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "外协退料过检")) { } else { MessageBox.Show("无权限,不能通过...", "注意"); return; } if ("True" == dgv.CurrentRow.Cells["入库"].Value.ToString()) { MessageBox.Show("已入库,不能通过...", "注意"); return; } if ("审核" == dgv.CurrentCell.OwningColumn.Name) { if ("True" == dgv.CurrentRow.Cells["审核"].Value.ToString()) { string people = dgv.CurrentRow.Cells["审核人"].Value.ToString(); if (people != SQLDatabase.nowUserName()) { MessageBox.Show("请审核人:" + people + " 操作", "注意"); return; } dgv.CurrentRow.Cells["审核"].Value = "False"; dgv.CurrentRow.Cells["审核人"].Value = DBNull.Value; dgv.CurrentRow.Cells["审核时间"].Value = DBNull.Value; } else { dgv.CurrentRow.Cells["审核"].Value = "True"; dgv.CurrentRow.Cells["审核人"].Value = SQLDatabase.nowUserName(); dgv.CurrentRow.Cells["审核时间"].Value = DateTime.Now; } this.ly_purchase_contract_inspectionRepDataGridView.EndEdit(); this.toutsourceapproveBindingSource.EndEdit(); this.t_outsource_approveTableAdapter.Update(this.lYQualityInspector.t_outsource_approve); return; } }
private void toolStripTextBox1_Enter(object sender, EventArgs e) { toolStripTextBox1.Text = ""; if (SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "发票总管理权限")) { this.lyinvoicecontratlockBindingSource.Filter = " "; //管理员和财务部可以看到全部信息 } else { string salespeople = SQLDatabase.nowUserName(); lyinvoicecontratlockBindingSource.Filter = "采购员='" + salespeople + "'"; } }
private void ly_material_plan_mainDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridView dgv = sender as DataGridView; if (null == dgv.CurrentRow) { return; } if (!SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "计划领料审批")) { MessageBox.Show("无批准权限...", "注意"); return; } }
private void toolStripTextBox1_Enter(object sender, EventArgs e) { toolStripTextBox1.Text = ""; string clifilter = ""; if (SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "营业综合信息")) { clifilter = ""; } else { clifilter = "salesperson_code='" + SQLDatabase.NowUserID + "'"; } this.ly_sales_clientBindingSource.Filter = clifilter; }
private void SetHavePricerIGHT() { if (SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "单价金额查看")) { DataGridViewColumnSelector cs = new DataGridViewColumnSelector(ly_inma0010DataGridView, this.Text); cs.MaxHeight = 180; cs.Width = 800; cs.Set_dgvColumns(); //////////////////////////////// CountMoney(ly_inma0010BindingSource, ly_inma0010DataGridView); ly_inma0010DataGridView.Columns["入库金额"].Visible = true; ly_inma0010DataGridView.Columns["出库金额"].Visible = true; ly_inma0010DataGridView.Columns["库存单价"].Visible = true; ly_inma0010DataGridView.Columns["库存金额"].Visible = true; ly_inma0010DataGridView.Columns["计划出库金额"].Visible = true; ly_inma0010DataGridView.Columns["计划库存金额"].Visible = true; ly_inma0010DataGridView.Columns["dynamic_price"].Visible = true; ly_inma0010DataGridView.Columns["machine_price"].Visible = true; ly_inma0010DataGridView.Columns["assembly_price"].Visible = true; ly_inma0010DataGridView.Columns["outsource_price"].Visible = true; ly_inma0010DataGridView.Columns["machine_outsource_price"].Visible = true; } else { ly_inma0010DataGridView.Columns["入库金额"].Visible = false; ly_inma0010DataGridView.Columns["出库金额"].Visible = false; ly_inma0010DataGridView.Columns["库存单价"].Visible = false; ly_inma0010DataGridView.Columns["库存金额"].Visible = false; ly_inma0010DataGridView.Columns["计划出库金额"].Visible = false; ly_inma0010DataGridView.Columns["计划库存金额"].Visible = false; ly_inma0010DataGridView.Columns["dynamic_price"].Visible = false; ly_inma0010DataGridView.Columns["machine_price"].Visible = false; ly_inma0010DataGridView.Columns["assembly_price"].Visible = false; ly_inma0010DataGridView.Columns["outsource_price"].Visible = false; ly_inma0010DataGridView.Columns["machine_outsource_price"].Visible = false; this.tabPage6.Parent = null; this.tabPage4.Parent = null; this.tabPage7.Parent = null; this.tabPage8.Parent = null; this.tabPage9.Parent = null; } }
private void ly_cg_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { if (ly_cg.CurrentRow == null) { return; } if (!SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "发票总管理权限")) { MessageBox.Show("无权限锁定", "注意"); return; } DataGridView dgv = sender as DataGridView; if ("锁定" == dgv.CurrentCell.OwningColumn.Name) { string sql = ""; if ("True" == dgv.CurrentRow.Cells["锁定"].Value.ToString()) { dgv.CurrentRow.Cells["锁定"].Value = "False"; dgv.CurrentRow.Cells["锁定人"].Value = DBNull.Value; dgv.CurrentRow.Cells["锁定时间"].Value = DBNull.Value; sql = @"update ly_invoice_contract SET is_lock =null ,is_lock_time =null ,is_lock_people =null where id =" + dgv.CurrentRow.Cells["fpid"].Value.ToString(); } else { dgv.CurrentRow.Cells["锁定"].Value = "True"; dgv.CurrentRow.Cells["锁定人"].Value = SQLDatabase.nowUserName(); dgv.CurrentRow.Cells["锁定时间"].Value = SQLDatabase.GetNowtime(); sql = @"update ly_invoice_contract SET is_lock =1 ,is_lock_time ='" + SQLDatabase.GetNowtime() + "' ,is_lock_people ='" + SQLDatabase.nowUserName() + "' where id =" + dgv.CurrentRow.Cells["fpid"].Value.ToString(); } using (SqlConnection con = new SqlConnection(SQLDatabase.Connectstring)) { using (SqlCommand cmd = new SqlCommand(sql, con)) { con.Open(); cmd.ExecuteNonQuery(); } } return; } }
private void toolStripTextBox1_KeyUp(object sender, KeyEventArgs e) { string filterString; filterString = GetDataGridviewMultiFilterString.DGVMultiFilterString(this.ly_cg, this.toolStripTextBox1.Text); if (SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "发票总管理权限")) { this.lyinvoicecontratlockBindingSource.Filter = "(" + filterString + ")"; //管理员和财务部可以看到全部信息 } else { string salespeople = SQLDatabase.nowUserName(); this.lyinvoicecontratlockBindingSource.Filter = "(" + filterString + ") and 采购员='" + salespeople + "'"; } }
private void LY_MaterialBom_Load(object sender, EventArgs e) { if (SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "物料成本计算")) { this.ly_inma0010DataGridView.Columns["成本单价"].Visible = true; this.toolStripButton6.Visible = true; } else { this.ly_inma0010DataGridView.Columns["成本单价"].Visible = false; this.toolStripButton6.Visible = false; } this.ly_inma00101TableAdapter.Connection.ConnectionString = SQLDatabase.Connectstring; this.ly_inma00101TableAdapter.Fill(this.lYMaterialMange.ly_inma00101); }