Exemplo n.º 1
0
        private static List <TransactionDetail> getDislayName(string[] TranArr, string FlowName, string StepName)
        {
            string str = "";
            List <TransactionDetail> list;

            for (int i = 0; i < TranArr.Count(); i++)
            {
                if (i < TranArr.Count() - 1)
                {
                    str += "'" + TranArr[i].ToString() + "' ,";
                }
                else
                {
                    str += "'" + TranArr[i].ToString() + "'";
                }
            }
            list = new List <TransactionDetail>();
            if (StepName == WFStepName.AddSamplingResult.ToString())
            {
                SamplingBLL objSampling = new SamplingBLL();
                if (FlowName.Trim().ToUpper() == "WRCM".ToUpper())
                {
                    TranArr = objSampling.GetMixedSamplingCodeBylistTrackingNo(str);
                }
                else
                {
                    TranArr = objSampling.GetSamplingCodeBylistTrackingNo(str);
                }
                if (TranArr != null)
                {
                    for (int x = 0; x < TranArr.Count(); x++)
                    {
                        string[] temp = TranArr[x].Split('*');
                        list.Add(new TransactionDetail(temp[0].Trim(), temp[1].Trim()));
                    }
                }
                return(list);
            }
            else if (StepName == WFStepName.GenerateGradingCode.ToString())
            {
                SamplingResultBLL objSampling = new SamplingResultBLL();
                TranArr = objSampling.GetSamplingResultCodeBylistTrackingNo(str);
                if (TranArr != null)
                {
                    if (TranArr != null)
                    {
                        for (int x = 0; x < TranArr.Count(); x++)
                        {
                            string[] temp = TranArr[x].Split('*');
                            list.Add(new TransactionDetail(temp[0].Trim(), temp[1].Trim()));
                        }
                    }
                }
                // regrading
                GradingDisputeBLL objGradeDispute = new GradingDisputeBLL();
                TranArr = objGradeDispute.GetReGradingRequestbyTrackingNo(str);
                if (TranArr != null)
                {
                    if (TranArr != null)
                    {
                        for (int x = 0; x < TranArr.Count(); x++)
                        {
                            string[] temp = TranArr[x].Split('*');
                            list.Add(new TransactionDetail(temp[0].Trim(), temp[1].Trim()));
                        }
                    }
                }
                return(list);
            }
            else if (StepName == WFStepName.AddGradingResult.ToString())
            {
                GradingBLL objSampling = new GradingBLL();
                TranArr = objSampling.GetGradingResultCodeBylistTrackingNo(str);
                if (TranArr != null)
                {
                    for (int x = 0; x < TranArr.Count(); x++)
                    {
                        string[] temp = TranArr[x].Split('*');
                        list.Add(new TransactionDetail(temp[0].Trim(), temp[1].Trim()));
                    }
                }
                return(list);
            }
            else if (StepName == WFStepName.GradingResultCA.ToString())
            {
                GradingBLL objSampling = new GradingBLL();
                TranArr = objSampling.GetGradingResultCodeBylistTrackingNo(str);
                if (TranArr != null)
                {
                    for (int x = 0; x < TranArr.Count(); x++)
                    {
                        string[] temp = TranArr[x].Split('*');
                        list.Add(new TransactionDetail(temp[0].Trim(), temp[1].Trim()));
                    }
                }


                return(list);
            }
            else if (StepName == WFStepName.PreWeighTruck.ToString() || StepName == WFStepName.AddUnloadingInfo.ToString())
            {
                GradingResultBLL obj = new GradingResultBLL();
                TranArr = obj.GetGradingResultResultCodeBylistTrackingNo(str);
                if (TranArr != null)
                {
                    for (int x = 0; x < TranArr.Count(); x++)
                    {
                        string[] temp = TranArr[x].Split('*');
                        list.Add(new TransactionDetail(temp[0].Trim(), temp[1].Trim()));
                    }
                }
                return(list);
            }
            else if (StepName == WFStepName.PostWeighTruck.ToString() || StepName == WFStepName.AddScalingInfo.ToString())
            {
                //TODO _ check hwewe
                //post Weight que No.
                GradingResultBLL obj = new GradingResultBLL();
                TranArr = obj.GetGradingResultResultCodeBylistTrackingNo(str);
                if (TranArr != null)
                {
                    for (int x = 0; x < TranArr.Count(); x++)
                    {
                        string[] temp = TranArr[x].Split('*');
                        list.Add(new TransactionDetail(temp[0].Trim(), temp[1].Trim()));
                    }
                }
                return(list);
            }
            else if (StepName == WFStepName.AddGRN.ToString())
            {
                GRNBLL obj = new GRNBLL();
                TranArr = obj.GetGradingResultResultCodeBylistTrackingNo(str);
                if (TranArr != null)
                {
                    for (int x = 0; x < TranArr.Count(); x++)
                    {
                        string[] temp = TranArr[x].Split('*');
                        list.Add(new TransactionDetail(temp[0].Trim(), temp[1].Trim()));
                    }
                }
                return(list);
            }
            else if (StepName == WFStepName.GRNAcceptance.ToString() && FlowName == "WHEditAppGRN")
            {
                GRNBLL obj = new GRNBLL();
                TranArr = obj.GetGRNNoBylistEditTrackingNo(str);
                if (TranArr != null)
                {
                    for (int x = 0; x < TranArr.Count(); x++)
                    {
                        string[] temp = TranArr[x].Split('*');
                        list.Add(new TransactionDetail(temp[0].Trim(), temp[1].Trim()));
                    }
                }
                return(list);
            }
            else if (StepName == WFStepName.GRNAcceptance.ToString() && FlowName != "WHEditAppGRN")
            {
                GRNBLL obj = new GRNBLL();
                TranArr = obj.GetGRNNoBylistTrackingNo(str);
                if (TranArr != null)
                {
                    for (int x = 0; x < TranArr.Count(); x++)
                    {
                        string[] temp = TranArr[x].Split('*');
                        list.Add(new TransactionDetail(temp[0].Trim(), temp[1].Trim()));
                    }
                }
                return(list);
            }
            //Update GRN
            else if (StepName == WFStepName.UpdateGRNNo.ToString())
            {
                GRNBLL obj = new GRNBLL();
                TranArr = obj.GetGRNNoBylistTrackingNo(str);
                if (TranArr != null)
                {
                    for (int x = 0; x < TranArr.Count(); x++)
                    {
                        string[] temp = TranArr[x].Split('*');
                        list.Add(new TransactionDetail(temp[0].Trim(), temp[1].Trim()));
                    }
                }
                return(list);
            }
            else if (StepName == WFStepName.WarehouseManagerAppr.ToString() && FlowName == "WHEditAppGRN")
            {
                GRNBLL obj = new GRNBLL();
                TranArr = obj.GetGRNNoBylistEditTrackingNo(str);
                if (TranArr != null)
                {
                    for (int x = 0; x < TranArr.Count(); x++)
                    {
                        string[] temp = TranArr[x].Split('*');
                        list.Add(new TransactionDetail(temp[0].Trim(), temp[1].Trim()));
                    }
                }
                return(list);
            }
            else if (StepName == WFStepName.EditGRN.ToString() || StepName == WFStepName.WarehouseManagerAppr.ToString())
            {
                GRNBLL obj = new GRNBLL();
                TranArr = obj.GetGRNNoBylistTrackingNo(str);
                if (TranArr != null)
                {
                    for (int x = 0; x < TranArr.Count(); x++)
                    {
                        string[] temp = TranArr[x].Split('*');
                        list.Add(new TransactionDetail(temp[0].Trim(), temp[1].Trim()));
                    }
                }
                return(list);
            }
            else if (StepName == WFStepsName.EditGradingResult.ToString())
            {
                string            strTr;
                GradingDisputeBLL objGrDisp = new GradingDisputeBLL();
                TranArr = objGrDisp.GetReGradingRequestbyTrackingNo(str);

                if (TranArr != null)
                {
                    for (int x = 0; x < TranArr.Count(); x++)
                    {
                        string[] temp = TranArr[x].Split('*');
                        list.Add(new TransactionDetail(temp[0].Trim(), temp[1].Trim()));
                    }
                }

                return(list);
            }
            else if (StepName.ToUpper().Trim() == "CodeSampRec".ToUpper().Trim())
            {
                GradingBLL objSampling = new GradingBLL();
                TranArr = objSampling.GetGradingResultCodeBylistTrackingNo(str);
                if (TranArr != null)
                {
                    for (int x = 0; x < TranArr.Count(); x++)
                    {
                        string[] temp = TranArr[x].Split('*');
                        list.Add(new TransactionDetail(temp[0].Trim(), temp[1].Trim()));
                    }
                }
                return(list);
            }
            else
            {
                for (int x = 0; x < TranArr.Count(); x++)
                {
                    list.Add(new TransactionDetail(TranArr[x].Trim(), TranArr[x].Trim()));
                }
                return(list);
            }
        }