/// <summary> /// create new reocord in 'raktmennyiseg' table /// </summary> /// <param name="modif">set of ProductionPartRow is needed to create</param> public void createNewProdQuantityRecord(ProductStrippingPart newRow, string userId) { try { parameters = new List <KeyValuePair <string, string> >(); KeyValuePair <string, string> recordId = new KeyValuePair <string, string>("@termekId", newRow.productIndex.ToString()); KeyValuePair <string, string> barcode = new KeyValuePair <string, string>("@kod", newRow.productBarcode); KeyValuePair <string, string> stripping = new KeyValuePair <string, string>("@kiszerel", newRow.productStripping.ToString()); KeyValuePair <string, string> quantity = new KeyValuePair <string, string>("@mennyi", newRow.productQuantity.ToString()); KeyValuePair <string, string> placeing = new KeyValuePair <string, string>("@hely", newRow.productPlace); KeyValuePair <string, string> who = new KeyValuePair <string, string>("@userId", userId); parameters.Add(recordId); parameters.Add(barcode); parameters.Add(stripping); parameters.Add(quantity); parameters.Add(placeing); parameters.Add(who); } catch (Exception e) { throw new ErrorServiceNewRecord("Adatbátzis felé a kérés megalkotása sikertelen (ModProdQualNewRec): " + e.Message); } mdi.openConnection(); mdi.execPrepDMQueryWithKVPList(queryProductsNewRowQuantity, parameters, 6); mdi.closeConnection(); }
/// <summary> /// modify a record in 'raktmennyiseg' table with ProductPartRow - index the definiton which /// </summary> /// <param name="modifRow">set of ProductPartElement with the new paramteres, index is remains!</param> public void modifyProdQuantityRecord(ProductStrippingPart modifRow, string oldStr, string userId) { try { parameters = new List <KeyValuePair <string, string> >(); KeyValuePair <string, string> barcode = new KeyValuePair <string, string>("@kod", modifRow.productBarcode); KeyValuePair <string, string> newStrip = new KeyValuePair <string, string>("@ujKiszerel", modifRow.productStripping.ToString()); KeyValuePair <string, string> quantity = new KeyValuePair <string, string>("@mennyiseg", modifRow.productQuantity.ToString()); KeyValuePair <string, string> recordId = new KeyValuePair <string, string>("@termekId", modifRow.productIndex.ToString()); KeyValuePair <string, string> recordOldStrip = new KeyValuePair <string, string>("@regiKiszerel", oldStr); KeyValuePair <string, string> placeing = new KeyValuePair <string, string>("@hely", modifRow.productPlace); KeyValuePair <string, string> who = new KeyValuePair <string, string>("@userId", userId); parameters.Add(barcode); parameters.Add(newStrip); parameters.Add(quantity); parameters.Add(recordId); parameters.Add(placeing); parameters.Add(recordOldStrip); parameters.Add(who); } catch (Exception e) { throw new ErrorServiceUpdateRecord("Adatbátzis felé a kérés megalkotása sikertelen (ModProdModRec): " + e.Message); } mdi.openConnection(); mdi.execPrepDMQueryWithKVPList(queryProductsModifyRowQuantity, parameters, 7); mdi.closeConnection(); }
/// <summary> /// collects the datas from fields of case quantity managing /// </summary> public void collectAllDatasOfStripping() { tempOfChangesStripping = new ProductStrippingPart(); tempOfChangesStripping.productBarcode = txtbBarcode.Text; tempOfChangesStripping.productPlace = txtbPlace.Text; tempOfChangesStripping.productQuantity = Convert.ToInt32(txtbQuan.Text); tempOfChangesStripping.productStripping = Convert.ToInt32(txtbStripping.Text); tempOfChangesStripping.productIndex = indexProd; tempOfChangesStripping.productValidity = true; //in case reactivate }
/// <summary> /// makes a change in 'raktmennyiseg' table, modify a record /// by the original indexer and original stripping /// the indexer mustn't changes! /// </summary> /// <param name="row">the content of record with new parameters</param> /// <param name="oldStripping">the old stripping of the record</param> public void setModifyRecProdQuantity(ProductStrippingPart row, string oldStripping) { try { modelQuantities = new ProductsModelStrippingTable(dbci, parent); modelQuantities.modifyProdQuantityRecord(row, oldStripping, userId); } catch (Exception e) { errorHandle(e.Message); } }
/// <summary> /// makes a change in 'raktmennyiseg' table, creates a new record /// </summary> /// <param name="row">the recors is needed to create</param> public void setNewRecProdQuantity(ProductStrippingPart row) { try { modelQuantities = new ProductsModelStrippingTable(dbci, parent); modelQuantities.createNewProdQuantityRecord(row, userId); } catch (Exception e) { errorHandle(e.Message); } }
/// <summary> /// makes a change in 'raktmennyiseg' table, modify a record /// by the original indexer and original stripping /// the indexer mustn't changes! /// </summary> /// <param name="row">the content of record with new parameters</param> /// <param name="oldStripping">the old stripping of the record</param> public void setModifyRecProdQuantity(ProductStrippingPart row, string oldStripping) { try { modelQuantities = new ProductsModelStrippingTable(dbci, parentMain); modelQuantities.modifyProdQuantityRecord(row, oldStripping, userId); } catch (ErrorServiceUpdateRecord e) { throw new ErrorServiceProd(e.Message); } }
/// <summary> /// makes a change in 'raktmennyiseg' table, creates a new record /// </summary> /// <param name="row">the recors is needed to create</param> public void setNewRecProdQuantity(ProductStrippingPart row) { try { modelQuantities = new ProductsModelStrippingTable(dbci, parentMain); modelQuantities.createNewProdQuantityRecord(row, userId); } catch (ErrorServiceNewRecord e) { throw new ErrorServiceProd(e.Message); } }