Пример #1
0
 public static void WorkFlowManager(string TransactionNo)
 {
     if (String.IsNullOrEmpty(TransactionNo) == true)
     {
         throw new InvalidTransactionNumber("Invalid Tracking Number");
     }
     try
     {
         if (HttpContext.Current.Session["msg"] != null)
         {
             ECXWF.ECXEngine eng  = new WarehouseApplication.ECXWF.ECXEngine();
             ECXWF.CMessage  mess = (ECXWF.CMessage)HttpContext.Current.Session["msg"];
             mess.IsCompleted = true;
             eng.Response(TransactionNo.Trim(), mess);
         }
         else
         {
             throw new Exception("Session Expired");
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Work Flow Exception.", ex);
     }
 }
Пример #2
0
 public static string GetMessage(string transactionNo)
 {
     transactionNo = transactionNo.Trim();
     ECXWF.ECXEngine  eng  = new WarehouseApplication.ECXWF.ECXEngine();
     ECXWF.CMessage[] mess = null;
     try
     {
         mess = eng.Request(transactionNo, UserBLL.GetCurrentUser(), new string[] { WarehouseBLL.CurrentWarehouse.Location });
     }
     catch (Exception ex)
     {
         throw ex;
     }
     if (mess == null)
     {
         return("");
     }
     if (mess.Length > 1)
     {
         throw new Exception("Inappropriate Message exception");
     }
     else if (mess.Length == 1)
     {
         return(mess[0].Name.ToString());
     }
     return("");
 }
Пример #3
0
 public static void CompleteWorkflowTask(string transactionId)
 {
     ECXWF.ECXEngine eng = new WarehouseApplication.ECXWF.ECXEngine();
     ECXWF.CMessage  msg = (ECXWF.CMessage)HttpContext.Current.Session["msg"];
     msg.IsCompleted = true;
     eng.Response(transactionId, msg);
 }
Пример #4
0
 public static ECXWF.CMessage Request(string transactionNo)
 {
     transactionNo = transactionNo.Trim();
     ECXWF.ECXEngine  eng  = new WarehouseApplication.ECXWF.ECXEngine();
     ECXWF.CMessage[] mess = null;
     try
     {
         mess = eng.Request(transactionNo, UserBLL.GetCurrentUser(), new string[] { WarehouseBLL.CurrentWarehouse.Location });
         if (mess != null)
         {
             if (mess.Length > 0)
             {
                 return(mess[0]);
             }
             else
             {
                 return(null);
             }
         }
         return(null);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #5
0
        public static void RejectGINEditRequest()
        {
            PageDataTransfer  transferedData = new PageDataTransfer(HttpContext.Current.Request.Path);
            GINEditingRequest request        = (GINEditingRequest)transferedData.GetTransferedData("GINEditingRequest");

            ECXWF.ECXEngine engine = new WarehouseApplication.ECXWF.ECXEngine();
            engine.CloseTransaction(request.TransactionId);
        }
Пример #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string transactionNo = Request.QueryString["TranNo"];
            string taskName      = Request.QueryString["Task"];

            if (transactionNo == null)
            {
                return;
            }
            if (taskName.Trim().ToUpper() == "Full Arrival".ToUpper())
            {
                Response.Redirect("AddArrival.aspx");
                return;
            }
            else if (transactionNo == "ConfirmTrucksForSamp")
            {
                Response.Redirect("ConfirmTrucksForSampling.aspx");
                return;
            }
            else if (transactionNo == "GetSampleTicket")
            {
                Response.Redirect("GetSampleTicket.aspx");
                return;
            }


            ECXWF.ECXEngine  eng  = new WarehouseApplication.ECXWF.ECXEngine();
            ECXWF.CMessage[] mess = null;
            try
            {
                //eng.UnlockMessageByUser(Request.QueryString["TranNo"], "AddVoucherInformation", UserBLL.GetCurrentUser());
                //eng.RemoveTransactionFromStack(Request.QueryString["TranNo"]);
                mess = eng.Request(Request.QueryString["TranNo"], UserBLL.GetCurrentUser(), new string[] { WarehouseBLL.CurrentWarehouse.Location });
            }
            catch (Exception ex)
            {
                throw ex;
            }
            if (mess == null)
            {
                return;
            }
            if (mess.Length > 1)
            {
                this.lstPages.DataValueField = "Name";
                this.lstPages.DataTextField  = "Name";
                this.lstPages.DataSource     = mess;
            }
            else if (mess.Length == 1)
            {
                this.Session["msg"] = mess[0];
                this.Response.Redirect(this.PageFactory(mess[0], Request.QueryString["TranNo"], new object[] { Request.QueryString["Id"] }));
                return;
            }
            btnOpen.Enabled = (lstPages.SelectedIndex >= 0);
        }
Пример #7
0
        public static string StartWorkflowTask(Guid transactionType)
        {
            string transactionNo = null;

            ECXWF.ECXEngine eng = new WarehouseApplication.ECXWF.ECXEngine();
            eng.OpenTransaction(transactionType,
                                new Guid(SystemLookup.LookupSource.GetLookup("CurrentUser")["Id"]),
                                new string[] { "" }, WarehouseBLL.GetWarehouseCode(UserBLL.GetCurrentWarehouse()), out transactionNo);
            return(transactionNo);
        }
Пример #8
0
        public static string GetTransaction(Guid TransactionTypeId)
        {
            string TransactionNo;

            bool isSaved = false;


            ECXWF.ECXEngine eng = new WarehouseApplication.ECXWF.ECXEngine();
            eng.OpenTransaction(TransactionTypeId, UserBLL.GetCurrentUser(),
                                new string[] { "" }, WarehouseBLL.GetWarehouseCode(UserBLL.GetCurrentWarehouse()), out TransactionNo);

            return(TransactionNo);
        }
Пример #9
0
 public static string[] GetTransaction(string transactionTypeCode, string taskName, string step)
 {
     string[] strTrackingNo;
     try
     {
         ECXWF.ECXEngine eng = new WarehouseApplication.ECXWF.ECXEngine();
         strTrackingNo = eng.GetTransactionsByTaskName(transactionTypeCode, taskName, step);
         return(strTrackingNo);
     }
     catch
     {
         throw new Exception("Unable to get transactions.");
     }
 }
Пример #10
0
 public static void Remove(string TransactionNo)
 {
     TransactionNo = TransactionNo.Trim();
     if (String.IsNullOrEmpty(TransactionNo) == true)
     {
         throw new InvalidTransactionNumber("Invalid Tracking Number");
     }
     try
     {
         ECXWF.ECXEngine eng = new WarehouseApplication.ECXWF.ECXEngine();
         eng.RemoveTransaction(TransactionNo);
     }
     catch (Exception ex)
     {
         throw new Exception("Workflow Engine Exception: Unable to Remove task.", ex);
     }
 }
Пример #11
0
        public static string[] GetOpentransaction(string transactionTypeCode, string taskName, string step)
        {
            string[]      transaction;
            List <string> lstTran = null;

            ECXWF.ECXEngine eng = new WarehouseApplication.ECXWF.ECXEngine();
            transaction = eng.GetTransactionsByTaskName(transactionTypeCode, taskName, step);
            if (transaction.Count() > 0)
            {
                lstTran = new List <string>();
                lstTran = transaction.ToList <string>();
                if (lstTran != null)
                {
                    if (lstTran.Count > 0)
                    {
                        string str = "";
                        foreach (string s in lstTran)
                        {
                            str += "'" + s + "' , ";
                        }
                        int x = str.LastIndexOf(',');
                        str     = str.Remove(x);
                        lstTran = WarehouseTrackingNoDAL.GetWarehouseTracking(str, UserBLL.GetCurrentWarehouse());
                        if (lstTran != null)
                        {
                            if (lstTran.Count > 0)
                            {
                                return(lstTran.ToArray <string>());
                            }
                        }
                    }
                }
            }
            else
            {
                return(null);
            }

            //Check the transaction Numbers are in the current WH from DB.

            //Get the count of the new Transaction array after current WH from DB
            return(null);
        }
Пример #12
0
        private void WFM(string stTran)
        {
            string TransactionNo = "";

            if (stTran == "")
            {
                TransactionNo = Request.QueryString["TranNo"];
            }
            else
            {
                TransactionNo = stTran;
            }

            ECXWF.ECXEngine  eng  = new WarehouseApplication.ECXWF.ECXEngine();
            ECXWF.CMessage[] mess = eng.Request(TransactionNo, UserBLL.GetCurrentUser(), new string[] { "" });
            mess[0].IsCompleted = true;
            eng.Response(TransactionNo, mess[0]);
            //Response.Redirect("~/PageSwicther.aspx?TranNo=" + TransactionNo);
        }
Пример #13
0
        public static string GetTransaction(Guid TransactionTypeId, SqlTransaction tran)
        {
            string TransactionNo;

            bool isSaved = false;


            ECXWF.ECXEngine eng = new WarehouseApplication.ECXWF.ECXEngine();
            eng.OpenTransaction(TransactionTypeId, UserBLL.GetCurrentUser(),
                                new string[] { "" }, WarehouseBLL.GetWarehouseCode(UserBLL.GetCurrentWarehouse()), out TransactionNo);
            isSaved = WarehouseTrackingNoBLL.Save(TransactionNo, tran);
            if (isSaved == false)
            {
                WFTransaction.Remove(TransactionNo);

                throw new Exception("Unable to get Transaction.WFTransaction.");
            }
            else
            {
                return(TransactionNo);
            }
        }
Пример #14
0
 public static void UnlockTask(string transactionNo)
 {
     transactionNo = transactionNo.Trim();
     ECXWF.ECXEngine eng = new WarehouseApplication.ECXWF.ECXEngine();
     eng.UnlockTask(transactionNo);
 }
Пример #15
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            #region co
            //string taskNo = txtTaskNo.Text.Trim();
            //if (taskNo != string.Empty)
            //{
            //    XMLHelper objHelper = new XMLHelper(Session["Inboxpath"].ToString());
            //    InboxItems item = objHelper.SearchByInboxItemName(Session["WarehouseInboxItemName"].ToString());
            //    List<TransactionDetail> listDisplay = item.GetTransactions().Where(t => t.TrackNo == taskNo).ToList();
            //    if ("Select Trucks For Sampling" == Session["WarehouseInboxItemName"].ToString())
            //    {
            //        TransactionDetail obj = new TransactionDetail("", "");
            //        obj.DisplayName = "Select Trucks for Sampling";
            //        obj.TrackNo = "GetTrucksReadyForSam";
            //        listDisplay.RemoveAll(RemovePredicate);
            //        listDisplay.Add(obj);
            //    }
            //    else if ("Confirm Trucks For Sampling" == Session["WarehouseInboxItemName"].ToString())
            //    {
            //        TransactionDetail obj = new TransactionDetail("", "");
            //        obj.DisplayName = "Confirm Truks For Sampling";
            //        obj.TrackNo = "ConfirmTrucksForSamp";
            //        listDisplay.RemoveAll(RemovePredicate);
            //        listDisplay.Add(obj);
            //    }
            //    else if ("Assign Sampler".Trim() == Session["WarehouseInboxItemName"].ToString().Trim())
            //    {
            //        TransactionDetail obj = new TransactionDetail("", "");
            //        obj.DisplayName = "Assign Sampler";
            //        obj.TrackNo = "GetSampleTicket";
            //        listDisplay.RemoveAll(RemovePredicate);
            //        listDisplay.Add(obj);
            //    }

            //    this.gvDetail.DataSource = listDisplay;
            //    this.gvDetail.DataBind();
            //}
            #endregion
            if (string.IsNullOrEmpty(txtTaskNo.Text))
            {
                msg.Text = "Please Provide Tracking No.";
                return;
            }
            string           strTR = txtTaskNo.Text.Trim();
            ECXWF.ECXEngine  eng   = new WarehouseApplication.ECXWF.ECXEngine();
            ECXWF.CMessage[] mess  = null;

            try
            {
                //eng.UnlockMessageByUser(Request.QueryString["TranNo"], "AddVoucherInformation", UserBLL.GetCurrentUser());
                //eng.RemoveTransactionFromStack(Request.QueryString["TranNo"]);
                mess = eng.Request(strTR, UserBLL.GetCurrentUser(), new string[] { WarehouseBLL.CurrentWarehouse.Location });
                if (mess != null)
                {
                    WFTransaction.UnlockTask(strTR);
                    List <TransactionDetail> lst = new List <TransactionDetail>(new TransactionDetail[] {
                        new TransactionDetail(strTR, strTR)
                    });


                    this.gvDetail.DataSource = lst;
                    this.gvDetail.DataBind();
                }
                else
                {
                    msg.Text = "No Tracking number matchs the supplied criteria";
                }
            }
            catch (Exception ex)
            {
                txtTaskNo.Text = "";
                msg.Text       = "Re-enter the Tracking No and Try Again";
                //throw ex;
            }
        }
Пример #16
0
        public static int GetOpentransactionCount(string transactionTypeCode, string taskName, string step)
        {
            int count = 0;

            string[]      transaction;
            List <string> lsttransaction;

            ECXWF.ECXEngine eng = new WarehouseApplication.ECXWF.ECXEngine();
            //try
            //{

            //transaction = eng.GetTransactionsByTaskName(transactionTypeCode, taskName, step);
            transaction    = null;
            lsttransaction = new List <string>();
            // lsttransaction = transaction.ToList<string>();

            string str = "";

            if (lsttransaction != null)
            {
                if (lsttransaction.Count > 0)
                {
                    foreach (string s in lsttransaction)
                    {
                        if (s != null)
                        {
                            str += "'" + s + "' , ";
                        }
                    }
                    int x = str.LastIndexOf(',');
                    str            = str.Remove(x);
                    lsttransaction = WarehouseTrackingNoDAL.GetWarehouseTracking(str, UserBLL.GetCurrentWarehouse());
                }
                else
                {
                    return(0);
                }
            }
            else
            {
                return(0);
            }

            //  }
            //  catch (Exception ex)
            //  {
            //     throw new Exception("Unable to Get Workflow Data", ex);
            //  }
            if (lsttransaction != null)
            {
                count = lsttransaction.Count;
            }
            else
            {
                return(0);
            }
            //Check the transaction Numbers are in the current WH from DB.

            //Get the count of the new Transaction array after current WH from DB

            return(count);
        }
Пример #17
0
 public static void RemoveWorkflowTask(string transactionId)
 {
     ECXWF.ECXEngine eng = new WarehouseApplication.ECXWF.ECXEngine();
     eng.RemoveTransaction(transactionId);
 }