예제 #1
0
        public void TakeAction(DataModels.Announcement.Suggestion dataObject, long actionId, string choice, string comment)
        {
            using (IDAL dal = this.DAL)
            {
                dal.BeginTransaction();
                try
                {
                    // var originalObject = dal.Read<DataModels.Announcement.Suggestion>(dataObject.SuggestionId);

                    IActionOperations actionOperations = new Overtech.API.BPM.ActionOperations(OTApplication.Context.User.Id);
                    var     actionInfo = actionOperations.GetActionInfo(actionId);
                    IAction action     = new Overtech.API.BPM.Action(actionId, OTApplication.Context.User.Id);
                    dal.Update(dataObject);

                    action.Commit(choice, comment);

                    dal.CommitTransaction();
                }
                catch
                {
                    dal.RollbackTransaction();
                    throw;
                }
            }
        }
예제 #2
0
        public void TakeAction(DataModels.Warehouse.ProductionOrder dataObject, long actionId, string choice, string comment)
        {
            using (IDAL dal = this.DAL)
            {
                dal.BeginTransaction();
                try
                {
                    // var originalObject = dal.Read<DataModels.Warehouse.ProductReturn>(dataObject.ProductReturnId);

                    IActionOperations actionOperations = new Overtech.API.BPM.ActionOperations(OTApplication.Context.User.Id);

                    var actionInfo = actionOperations.GetActionInfo(actionId);

                    IAction action = new Overtech.API.BPM.Action(actionId, OTApplication.Context.User.Id);

                    if (choice != "İptal")
                    {
                        switch (actionInfo.ActivityName)
                        {
                        case "Uretim mal gonderim adımı":
                            dataObject.StatusCode = 2;
                            waybillFromMainWHtoProductionWH(dal, dataObject);
                            break;

                        case "Uretim Grubu Adımı":
                            if (choice == "Tamamlandı")
                            {
                                dataObject.StatusCode = 4;
                                if (dataObject.PartialCompletion > 0)
                                {
                                    waybillProduction(dal, dataObject);
                                }
                                waybillProductionCompleted(dal, dataObject);
                            }
                            else
                            {
                                dataObject.StatusCode = 3;
                                waybillProduction(dal, dataObject);
                            }
                            break;
                        }
                    }
                    else
                    {
                        dataObject.StatusCode = 7;
                    }

                    dal.Update(dataObject);

                    action.Commit(choice, comment);

                    dal.CommitTransaction();
                }
                catch
                {
                    dal.RollbackTransaction();
                    throw;
                }
            }
        }
예제 #3
0
        public void TakeAction(DataModels.Accounting.SaleInvoice dataObject, long actionId, string choice, string comment)
        {
            using (IDAL dal = this.DAL)
            {
                dal.BeginTransaction();
                try
                {
                    // var originalObject = dal.Read<DataModels.Warehouse.ProductReturn>(dataObject.ProductReturnId);

                    IActionOperations actionOperations = new Overtech.API.BPM.ActionOperations(OTApplication.Context.User.Id);

                    var actionInfo = actionOperations.GetActionInfo(actionId);

                    IAction action = new Overtech.API.BPM.Action(actionId, OTApplication.Context.User.Id);

                    dataObject.StatusCode = 7;

                    dal.Update(dataObject);

                    createMikroInvoice(dataObject.SaleInvoiceId, dal);

                    action.Commit(choice, comment);

                    dal.CommitTransaction();
                }
                catch
                {
                    dal.RollbackTransaction();
                    throw;
                }
            }
        }
        public void TakeAction(DataModels.Helpdesk.HelpdeskRequest dataObject, long actionId, string choice, string comment)
        {
            using (IDAL dal = this.DAL)
            {
                dal.BeginTransaction();
                try
                {
                    IActionOperations actionOperations = new Overtech.API.BPM.ActionOperations(OTApplication.Context.User.Id);

                    var actionInfo = actionOperations.GetActionInfo(actionId);

                    IAction action = new Overtech.API.BPM.Action(actionId, OTApplication.Context.User.Id);

                    switch (choice)
                    {
                    case "Çözüldü": dataObject.StatusCode = (int)RequestStatusList.Cozuldu; break;

                    case "Revize": dataObject.StatusCode = (int)RequestStatusList.Revize; break;

                    case "Tamam": dataObject.StatusCode = (int)RequestStatusList.RevizeTamam; break;

                    case "Momende": dataObject.StatusCode = (int)RequestStatusList.Momende; break;

                    case "Yönlendirildi": dataObject.StatusCode = (int)RequestStatusList.Yonlendirildi; break;

                    case "Servise Alındı": dataObject.StatusCode = (int)RequestStatusList.ServiseAlindi; break;

                    case "Askıya Alındı": dataObject.StatusCode = (int)RequestStatusList.AskiyaAlindi; break;

                    case "Hurdaya Ayrıldı": dataObject.StatusCode = (int)RequestStatusList.HurdayaAlindi; break;

                    case "Reddedildi": dataObject.StatusCode = (int)RequestStatusList.Iptal; break;

                    case "Tamamlandı": dataObject.StatusCode = (int)RequestStatusList.CozumOnaylandi; break;

                    case "Çözülmedi": dataObject.StatusCode = (int)RequestStatusList.Cozulmemis; break;

                    case "Yenisi gönderildi": dataObject.StatusCode = (int)RequestStatusList.YenisiGonderildi; break;
                    }

                    dal.Update(dataObject);

                    action.Commit(choice, comment);

                    dal.CommitTransaction();
                }
                catch
                {
                    dal.RollbackTransaction();
                    throw;
                }
            }
        }
