private void startProductionOrderProcess(DataModels.Warehouse.ProductionOrder dataModel, IDAL dal) { int processDefinitionId = _parameterReader.ReadPublicParameter <int>("UretimFisiSureci", 2017); GroupOperations gop = new GroupOperations(dal); Group g = gop.FindGroup("Depo Sorumlusu"); Group g2 = gop.FindGroup("Uretim Grubu"); IProcessInstance processInstance = new ProcessInstance(processDefinitionId, OTApplication.Context.User.Id); //Set Process Variables processInstance.AddProcessVariable("user", OTApplication.Context.User.Id); processInstance.AddProcessVariable("screenReference", "Warehouse#ProductionOrderListComponent#" + dataModel.ProductionOrderId); processInstance.AddProcessVariable("requestId", dataModel.ProductionOrderId); processInstance.AddProcessVariable("acceptanceGroup", g.GroupId); processInstance.AddProcessVariable("productionGroup", g2.GroupId); //Set Action Varibles processInstance.AddActionVariable("user", OTApplication.Context.User.Id); //processInstance.AddActionVariable("description", dataModel.Description); //Start Process var processId = processInstance.Start(dataModel.ProductionOrderId.ToString()); dataModel.ProcessInstance = processId; dataModel.StatusCode = 1; dal.Update(dataModel); }
private void startReturnOrderProcess(DataModels.Warehouse.ProductReturn dataModel, IDAL dal) { int processDefinitionId = _parameterReader.ReadPublicParameter <int>("UrunIadeSureci", 2009); var store = dal.Read <Store>(dataModel.Store); var product = dal.Read <Product>(dataModel.Product); var branch = dal.Read <Branch>(store.OrganizationBranch); GroupOperations gop = new GroupOperations(dal); Group g = gop.FindGroup("Ürün İade Kullanıcıları"); Group g2 = gop.FindGroup("Depo Sorumlusu"); IProcessInstance processInstance = new ProcessInstance(processDefinitionId, OTApplication.Context.User.Id); //Set Process Variables processInstance.AddProcessVariable("user", OTApplication.Context.User.Id); processInstance.AddProcessVariable("screenReference", "Warehouse#ProductReturnListComponent#" + dataModel.ProductReturnId); processInstance.AddProcessVariable("branch", store.OrganizationBranch); processInstance.AddProcessVariable("region", branch.Parent); processInstance.AddProcessVariable("requestId", dataModel.ProductReturnId); processInstance.AddProcessVariable("accountingGroup", g.GroupId); processInstance.AddProcessVariable("acceptanceGroup", g2.GroupId); //Set Action Varibles processInstance.AddActionVariable("user", OTApplication.Context.User.Id); processInstance.AddActionVariable("description", $"{store.Name} - {product.Name}"); //Start Process var processId = processInstance.Start(dataModel.ProductReturnId.ToString()); dataModel.ProcessInstance = processId; dataModel.StatusCode = 2; dal.Update(dataModel); }
private void startTransferProductProcess(DataModels.Warehouse.TransferProduct dataModel, IDAL dal) { int processDefinitionId = _parameterReader.ReadPublicParameter <int>("MagazalarArasiTransferSureci", 2016); var sourceStore = dal.Read <Store>(dataModel.SourceStore); var intakeBranchId = dataModel.DestinationStore == 999 ? 999 : dal.Read <Store>(dataModel.DestinationStore).OrganizationBranch; GroupOperations gop = new GroupOperations(dal); Group g = gop.FindGroup("Mağazalar Arası Ürün Transfer Kullanıcıları"); Group gWarehouse = gop.FindGroup("Depo Sorumlusu"); IProcessInstance processInstance = new ProcessInstance(processDefinitionId, OTApplication.Context.User.Id); //Set Process Variables processInstance.AddProcessVariable("user", OTApplication.Context.User.Id); processInstance.AddProcessVariable("screenReference", "Warehouse#TransferProductListComponent#" + dataModel.TransferProductId); processInstance.AddProcessVariable("sendBranch", sourceStore.OrganizationBranch); processInstance.AddProcessVariable("transferProductAdminGroup", g.GroupId); processInstance.AddProcessVariable("intakeBranch", intakeBranchId); processInstance.AddProcessVariable("warehouseGroup", gWarehouse.GroupId); processInstance.AddProcessVariable("transferId", dataModel.TransferProductId); processInstance.AddProcessVariable("transferToWarehouse", dataModel.DestinationStore == 999 ? true : false); //Set Action Varibles processInstance.AddActionVariable("user", OTApplication.Context.User.Id); //Start Process var processId = processInstance.Start(dataModel.TransferProductId.ToString()); // Update DB dataModel.ProcessInstance = processId; dataModel.TransferStatus = 2; dal.Update(dataModel); }
private void startSuggestionProcess(DataModels.Announcement.Suggestion dataModel, IDAL dal) { int processDefinitionId = _parameterReader.ReadPublicParameter <int>("OneriSureci", 2011); var processInstanceRef = dataModel.SuggestionId.ToString(); GroupOperations gop = new GroupOperations(dal); Group suggestionAdminGroup = gop.FindGroup("Öneri Değerlendirme Kullanıcıları"); IProcessInstance processInstance = new ProcessInstance(processDefinitionId, OTApplication.Context.User.Id); //Set Process Variables processInstance.AddProcessVariable("user", OTApplication.Context.User.Id); processInstance.AddProcessVariable("screenReference", "Announcement#SuggestionListComponent#" + processInstanceRef); processInstance.AddProcessVariable("suggestionAdminGroup", suggestionAdminGroup.GroupId); processInstance.AddProcessVariable("suggestionId", dataModel.SuggestionId); //Set Action Varibles processInstance.AddActionVariable("user", OTApplication.Context.User.Id); //processInstance.AddActionVariable("description", dataModel.Description); //Start Process var processId = processInstance.Start(processInstanceRef); dataModel.ProcessInstance = processId; dal.Update(dataModel); }
/// <summary> /// Выполнение операций по рабработе со студентами и группами /// </summary> private void PerformOperations() { switch ((Actions)_chosedActions) { case Actions.Add: GroupOperations.AddGroup(_input, _school); isAbleToBack = true; break; case Actions.Print: GroupOperations.PrintGroups(_school); isAbleToBack = true; break; case Actions.Remove: GroupOperations.RemoveGroup(_input, _school); isAbleToBack = true; break; case Actions.Sort: Console.WriteLine("Операция не поддерживается!"); isAbleToBack = true; break; case Actions.Find: GroupOperations.FindGroup(_input, _school); isAbleToBack = true; break; case Actions.Quit: _menu.CallMenu(); break; default: Console.WriteLine("Опять ты брешишь..."); isAbleToBack = false; break; } }
/*Section="CustomCodeRegion"*/ #region Customized private void startEInvoiceProcess(DataModels.Accounting.SaleInvoice dataModel, IDAL dal) { int processDefinitionId = _parameterReader.ReadPublicParameter <int>("EInvoice", 2020); var store = dal.Read <Store>(dataModel.SaleStore); var branch = dal.Read <Branch>(store.OrganizationBranch); GroupOperations gop = new GroupOperations(dal); Group g = gop.FindGroup("Muhasebe E-Fatura"); long userId; if (OTApplication.Context != null && OTApplication.Context.User != null) { userId = OTApplication.Context.User.Id; } else { userId = 1; } IProcessInstance processInstance = new ProcessInstance(processDefinitionId, userId); //Set Process Variables processInstance.AddProcessVariable("user", OTApplication.Context.User.Id); processInstance.AddProcessVariable("screenReference", "Accounting#SaleInvoiceListComponent#" + dataModel.SaleInvoiceId); processInstance.AddProcessVariable("branch", store.OrganizationBranch); processInstance.AddProcessVariable("region", branch.Parent); processInstance.AddProcessVariable("requestId", dataModel.SaleInvoiceId); processInstance.AddProcessVariable("accountingGroup", g.GroupId); //Set Action Varibles processInstance.AddActionVariable("user", OTApplication.Context.User.Id); processInstance.AddActionVariable("description", $"{store.Name} - {dataModel.CustomerIdNumber} - {dataModel.Title} - {dataModel.SaleDate} - {dataModel.SaleAmount}"); //Start Process var processId = processInstance.Start(dataModel.SaleInvoiceId.ToString()); dataModel.ProcessInstance = processId; dataModel.StatusCode = 1; dal.Update(dataModel); }
/*Section="CustomCodeRegion"*/ #region Customized private void startHelpDeskProcess(DataModels.Helpdesk.HelpdeskRequest dataModel, IDAL dal) { bool yardimciMalzeme = (dataModel.ProcessName == "YardimMasasiYardimciMalzeme"); bool bilgislem = (dataModel.ProcessName == "YardimMasasiAriza"); int processDefinitionId = _parameterReader.ReadPublicParameter <int>(dataModel.ProcessName, dataModel.Process); var store = dal.Read <Store>(dataModel.Store); var branch = dal.Read <Branch>(store.OrganizationBranch); GroupOperations gop = new GroupOperations(dal); IProcessInstance processInstance = new ProcessInstance(processDefinitionId, OTApplication.Context.User.Id); //Set Process Variables processInstance.AddProcessVariable("user", OTApplication.Context.User.Id); processInstance.AddProcessVariable("screenReference", "Helpdesk#HelpdeskRequestListComponent#" + dataModel.HelpdeskRequestId); processInstance.AddProcessVariable("branch", store.OrganizationBranch); processInstance.AddProcessVariable("region", branch.Parent); processInstance.AddProcessVariable("requestId", dataModel.HelpdeskRequestId); if (yardimciMalzeme) { Overtech.DataModels.Security.Group g = gop.FindGroup("Satın Alma"); processInstance.AddProcessVariable("purchasingGroup", g.GroupId); g = gop.FindGroup("Depo Sorumlusu"); processInstance.AddProcessVariable("warehouseGroup", g.GroupId); g = gop.FindGroup("İdari İşler"); processInstance.AddProcessVariable("executiveStaffGroup", g.GroupId); } else if (bilgislem) { Overtech.DataModels.Security.Group g = gop.FindGroup("Momende"); processInstance.AddProcessVariable("momendeGroup", g.GroupId); g = gop.FindGroup("Bilgi Sistemleri Kullanıcıları"); processInstance.AddProcessVariable("bilgiIslemGroup", g.GroupId); } processInstance.AddProcessVariable("description", dataModel.RequestDescription); string storeName = dal.List <Store>("STR_LST_STORE_SP").Where(s => s.StoreId == dataModel.Store) .Select(s => s.Name) .FirstOrDefault(); processInstance.AddProcessVariable("storeName", storeName); string definitionName = dal.List <RequestDefinition>("HDK_LST_REQUESTDEF_SP").Where(rd => rd.RequestDefinitionId == dataModel.RequestDefinition) .Select(rd => rd.RequestDefinitionName) .FirstOrDefault(); processInstance.AddProcessVariable("definition", definitionName); string deviceNo = "-"; IEnumerable <DataModels.Helpdesk.RequestAttribute> deviceAttributeList = dal.List <DataModels.Helpdesk.RequestAttribute>("HDK_LST_ATTRIBUTE_SP") .Where(a => a.AttributeType > 4 && a.RequestDefinition == dataModel.RequestDefinition); dataModel.RequestDetailList.ForEach(rd => { if (deviceNo == "-") { for (int i = 0; i < deviceAttributeList.Count(); i++) { DataModels.Helpdesk.RequestAttribute da = deviceAttributeList.ElementAt(i); if (da.RequestAttributeId == rd.Attribute) { string deviceName; string serialNo; switch (da.AttributeType) { case 5: // TERAZI StoreScales scale = dal.Read <StoreScales>(Int32.Parse(rd.AttributeValue)); deviceName = scale.BrandName ?? ""; serialNo = scale.SerialNumber ?? ""; i = deviceAttributeList.Count(); break; case 6: // YAZARKASA StoreCashRegister cashRegister = dal.Read <StoreCashRegister>(Int32.Parse(rd.AttributeValue)); deviceName = cashRegister.BrandName ?? ""; serialNo = cashRegister.SerialNo ?? ""; i = deviceAttributeList.Count(); break; case 7: // DEMIRBAS StoreFixture fixture = dal.Read <StoreFixture>(Int32.Parse(rd.AttributeValue)); deviceName = fixture.FixtureName ?? ""; serialNo = fixture.SerialNo ?? ""; i = deviceAttributeList.Count(); break; default: deviceName = ""; serialNo = ""; i = deviceAttributeList.Count(); break; } deviceNo = deviceName + (serialNo.Length > 0 ? "-" + serialNo : ""); } } ; } }); processInstance.AddProcessVariable("deviceNo", deviceNo); //Set Action Varibles processInstance.AddActionVariable("user", OTApplication.Context.User.Id); //processInstance.AddActionVariable("description", $"{store.Name} - {product.Name}"); //Start Process var processId = processInstance.Start(dataModel.HelpdeskRequestId.ToString()); dataModel.ProcessInstance = processId; dataModel.StatusCode = 1; dal.Update(dataModel); }