예제 #1
0
 public Task <PickingList> Update(PickingList entity)
 {
     return(Task.Run(() =>
     {
         InventoryManager.Create(CommerceRuntimeManager.Runtime).SavePickingList(false, entity);
         return entity;
     }));
 }
예제 #2
0
 public void SetupTest()
 {
     G.SetupTest();
     _verificationErrors = new StringBuilder();
     _auth   = new Authentication();
     _pick   = new PickingList();
     _pickD  = new PickingDetail();
     _orderL = new OrderList();
     _orderD = new OrderDetail();
 }
예제 #3
0
 public Task Delete(PickingList entity)
 {
     throw new NotSupportedException();
 }
예제 #4
0
 public Task <PickingList> Create(PickingList entity)
 {
     throw new NotSupportedException();
 }
예제 #5
0
        public ProductionJournalResponse GetProductionJournalData(ProductionJournalRequest PJR)
        {
            ProductionJournalResponse SM = new ProductionJournalResponse();

            try
            {
                if (PJR.UserId == "" || PJR.UserId == null)
                {
                    SM.Status  = "Failure";
                    SM.Message = "Invalid UserId";
                    return(SM);
                }
                if (PJR.WorkOrderNo == "" || PJR.WorkOrderNo == null)
                {
                    SM.Status  = "Failure";
                    SM.Message = "Invalid WorkOrderId";
                    return(SM);
                }


                query     = "Sp_WorkOrderWebApi";
                dbcommand = new SqlCommand(query, conn);
                dbcommand.Connection.Open();
                dbcommand.CommandType = CommandType.StoredProcedure;
                dbcommand.Parameters.AddWithValue("@QueryType", "GetProductionJournalData");
                dbcommand.Parameters.AddWithValue("@WorkOrderNo", PJR.WorkOrderNo);
                dbcommand.Parameters.AddWithValue("@UserId", PJR.UserId);
                dbcommand.CommandTimeout = 0;
                SqlDataAdapter da   = new SqlDataAdapter(dbcommand);
                DataSet        data = new DataSet();
                da.Fill(data);

                if (data.Tables[0].Rows[0]["value"].ToString() != "2")
                {
                    SM.WorkOrderNo = PJR.WorkOrderNo;
                    SM.ItemId      = data.Tables[0].Rows[0]["ITEMID"].ToString();
                    SM.ItemName    = data.Tables[0].Rows[0]["NAME"].ToString();
                    SM.Quantity    = data.Tables[0].Rows[0]["QTYSCHED"].ToString();
                    SM.WareHouseId = data.Tables[3].Rows[0]["WareHouseId"].ToString();
                    SM.SiteID      = data.Tables[3].Rows[0]["SiteID"].ToString();


                    List <PickingList> PickingList = new List <PickingList>();
                    foreach (DataRow row in data.Tables[1].Rows)
                    {
                        PickingList A = new PickingList();
                        A.ItemName = row["NAME"].ToString();
                        A.Unit     = row["UNITID"].ToString();
                        A.ItemId   = row["ITEMID"].ToString();
                        PickingList.Add(A);
                    }
                    SM.PickingListData = PickingList;

                    List <RoutingCardList> RoutingList = new List <RoutingCardList>();
                    foreach (DataRow row in data.Tables[2].Rows)
                    {
                        RoutingCardList A = new RoutingCardList();
                        A.OperationName = row["Operation"].ToString();
                        A.Resource      = row["Resource"].ToString();
                        A.ResourceType  = row["ResourceType"].ToString();
                        A.OperationId   = row["OperationNo"].ToString();
                        A.Priority      = row["PRIORITY"].ToString();
                        RoutingList.Add(A);
                    }
                    SM.RoutingListData = RoutingList;

                    SM.Status  = "Success";
                    SM.Message = "Picking List Success ";
                }
                else
                {
                    SM.Status  = "Failure";
                    SM.Message = "This Workorder does not exist";
                    return(SM);
                }
                //if (ds.Rows[0]["value"].ToString() == "1")
                //{
                //    SM.Status = "Success";
                //    SM.Message = "SubmitProductionJournalProcess Successfully";
                //}
                //else
                //{
                //    SM.Status = "Failure";
                //    SM.Message = "SubmitProductionJournalProcess Failure";
                //}
            }
            catch (Exception Ex)
            {
                SM.Status  = "Failure";
                SM.Message = Ex.Message;
            }
            //finally
            //{
            //    //dbcommand.Connection.Close();
            //}
            return(SM);
        }
    protected void btnGeneratePickingList_Click(object sender, EventArgs e)
    {
        if (IsValid)
        {
            DateTime currentTime = DateTime.UtcNow.AddHours(10); // Australian time

            string path = Server.MapPath("~/files/temp/PickingList-" + DateTime.Now.ToString("MMddyy") + ".pdf");

            User user = new DataModelEntities().Users.First(u => u.User_Code == UserKey);

            string lastBuyerID = string.Empty;
            int count = 1;
            foreach (RepeaterItem item in rptParcelItems.Items)
            {
                if (((CheckBox)item.FindControl("chkSelect")).Checked == true)
                {
                    string isIncomplete = ((HtmlInputHidden)item.FindControl("hfIsIncomplete")).Value;

                    if (isIncomplete.ToLower() == "true")
                    {
                        continue;
                    }

                    string itemID = ((HiddenField)item.FindControl("hfItemID")).Value;
                    string transactionId = ((HiddenField)item.FindControl("hfTransactionID")).Value;
                    string customLabel = ((HiddenField)item.FindControl("hfCustomLabel")).Value;
                    string customLabelText = ((Label)item.FindControl("lblCustomLabel")).Text;
                    string itemName = ((Label)item.FindControl("lblItemName")).Text;
                    string state = ((HiddenField)item.FindControl("hfState")).Value;
                    string street = ((HtmlInputHidden)item.FindControl("hfStreet")).Value;
                    string street2 = ((HtmlInputHidden)item.FindControl("hfStreet2")).Value;
                    string street3 = ((HtmlInputHidden)item.FindControl("hfStreet3")).Value;
                    string city = ((HtmlInputHidden)item.FindControl("hfCity")).Value;
                    string postalCode = ((HtmlInputHidden)item.FindControl("hfPostalCode")).Value;
                    string country = ((HiddenField)item.FindControl("hfCountry")).Value;
                    string phone = ((HiddenField)item.FindControl("hfPhone")).Value;
                    string shippingMethod = ((Label)item.FindControl("lblShippingMethod")).Text;
                    string buyerName = ((Label)item.FindControl("lblBuyerName")).Text;
                    string buyerId = ((Label)item.FindControl("lblBuyerID")).Text;
                    string quantity = ((Label)item.FindControl("lblQuantity")).Text;
                    string price = ((HiddenField)item.FindControl("hfPrice")).Value;
                    string currency = ((HiddenField)item.FindControl("hfCurrency")).Value;
                    string shippingCost = ((HiddenField)item.FindControl("hfShippingCost")).Value;
                    string saleRecordId = ((HiddenField)item.FindControl("hfSaleRecordId")).Value;

                    PickingList pickingItem = new PickingList();

                    PickingList samePickingItem = pickingList.FirstOrDefault(i => i.CustomLabel == customLabel);
                    if (samePickingItem == null)
                    {
                        pickingItem.CustomLabel = customLabel;
                        pickingItem.Description = itemName;
                        pickingItem.Quantity = int.Parse(quantity);
                        pickingItem.QuantitySupplied = int.Parse(quantity);

                        pickingList.Add(pickingItem);
                    }
                    else
                    {
                        samePickingItem.Quantity += int.Parse(quantity);
                        samePickingItem.QuantitySupplied += int.Parse(quantity);
                    }

                    count++;
                }
            }

            GeneratePL_PDF(path);

            GenerateZip(path, "Ebay-PickingList");
        }
    }