private void btnSet_Click(object sender, EventArgs e) { if (cbk.SelectedCount == 0) { MessageBox.Show("请选择要从区域款式中撤销的款式"); return; } string Pm_Ids = cbk.GetKeyIds("PM_Area_Id"); string[] strKey = "EUser_Id,EDept_Id,Fy_Id,Company_Id,PmIds,flag".Split(",".ToCharArray()); string[] strVal = new string[] { CApplication.App.CurrentSession.UserId.ToString(), CApplication.App.CurrentSession.DeptId.ToString(), CApplication.App.CurrentSession.FyId.ToString(), //CApplication.App.CurrentSession.Company_Id.ToString(), CApplication.App.CurrentSession.FyId.ToString(), Pm_Ids, "102" }; DataSet ds = this.DataRequest_By_DataSet(strSpName, strKey, strVal); if (ds.Tables[0].Rows[0][0].ToString() == "OK") { string[] PM_Area_Ids = Pm_Ids.TrimEnd(',').Split(','); for (int i = 0; i < PM_Area_Ids.Length; i++) { dsLoad.Tables[0].Rows.Remove(dsLoad.Tables[0].Select("PM_Area_Id = '" + PM_Area_Ids[i].ToString() + "' ")[0]); } gridCMain.DataSource = dsLoad.Tables[0]; } cbk.ClearSelection(); MessageBox.Show("移除成功!"); }
//设置特殊工费 private void btnSetFee_Click(object sender, EventArgs e) { Pm_Ids = cbk.GetKeyIds("款式序号"); if (Pm_Ids.Trim() == string.Empty) { MessageBox.Show("请先选择要维护特殊工费的款式"); return; } //string visibleIndex = this.gridVMain.SortInfo[0].Column.VisibleIndex.ToString(); //string columnname = this.gridVMain.SortInfo[0].Column.Name.Replace("col", ""); //GridColumn column = this.gridVMain.SortInfo[0].Column; //this.gridVMain.ClearSorting(); //if (visibleIndex != "0" && visibleIndex != "1" && visibleIndex != "2" && visibleIndex != "3" && visibleIndex != "4") //{ //Point a = System.Windows.Forms.Form.MousePosition; //int x = a.X; //int y = a.Y; DataRowView dr = (DataRowView)cbk.GetSelectedRow(0); string UintFeeType = decimal.Parse(dr["克工费"].ToString()) != 0 ? "Weight" : "Amount"; frmSetSpecialFee frmSpecialFee = new frmSetSpecialFee(true, this.chkComCust.Text, 100, 200); if (frmSpecialFee.ShowDialog() == DialogResult.OK) { Operate = frmSpecialFee.Operation.ToString(); OperateSetFee = frmSpecialFee.setfee.ToString(); for (int i = 0; i < gridVMain.RowCount; i++) { string ResultFee = string.Empty; if (cbk.IsRowSelected(i) == true) { switch (frmSpecialFee.Operation) { case 1: ResultFee = UintFeeType == "Weight" ? (decimal.Parse(this.gridVMain.GetRowCellValue(i, "克工费").ToString()) + frmSpecialFee.setfee).ToString() : (decimal.Parse(this.gridVMain.GetRowCellValue(i, "件工费").ToString()) + frmSpecialFee.setfee).ToString(); break; case 2: ResultFee = UintFeeType == "Weight" ? (decimal.Parse(this.gridVMain.GetRowCellValue(i, "克工费").ToString()) - frmSpecialFee.setfee).ToString() : (decimal.Parse(this.gridVMain.GetRowCellValue(i, "件工费").ToString()) - frmSpecialFee.setfee).ToString(); break; case 3: ResultFee = UintFeeType == "Weight" ? (decimal.Parse(this.gridVMain.GetRowCellValue(i, "克工费").ToString()) * frmSpecialFee.setfee).ToString() : (decimal.Parse(this.gridVMain.GetRowCellValue(i, "件工费").ToString()) * frmSpecialFee.setfee).ToString(); break; case 4: ResultFee = (frmSpecialFee.setfee).ToString(); break; default: break; } for (int j = 5; j < gridVMain.Columns.Count - 1; j++) { this.gridVMain.SetRowCellValue(i, gridVMain.Columns[j], ResultFee); } } } } }
//设置 private void btnSet_Click(object sender, EventArgs e) { if (txtCost.Text.Trim().Length == 0) { MessageBox.Show("输入修改后的基础销售工费"); return; } if (cbk.SelectedCount == 0) { MessageBox.Show("请选择要修改的款式"); return; } string Pm_Ids = cbk.GetKeyIds("PM_Id"); string[] strKey = "EUser_Id,EDept_Id,Fy_Id,WeightFee,AmoutFee,UnitType,Key_Ids,Flag".Split(",".ToCharArray()); string[] strVal = new string[] { CApplication.App.CurrentSession.UserId.ToString(), CApplication.App.CurrentSession.DeptId.ToString(), CApplication.App.CurrentSession.FyId.ToString(), txtCost.Text.Trim(), txtCost.Text.Trim(), cboUnitFee.SelectedIndex.ToString().Trim(), Pm_Ids, "202" }; DataSet dsUpdate = this.DataRequest_By_DataSet(strSpName, strKey, strVal); if (dsUpdate.Tables[0].Rows[0][0].ToString() == "OK") { for (int i = 0; i < gridVMain.RowCount; i++) { if (cbk.IsRowSelected(i)) { if (cboUnitFee.SelectedIndex.ToString().Trim() == "0") { gridVMain.SetRowCellValue(i, "WeightFee", txtCost.Text.Trim()); } else { gridVMain.SetRowCellValue(i, "AmoutFee", txtCost.Text.Trim()); } } } } cbk.ClearSelection(); MessageBox.Show("设置成功"); txtCost.Text = string.Empty; }
private void btnSet_Click(object sender, EventArgs e) { if (txtMergePNumber.Text.Trim().Length == 0) { MessageBox.Show("请输入合并后的款号"); txtMergePNumber.Focus(); return; } if (cbk.SelectedCount == 0) { MessageBox.Show("请选择要修改的款式"); return; } string Pm_Ids = cbk.GetKeyIds("PM_Id"); string[] strKey = "EUser_Id,EDept_Id,Fy_Id,MergePNumber,Key_Ids,flag".Split(",".ToCharArray()); string[] strVal = new string[] { CApplication.App.CurrentSession.UserId.ToString(), CApplication.App.CurrentSession.DeptId.ToString(), CApplication.App.CurrentSession.FyId.ToString(), txtMergePNumber.Text.Trim(), Pm_Ids, "101" }; DataSet ds = this.DataRequest_By_DataSet(strSpName, strKey, strVal); if (ds.Tables[0].Rows[0][0].ToString() == "OK") { for (int i = 0; i < gridView1.RowCount; i++) { if (cbk.IsRowSelected(i)) { gridView1.SetRowCellValue(i, "MergePNumber", txtMergePNumber.Text.Trim()); } } } cbk.ClearSelection(); MessageBox.Show("合并成功"); txtMergePNumber.Text = string.Empty; }