예제 #5
0
        public void TakeAction(DataModels.Warehouse.ProductReturn dataObject, long actionId, string choice, string comment)
        {
            using (IDAL dal = this.DAL)
            {
                dal.BeginTransaction();
                try
                {
                    // var originalObject = dal.Read<DataModels.Warehouse.ProductReturn>(dataObject.ProductReturnId);

                    IActionOperations actionOperations = new Overtech.API.BPM.ActionOperations(OTApplication.Context.User.Id);

                    var actionInfo = actionOperations.GetActionInfo(actionId);

                    IAction action = new Overtech.API.BPM.Action(actionId, OTApplication.Context.User.Id);

                    if (choice != "İptal")
                    {
                        switch (actionInfo.ActivityName)
                        {
                        case "Şube Adımı": dataObject.StatusCode = 3; break;

                        case "Merkez Adımı": dataObject.StatusCode = 4; break;
                            //case "Merkez Statu Belirleme Adımı": originalObject.StatusCode = 5; break;
                        }
                    }
                    else
                    {
                        dataObject.StatusCode = 7;
                    }

                    dal.Update(dataObject);

                    createMikroWaybill(dataObject.ProductReturnId, dal);

                    action.Commit(choice, comment);

                    dal.CommitTransaction();
                }
                catch
                {
                    dal.RollbackTransaction();
                    throw;
                }
            }
        }
예제 #6
0
        public void TakeAction(DataModels.OverStoreMain.OverStoreTask dataObject, long actionId, string choice, string comment)
        {
            using (IDAL dal = this.DAL)
            {
                dal.BeginTransaction();
                try
                {
                    // var originalObject = dal.Read<DataModels.OverStoreMain.OverStoreTask>(dataObject.OverStoreTaskId);

                    IActionOperations actionOperations = new Overtech.API.BPM.ActionOperations(OTApplication.Context.User.Id);
                    IAction           action           = new Overtech.API.BPM.Action(actionId, OTApplication.Context.User.Id);

                    dal.Update(dataObject);
                    action.Commit(choice, comment);

                    dal.CommitTransaction();
                }
                catch
                {
                    dal.RollbackTransaction();
                    throw;
                }
            }
        }
예제 #7
0
        public void TakeAction(DataModels.Warehouse.ReturnOrder dataObject, long actionId, string choice, string comment)
        {
            using (IDAL dal = this.DAL)
            {
                dal.BeginTransaction();
                try
                {
                    var originalObject = dal.Read <DataModels.Warehouse.ReturnOrder>(dataObject.ReturnOrderId);

                    IActionOperations actionOperations = new Overtech.API.BPM.ActionOperations(OTApplication.Context.User.Id);

                    var actionInfo = actionOperations.GetActionInfo(actionId);

                    IAction action = new Overtech.API.BPM.Action(actionId, OTApplication.Context.User.Id);

                    if (choice == "Onay" || choice == "Gönder" || choice == "Tamamlandı")
                    {
                        switch (actionInfo.ActivityName)
                        {
                        case "Şube Adımı": originalObject.Status = 2; break;

                        case "Bölge Sorumlusu Adımı": originalObject.Status = 3; break;

                        case "Merkez Adımı": originalObject.Status = 4; break;

                        case "Şube Sevk Adımı": originalObject.Status = 5; break;

                        case "Merkez Statu Belirleme Adımı": originalObject.Status = 6; break;
                        }
                    }
                    else if (choice == "Revize")
                    {
                        originalObject.Status = 1;
                    }
                    else if (choice == "İptal")
                    {
                        originalObject.Status = 7;
                    }

                    /*
                     * var planNote = new PurchaseOrderNote
                     * {
                     *  Event = dataObject.Event,
                     *  Organization = dataObject.Organization,
                     *  PurchaseOrder = dataObject.PurchaseOrderId,
                     *  Message = $"Alınan aksiyon: {choice}. Açıklama: {comment}"
                     *
                     * };
                     * dal.Create(planNote);
                     */

                    dal.Update(originalObject);

                    //if (actionInfo.ActivityName == "Şube Revizyon")
                    //{
                    //    IUniParameter prmPurchaseOrder = dal.CreateParameter("PurchaseOrder", dataObject.PurchaseOrderId);
                    //    var orderItemList = dal.List<PurchaseOrderItem>("POR_LST_PURCHASEORDERITEM_SP", prmPurchaseOrder).ToList();
                    //    action.AddProcessVariable("orderItems", orderItemList);
                    //}

                    action.Commit(choice, comment);
                    // Update via DAL

                    dal.CommitTransaction();

                    /*
                     * if (choice == "Onay" || choice == "Red" || choice == "Reddet")
                     * {
                     *  SendRequesterOrderMail(dataObject.ReturnOrderId, choice);
                     * }
                     */
                }
                catch
                {
                    dal.RollbackTransaction();
                    throw;
                }
            }
        }