/// <summary> /// 加载数据 /// </summary> /// <param name="MaterialGuid"></param> private void FillData(string MaterialGuid) { MaterialManage MaterialManage = new MaterialManage(); DataTable dtl = MaterialManage.GetMaterial(MaterialGuid); if (dtl.Rows.Count > 0) { txtGuid.Text = dtl.Rows[0]["MaterialGuId"].ToString(); txtMaterialId.Text = dtl.Rows[0]["MaterialId"].ToString(); txtMaterialName.Text = dtl.Rows[0]["MaterialName"].ToString(); txtSpec.Text = dtl.Rows[0]["SpecInterName"].ToString(); txtSpec.Tag = dtl.Rows[0]["Spec"].ToString(); txtUnit.Text = dtl.Rows[0]["UnitInterName"].ToString(); txtUnit.Tag = dtl.Rows[0]["Unit"].ToString(); txtClass.Text = dtl.Rows[0]["ClassInterName"].ToString(); txtClass.Tag = dtl.Rows[0]["Classid"].ToString(); txtPlace.Text = dtl.Rows[0]["Place"].ToString(); txtCalculateMethod.Text = dtl.Rows[0]["CalculateMethodInterName"].ToString(); txtCalculateMethod.Tag = dtl.Rows[0]["CalculateMethod"].ToString(); txtRemark.Text = dtl.Rows[0]["Remark"].ToString(); txtPicID.Text = dtl.Rows[0]["PicID"].ToString(); txtClientID.Text = dtl.Rows[0]["ClientID"].ToString(); txtSupplierGuid.Text = dtl.Rows[0]["SupplierName"].ToString(); txtSupplierGuid.Tag = dtl.Rows[0]["SupplierGuid"].ToString(); txtSafeStockSum.Text = dtl.Rows[0]["SafeStockSum"].ToString(); if (dtl.Rows[0]["IsEnable"].ToString().Trim() == "1") { chkStop.Checked = true; } txtPrice.Text = dtl.Rows[0]["Price"].ToString().Trim(); } }
/// <summary> /// 加载数据 /// </summary> /// <param name="MaterialGuid"></param> private void FillData(string MaterialGuid) { MaterialManage MaterialManage = new MaterialManage(); DataTable dtl = MaterialManage.GetMaterial(MaterialGuid); if (dtl.Rows.Count > 0) { txtGuid.Text = dtl.Rows[0]["MaterialGuId"].ToString(); txtMaterialId.Text = dtl.Rows[0]["MaterialId"].ToString(); txtMaterialName.Text = dtl.Rows[0]["MaterialName"].ToString(); cboSpec.Text = dtl.Rows[0]["Spec"].ToString(); cboUnit.Text = dtl.Rows[0]["Unit"].ToString(); txtClass.Text = dtl.Rows[0]["ClassName"].ToString(); txtClass.Tag = dtl.Rows[0]["Classid"].ToString(); txtBarNo.Text = dtl.Rows[0]["BarNo"].ToString(); txtPlace.Text = dtl.Rows[0]["Place"].ToString(); cboCalculateMethod.Text = dtl.Rows[0]["CalculateMethod"].ToString(); cboEncapsulation.Text = dtl.Rows[0]["Encapsulation"].ToString(); txtRemark.Text = dtl.Rows[0]["Remark"].ToString(); txtUpperLimit.Text = dtl.Rows[0]["UpperLimit"].ToString(); txtLowerLimit.Text = dtl.Rows[0]["LowerLimit"].ToString(); txtIConsultPrice.Text = dtl.Rows[0]["IConsultPrice"].ToString(); txtEConsultPrice.Text = dtl.Rows[0]["EConsultPrice"].ToString(); } this.ShowDialog(); }
bool IExtensionPlugin.InitializePlugin() { totalMenuName = GetMayaWindowName(); cds.AddRange(BasicFunc.GetCommandDatas()); cds.AddRange(BindHumanBody.GetCommandDatas()); cds.AddRange(DynamicConverter.GetCommandDatas()); cds.AddRange(JointProcess.GetCommandDatas()); cds.AddRange(MaterialManage.GetCommandDatas()); cds.AddRange(BindAttr.GetCommandDatas()); cds.AddRange(Selector.GetCommandDatas()); cds.AddRange(BindSwitch.GetCommandDatas()); cds.AddRange(MeshTool.GetCommandDatas()); foreach (CommandData cd in cds) { AddOneCommand(cd); } //int paramInt = (int)MPCMap.MPCType.Test; //AddMenuItem("Test", totalMenuName, "InazumaCommand", paramInt); //string subMenuName_bodyBind = AddSubMenu(totalMenuName, "Body Bind", true); //string subMenuName_create = AddSubMenu(totalMenuName, "Create", true); //paramInt = (int)MPCMap.MPCType.AddRPIK; //AddMenuItem("add rpik", subMenuName_bodyBind, "InazumaCommand", paramInt); //paramInt = (int)MPCMap.MPCType.AddRPIKPole; //AddMenuItem("add rpik pole", subMenuName_create, "InazumaCommand", paramInt); //paramInt = (int)MPCMap.MPCType.CreateCTL_CrysTal; //AddMenuItem("create cystal ctl", subMenuName_create, "InazumaCommand", paramInt); //paramInt = (int)MPCMap.MPCType.AddChildCtl; //AddMenuItem("add child ctl", subMenuName_create, "InazumaCommand", paramInt); //paramInt = (int)MPCMap.MPCType.AddParentCtl; //AddMenuItem("add parent ctl", subMenuName_create, "InazumaCommand", paramInt); //paramInt = (int)MPCMap.MPCType.AddReverseFootBones; //AddMenuItem("add reverse foot bones", subMenuName_create, "InazumaCommand", paramInt); //paramInt = (int)MPCMap.MPCType.BindReverseFootRPIK; //AddMenuItem("Bind Reverse Foot RPIK", subMenuName_bodyBind, "InazumaCommand", paramInt); //paramInt = (int)MPCMap.MPCType.BindFinger_CTL_L; //AddMenuItem("Bind Finger using CTL L", subMenuName_bodyBind, "InazumaCommand", paramInt); //paramInt = (int)MPCMap.MPCType.CreateJointsCurve; //AddMenuItem("Create Joints Curve", subMenuName_create, "InazumaCommand", paramInt); //paramInt = (int)MPCMap.MPCType.MakeHairJointsChain; //AddMenuItem("Make Hair Joints To Chain", subMenuName_bodyBind, "InazumaCommand", paramInt); Debug.Log("-回港了-"); return(true); }
private void btnUpdate_Click(object sender, EventArgs e) { if (txtOldMaterialID.Text.Trim() == "") { ShowMessage("请输入原物料编号!"); return; } if (txtNewMaterialID.Text.Trim() == "") { ShowMessage("请输入新物料编号!"); return; } MaterialManage MaterialManage = new MaterialManage(); Material Material = new Material(); Material = MaterialManage.GetMaterialByID(txtOldMaterialID.Text.Trim()); if (Material.MaterialID == null) { ShowMessage("原物料编号不存在,无法更新!"); return; } else { //现查找是否目标物料编号已经存在.如果存在则提示不能更新,只能改成目标物料不存在的物料编号 Material = new Material(); Material = MaterialManage.GetMaterialByID(txtNewMaterialID.Text.Trim()); if (Material.MaterialID != null) { ShowMessage("新物料编号已经存在,无法更新!"); return; } else { //执行物料编号的变更 MaterialManage.ChangeMaterialID(txtOldMaterialID.Text.Trim(), txtNewMaterialID.Text.Trim()); //写日志 SysLog.AddOperateLog(SysParams.UserName, "修改物料编号", "修改物料编号", SysParams.UserName + "用户修改了物料编号,原物料编号:" + txtOldMaterialID.Text.Trim() + ",新物料编号:" + txtNewMaterialID.Text.Trim()); ShowMessage("新物料编号已经更新成功!"); } } }
//-------------------------------------------------- private void btnDelete_Click(object sender, EventArgs e) { if (gridView1.RowCount > 0) { DataRowView dr = (DataRowView)(gridView1.GetFocusedRow()); if (MessageBox.Show("确定删除该数据!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { ClientOrderManage ClientOrderManage = new ClientOrderManage(); dr = (DataRowView)(gridView1.GetFocusedRow()); if (ClientOrderManage.GetIsCheck(dr["ClientOrderGuid"].ToString()) == false) { //----------------------------------------------------- MaterialManage MaterialManage = new MaterialManage(); if (MaterialManage.OrderDeleteAlert() == true) { //加载出被引用的单据 List <YJOrderDelete> lst = IsYJOrderDelete(dr["ClientOrderGuid"].ToString()); if (lst.Count > 0) { frmShowYJOrderDelete frmShowYJOrderDelete = new frmShowYJOrderDelete(); frmShowYJOrderDelete.ShowFillData(lst); return; } } //--------------------------------------------------------- ClientOrderManage.DeleteBill(dr["ClientOrderGuid"].ToString()); //写日志 SysLog.AddOperateLog(SysParams.UserName, "客户订单删除", "删除", SysParams.UserName + "用户删除了客户订单,订单唯一号:" + dr["ClientOrderGuid"].ToString()); gridView1.DeleteSelectedRows(); this.ShowMessage("删除成功!"); } else { this.ShowMessage("此单据已经审核或结单,不能删除!"); } } } }
private void btnQry_Click(object sender, EventArgs e) { MaterialManage MaterialManage = new MaterialManage(); Material Material = new Material(); Material = MaterialManage.GetMaterialByID(txtMaterialID.Text.Trim()); if (Material == null) { ShowMessage("此物料编号不存在,请重新查询!"); return; } else { txtMaterialName.Text = Material.MaterialName; } }
public void LoadData(string strMaterialGuid) { MaterialManage MaterialManage = new MaterialManage(); Material material = new Material(); material = MaterialManage.GetMaterialByGuid(strMaterialGuid); txtMaterialID.Text = material.MaterialID; txtMaterialName.Text = material.MaterialName; txtSpec.Text = base.GetBasicDataNameByID(material.Spec); txtUnit.Text = base.GetBasicDataNameByID(material.Unit); DataTable dtl = MaterialManage.sp_GetStorageSumData(strMaterialGuid); gridControl1.DataSource = dtl; }
//载入数据 public void ShowData(string MaterialGuid, IWin32Window ifrm) { MaterialManage MaterialManage = new MaterialManage(); DataTable dtl = MaterialManage.GetMaterial(MaterialGuid); if (dtl.Rows.Count > 0) { txtMaterialName.Text = dtl.Rows[0]["MaterialName"].ToString(); txtBarNo.Text = dtl.Rows[0]["BarNo"].ToString(); txtSpec.Text = dtl.Rows[0]["Spec"].ToString(); txtUnit.Text = dtl.Rows[0]["Unit"].ToString(); } BillManage BillManage = new BillManage(); dtl = BillManage.sp_GetMaterialSumByDepot(MaterialGuid); this.gridControl2.DataSource = dtl; this.Show(ifrm); }
//增加明细 private void btnAddMaterial_Click(object sender, EventArgs e) { MaterialManage MaterialManage = new MaterialManage(); frmSelectMaterial frmSelectMaterial = new frmSelectMaterial(); frmSelectMaterial.ShowDialog(); if (frmSelectMaterial.Tag != null) { //取出选择的料件Guid List <string> lstGuid = frmSelectMaterial.Tag as List <string>; //选择的品名填充 if (lstGuid.Count > 0) { //得到料件的信息 for (int i = 0; i < lstGuid.Count; i++) { Material material = new Material(); material = MaterialManage.GetMaterialByGuid(lstGuid[i]); //填充数据 gridView2.AddNewRow(); gridView2.SetFocusedRowCellValue(gridMaterialGuidDetail, material.MaterialGuID); gridView2.SetFocusedRowCellValue(gridMaterialIDDetail, material.MaterialID); gridView2.SetFocusedRowCellValue(gridMaterialNameDetail, material.MaterialName); gridView2.SetFocusedRowCellValue(gridUnitDetail, base.GetBasicDataNameByID(material.Unit)); gridView2.SetFocusedRowCellValue(gridSpecDetail, base.GetBasicDataNameByID(material.Spec)); gridView2.SetFocusedRowCellValue(gridMaterialSumDetail, 0); gridView2.SetFocusedRowCellValue(gridStorageSum, 0); gridView2.SetFocusedRowCellValue(gridStorageMaterialSum, 0); gridView2.SetFocusedRowCellValue(gridOnlySum, 0); } } } }
private void ConvertToRSMats(object sender, RoutedEventArgs e) { MaterialManage.ConvertToRSMaterial(new MFnDependencyNode(BasicFunc.GetSelectedObject(0)), (bool)bto_deleteOriginMats.IsChecked); }
private void ConvertToUDIM(object sender, RoutedEventArgs e) { MaterialManage.CombineToUDIM(BasicFunc.GetSelectedObjectList(), text_prename.Text, text_newFolder.Text, int.Parse(text_uCount.Text)); }
//保存 private void btnSave_Click(object sender, EventArgs e) { if (txtClass.Text.Trim() == "") { this.ShowAlertMessage("请选择货品分类!"); return; } if (txtMaterialName.Text.Trim() == "") { this.ShowAlertMessage("请输入货品名称!"); txtMaterialName.Focus(); return; } if (cboUnit.Text.Trim() == "") { this.ShowAlertMessage("请输入单位!"); cboUnit.Focus(); return; } //if (cboSpec.Text.Trim()== "") //{ // this.ShowAlertMessage("请输入规格!"); // cboSpec.Focus(); // return; //} MaterialManage MaterialManage = new MaterialManage(); //不是编辑修改时才进行判断,当确定后马上将编辑变为修改 if (IsEdit == false) { //判断当前料件是否已经存在相同的,如果已经存在则给出提示 if (MaterialManage.IsExistMaterial(txtClass.Tag.ToString(), txtMaterialName.Text.Trim(), txtMaterialId.Text.Trim(), txtBarNo.Text.Trim(), cboSpec.Text.Trim(), txtPlace.Text.Trim(), cboUnit.Text.Trim())) { this.ShowAlertMessage("你输入的货品信息已经存在,请修改后再确定!"); return; } } Material material = new Material(); material.MaterialGuid = txtGuid.Text; material.MaterialId = txtMaterialId.Text; material.MaterialName = txtMaterialName.Text; material.Spec = cboSpec.Text; material.Unit = cboUnit.Text; material.ClassId = txtClass.Tag.ToString(); material.BarNo = txtBarNo.Text; material.Place = txtPlace.Text; material.CalculateMethod = cboCalculateMethod.Text; material.Encapsulation = cboEncapsulation.Text; material.Remark = txtRemark.Text; if (txtUpperLimit.Text == "") { material.UpperLimit = 0; } else { material.UpperLimit = int.Parse(txtUpperLimit.Text); } if (txtLowerLimit.Text == "") { material.LowerLimit = 0; } else { material.LowerLimit = int.Parse(txtLowerLimit.Text); } if (txtIConsultPrice.Text == "") { material.IConsultPrice = 0; } else { material.IConsultPrice = decimal.Parse(txtIConsultPrice.Text); } if (txtEConsultPrice.Text == "") { material.EConsultPrice = 0; } else { material.EConsultPrice = decimal.Parse(txtEConsultPrice.Text); } //保存 MaterialManage.Save(material); IsEdit = false; txtGuid.Text = Guid.NewGuid().ToString(); //刷新 string strsql = " where ClassId='" + txtClass.Tag.ToString() + "'"; //如果是从调拨单新增进入的则刷新父窗口 if (Invalue == 0) { frmMaterial.frmmaterial.LoadMaterial(strsql); } }
//保存 private void btnSave_Click(object sender, EventArgs e) { if (txtClass.Text.Trim() == "") { this.ShowAlertMessage("请选择物料分类!"); return; } if (txtMaterialId.Text.Trim() == "") { this.ShowAlertMessage("请输入物料编号!"); txtMaterialName.Focus(); return; } if (txtMaterialName.Text.Trim() == "") { this.ShowAlertMessage("请输入物料名称!"); txtMaterialName.Focus(); return; } if (txtUnit.Text.Trim() == "") { this.ShowAlertMessage("请输入单位!"); txtUnit.Focus(); return; } //if (txtSpec.Text.Trim()== "") //{ // this.ShowAlertMessage("请输入规格!"); // cboSpec.Focus(); // return; //} MaterialManage MaterialManage = new MaterialManage(); //判断当前料件是否已经存在相同的,如果已经存在则给出提示 if (MaterialManage.IsExistMaterial(txtGuid.Text, txtMaterialId.Text, txtMaterialName.Text.Trim(), IsEdit)) { this.ShowAlertMessage("你输入的货品信息已经存在,请修改后再确定!"); return; } Material material = new Material(); material.MaterialGuID = txtGuid.Text; material.MaterialID = txtMaterialId.Text; material.MaterialName = txtMaterialName.Text; if (txtSpec.Tag != null) { material.Spec = txtSpec.Tag.ToString(); } else { material.Spec = ""; } if (txtUnit.Tag != null) { material.Unit = txtUnit.Tag.ToString(); } else { material.Unit = ""; } material.ClassId = txtClass.Tag.ToString(); material.Place = txtPlace.Text.Trim(); if (txtCalculateMethod.Tag != null) { material.CalculateMethod = txtCalculateMethod.Tag.ToString(); } else { material.CalculateMethod = ""; } material.Remark = txtRemark.Text.Trim(); if (txtSafeStockSum.Text == "") { material.SafeStockSum = 0; } else { material.SafeStockSum = int.Parse(txtSafeStockSum.Text); } if (txtPrice.Text == "") { material.Price = 0; } else { material.Price = decimal.Parse(txtPrice.Text); } if (chkStop.Checked == true) { material.IsEnable = 1; //停用 } else { material.IsEnable = 0;//可用 } material.PicID = txtPicID.Text.Trim(); material.ClientID = txtClientID.Text.Trim(); if (txtSupplierGuid.Tag != null) { material.SupplierGuid = txtSupplierGuid.Tag.ToString(); } else { material.SupplierGuid = ""; } //保存 MaterialManage.Save(material); //写日志 SysLog.AddOperateLog(SysParams.UserName, "物料数据", "新增或编辑", SysParams.UserName + "用户新增或编辑了物料,物料:" + material.MaterialGuID + "," + material.MaterialID + "," + material.MaterialName); IsEdit = true; //刷新 string strsql = " where ClassId='" + txtClass.Tag.ToString() + "'"; //如果是从调拨单新增进入的则刷新父窗口 if (Invalue == 0) { frmMaterial.frmmaterial.LoadMaterial(strsql); } }