/// <summary> /// create new reocord in 'raktminoseg' table /// </summary> /// <param name="modif">set of ProductionPartRow is needed to create</param> public void createNewProdQualityRecord(ProductQualityPart row, string userId) { try { parameters = new List <KeyValuePair <string, string> >(); KeyValuePair <string, string> name = new KeyValuePair <string, string>("@nev", row.productName); KeyValuePair <string, string> subcon = new KeyValuePair <string, string>("@beszallito", row.productSubcontr); KeyValuePair <string, string> descr = new KeyValuePair <string, string>("@leiras", row.productDescr); KeyValuePair <string, string> unit = new KeyValuePair <string, string>("@menyegys", row.productQantUnit); KeyValuePair <string, string> dange = new KeyValuePair <string, string>("@veszely", row.productDanger.ToString()); KeyValuePair <string, string> sheet = new KeyValuePair <string, string>("@adatlap", row.productSheet); KeyValuePair <string, string> who = new KeyValuePair <string, string>("@userId", userId); parameters.Add(name); parameters.Add(subcon); parameters.Add(descr); parameters.Add(dange); parameters.Add(sheet); parameters.Add(unit); 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(queryProductsNewRowQuality, parameters, 7); mdi.closeConnection(); }
/// <summary> /// creates a new userRightGroup /// </summary> /// <param name="newGroupName">the name of that</param> /// <param name="rightsIn10NS">the right paramters ot that</param> /// <param name="new_modify">the mode of the process - true = new / false = modify</param> public void setNewOrModifyRecordOfRightGroup(string newGroupName, string rightsIn10NS, bool new_modify) { try { parameters = new List <KeyValuePair <string, string> >(); KeyValuePair <string, string> groupName = new KeyValuePair <string, string>("@groupname", newGroupName); KeyValuePair <string, string> rightParm = new KeyValuePair <string, string>("@right", rightsIn10NS); parameters.Add(groupName); parameters.Add(rightParm); } catch (Exception e) { if (new_modify) { throw new ErrorServiceNewRecord("A lekérdezéshez kérés összeállítása sikertelen (ModRightNew) " + e.Message); } else { throw new ErrorServiceUpdateRecord("A lekérdezéshez kérés összeállítása sikertelen (ModRightModif) " + e.Message); } } mdi.openConnection(); if (new_modify) { mdi.execPrepDMQueryWithKVPList(queryOfCreateNewRightGroup, parameters, 2); } else { mdi.execPrepDMQueryWithKVPList(queryOfModifyExistRightGroup, parameters, 2); } mdi.closeConnection(); }
/// <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> /// sets in password change in 'felhaszn' table /// </summary> /// <param name="userId">the DB identifier of user</param> /// <param name="newPwdHashed">the new password in hashed string</param> public void setChangeTheUserPassword(string userId, string newPwdHashed) { try { parameters = new List <KeyValuePair <string, string> >(); KeyValuePair <string, string> userid = new KeyValuePair <string, string>("@userId", userId); KeyValuePair <string, string> pwd = new KeyValuePair <string, string>("@pwd", newPwdHashed); parameters.Add(userid); parameters.Add(pwd); } catch (Exception e) { throw new ErrorServiceUpdateRecord("Az adatbázis felé a kérés megalkotása sikertelen (ModPersonPwd) " + e.Message); } mdi.openConnection(); mdi.execPrepDMQueryWithKVPList(queryChangePassword, parameters, 2); mdi.closeConnection(); }
/// <summary> /// sets failed booked missing records, no chance to get with another shipping /// </summary> /// <param name="operatUserId">who made tha change</param> /// <param name="ordId">DB identifier of ordering</param> public void setTheBookedOrMissingToFailed(string ordId, string operatUserId) { try { parameters = new List <KeyValuePair <string, string> >(); KeyValuePair <string, string> operUserId = new KeyValuePair <string, string>("@userId", operatUserId); KeyValuePair <string, string> orderingId = new KeyValuePair <string, string>("@ordId", ordId); parameters.Add(operUserId); parameters.Add(orderingId); } catch (Exception e) { throw new ErrorOrderingSetFailed("A lekérdezés megalkotása sikertelen (ModOrdSetFailed) " + e.Message); } mdi.openConnection(); mdi.execPrepDMQueryWithKVPList(queryToChangeMissingToFailed, parameters, 2); mdi.closeConnection(); }
/// <summary> /// process of inactivete a request and charge the inventroy pool in the specific stripping /// </summary> /// <param name="modUserId">userID who makes the process</param> /// <param name="reqStartDate">startDate of the target request</param> /// <param name="recQuantId">stripping ID of the target request</param> /// <param name="reqUserId">user ID, who asked and credits for</param> /// <param name="newAmountInStripp">teh amount that will be in the strore after the process - less</param> public void deleteRequestTableGiveOutARecord(string modUserId, string reqStartDate, string recQuantId, string reqUserId, string newAmountInStripp) { try { KeyValuePair <string, string> modUser = new KeyValuePair <string, string>("@modUserId", modUserId); KeyValuePair <string, string> reqStart = new KeyValuePair <string, string>("@reqStartDate", reqStartDate); KeyValuePair <string, string> quantId = new KeyValuePair <string, string>("@kiszerelId", recQuantId); KeyValuePair <string, string> reqUser = new KeyValuePair <string, string>("@reqUserId", reqUserId); parameters = new List <KeyValuePair <string, string> >(); parameters.Add(modUser); parameters.Add(reqStart); parameters.Add(quantId); parameters.Add(reqUser); } catch (Exception e) { throw new ErrorServiceDeleteRecord("Termék kiadásával kapcsolatos kérés összeállítása sikertelen (ModReqGiveOut) " + e.Message); } mdi.openConnection(); mdi.execPrepDMQueryWithKVPList(queryGiveOutTheRequest, parameters, 4); //delete try { KeyValuePair <string, string> newAmount = new KeyValuePair <string, string>("@ujabbMennyiseg", newAmountInStripp); KeyValuePair <string, string> quantId = new KeyValuePair <string, string>("@kiszerelId", recQuantId); parameters = new List <KeyValuePair <string, string> >(); parameters.Add(newAmount); parameters.Add(quantId); } catch (Exception e) { mdi.closeConnection(); throw new ErrorServiceUpdateRecord("Termék kiadáshoz raktárfrissítő kérés összeállítása sikertelen (ModReqGivenOut) " + e.Message); } mdi.execPrepDMQueryWithKVPList(queryUpdateStrippingTableAmountChangeCase, parameters, 2); mdi.closeConnection(); }