Ejemplo n.º 1
0
        public int GetToNodeIdtoTransferRequestByStatus(short workflow, int fromNodeId, short statusCode)
        {
            try
            {
                PardisDBEntities db = new PardisDBEntities();
                switch (statusCode)
                {
                case (int)Enums.StatusCodeTypes.Confirm:
                    WFAssignments objA = db.WFAssignments.Where(q => q.WorkFlowID == workflow && q.FromNodeID == fromNodeId && q.DoConfirm == true).FirstOrDefault();
                    if (objA == null)
                    {
                        return(0);
                    }
                    else
                    {
                        return(objA.ToNodeID);
                    }

                case (int)Enums.StatusCodeTypes.Reject:
                    WFAssignments objA2 = db.WFAssignments.Where(q => q.WorkFlowID == workflow && q.FromNodeID == fromNodeId && q.DoReject == true).FirstOrDefault();
                    if (objA2 == null)
                    {
                        return(0);
                    }
                    else
                    {
                        return(objA2.ToNodeID);
                    }

                case (int)Enums.StatusCodeTypes.Return:
                    WFAssignments objA3 = db.WFAssignments.Where(q => q.WorkFlowID == workflow && q.FromNodeID == fromNodeId && q.DoReturn == true).FirstOrDefault();
                    if (objA3 == null)
                    {
                        return(0);
                    }
                    else
                    {
                        return(objA3.ToNodeID);
                    }

                default:
                    return(0);
                }
            }
            catch (Exception ex)
            {
                return(0);
            }
        }
Ejemplo n.º 2
0
        public bool IsExistsWay(short workFlow, int fromNodeId, int toNodeId, short statusCode)
        {
            PardisDBEntities db = new PardisDBEntities();

            try
            {
                WFAssignments objAssignment = db.WFAssignments.Where(w => w.WorkFlowID == workFlow && w.FromNodeID == fromNodeId && w.ToNodeID == toNodeId).FirstOrDefault();
                if (objAssignment != null)
                {
                    bool flag = true;
                    switch (statusCode)
                    {
                    case 2:
                        if (!objAssignment.DoConfirm)
                        {
                            return(false);
                        }
                        return(true);

                    case 3:
                        if (!objAssignment.DoReject)
                        {
                            return(false);
                        }
                        return(true);

                    case 4:
                        if (!objAssignment.DoReturn)
                        {
                            return(false);
                        }
                        return(true);

                    default:
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            catch
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
        public int GetWorkFlowTypeByNodeId(int nodeId, out string errorStr)
        {
            try
            {
                errorStr = "";
                PardisDBEntities db           = new PardisDBEntities();
                WFAssignments    objAssgnment = db.WFAssignments.Where(w => w.FromNodeID == nodeId || w.ToNodeID == nodeId).FirstOrDefault();

                if (objAssgnment != null)
                {
                    return(objAssgnment.WorkFlowID);
                }

                return(0);
            }
            catch
            {
                errorStr = "سیستم قادر به بدست آوردن نوع گردش کار نمی باشد !";
                return(0);
            }
        }