Exemple #1
0
        protected void drpStackNo_SelectedIndexChanged(object sender, EventArgs e)
        {
            StackTransactionModel sm = new StackTransactionModel(CurrentGINModel);

            sm.StackID            = new Guid(drpStackNo.SelectedValue);
            HiddenFieldTare.Value = sm.Tare.ToString();
        }
Exemple #2
0
        protected void btnAddStack_Click(object sender, EventArgs e)
        {
            StackTransactionModel sm = GetStack();

            //if (sm.IsValid())
            //{
            if (!RemainingWeight())
            {
                Messages.SetMessage("Requested Net Weight is greater than total available PUN weight. Please check the Loading Ticket.", WarehouseApplication.Messages.MessageType.Warning);
            }
            else
            {
                GINModel ginModel = new GINModel();
                ginModel = (GINModel)Session["GINMODEL"];
                try
                {
                    DateTime dtm  = DateTime.Parse((Convert.ToDateTime(txtDateWeighted.Text).ToShortDateString()) + " " + Convert.ToDateTime(txtDateWeightedTime.Text).ToShortTimeString());
                    DateTime dtm2 = DateTime.Parse((Convert.ToDateTime(txtDateLoaded.Text).ToShortDateString()) + " " + Convert.ToDateTime(txtDateLoadedTime.Text).ToShortTimeString());
                    ginModel.AddStack(new Guid(drpStackNo.SelectedValue), new Guid(drpWeigherSupervisor.SelectedValue), txtScaleTicketNo.Text, txtLoadingTicket.Text, dtm, Convert.ToDouble(txtTruckWeight.Text), Convert.ToDouble(txtGrossWeight.Text), Convert.ToDouble(txtNoOfBags.Text), dtm2, Convert.ToInt32(drpTruckType.SelectedValue), Convert.ToInt32(drpWBServiceProvider.SelectedValue));
                    btnAddStack.Visible = false;
                }
                catch (Exception ex)
                {
                    Messages.SetMessage(ex.Message, WarehouseApplication.Messages.MessageType.Warning);
                }
                gvStack.DataSource = ginModel.StackInfosList;
                gvStack.DataBind();
                Session["GINMODEL"] = ginModel;
                DoNewStack();
            }
            //}
        }
Exemple #3
0
 private void FillCarType(DropDownList ddl)
 {
     ddl.DataSource     = null;
     ddl.DataSource     = StackTransactionModel.GetTruckType(CurrentGINModel);
     ddl.DataTextField  = "TruckTypeName";
     ddl.DataValueField = "TruckTypeID";
     ddl.DataBind();
 }
Exemple #4
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            bool isCoffee            = false;
            StackTransactionModel sm = GetStack();
            GINModel gm = CurrentGINModel;

            if (CurrentGINModel.PickupNoticesList[0].Commodity == new Guid("71604275-df23-4449-9dae-36501b14cc3b"))
            {
                isCoffee = true;
            }
            string errorMessage = string.Empty;

            try
            {
                if (RemainingWeight())
                {
                    if (SateGIN())
                    {
                        if (sm.IsValid(isCoffee))
                        {
                            if (isCoffee)
                            {
                                SaveBondedYardGIN();
                            }
                            else
                            {
                                gm.AddStack(sm);
                                if (gm.IsValid())
                                {
                                    SaveGIN();
                                }
                                else
                                {
                                    errorMessage = gm.ErrorMessage;
                                    Messages.SetMessage(gm.ErrorMessage, WarehouseApplication.Messages.MessageType.Error);
                                }
                            }
                        }
                        else
                        {
                            errorMessage = gm.ErrorMessage;
                            Messages.SetMessage(gm.ErrorMessage, WarehouseApplication.Messages.MessageType.Error);
                        }
                    }
                    else
                    {
                        Session["remainingBalance"] = null;
                    }
                }
            }
            catch (Exception ex)
            {
                Session["remainingBalance"] = Convert.ToDouble(Session["remainingBalance"]) + Convert.ToDouble(Session["netWeight"]);
                Messages.SetMessage(ex.Message.ToString(), WarehouseApplication.Messages.MessageType.Error);
            }
        }
Exemple #5
0
        private void PopulateStack(Guid LIC)
        {
            WarehouseOperator ob = new WarehouseOperator();

            CurrentGINModel.LICShedID = LIC;
            List <StackTransactionModel> list = null;

            if (CurrentGINModel.PickupNoticesList[0].Commodity != new Guid("71604275-df23-4449-9dae-36501b14cc3b"))
            {
                list = StackTransactionModel.GetStackInShed(CurrentGINModel);
                if (list != null)
                {
                    //drpStackNo.DataSource = list;
                    //drpStackNo.DataTextField = "StackNumber";
                    //drpStackNo.DataValueField = "ID";
                    //drpStackNo.DataBind();
                    DataRow dr = StackTransactionModel.GetShedCurrentBalance(CurrentGINModel);
                    if (dr != null)
                    {
                        txtShedNo.Text          = dr["ShedNo"].ToString();
                        txtCommoditySymbol.Text = dr["CommoditySymbol"].ToString();
                        txtCurrentBalance.Text  = dr["CurrentBalance"].ToString();
                        txtCurrentWeight.Text   = dr["CurrentWeight"].ToString();
                    }
                    else
                    {
                        txtShedNo.Text          = string.Empty;
                        txtCommoditySymbol.Text = string.Empty;;
                        txtCurrentBalance.Text  = string.Empty;;
                        txtCurrentWeight.Text   = string.Empty;
                    }
                }
            }
            else
            {
                list = StackTransactionModel.GetCurCoffBalance(CurrentGINModel);
                if (list != null)
                {
                    DataRow dr = StackTransactionModel.GetShedCurrCoffBalance(CurrentGINModel);
                    if (dr != null)
                    {
                        txtShedNo.Text          = dr["ShedNo"] == null ? "" : dr["ShedNo"].ToString();
                        txtCommoditySymbol.Text = dr["CommoditySymbol"].ToString();
                        txtCurrentBalance.Text  = dr["CurrentBalance"].ToString();
                        txtCurrentWeight.Text   = dr["CurrentWeight"].ToString();
                    }
                    else
                    {
                        txtShedNo.Text          = string.Empty;
                        txtCommoditySymbol.Text = string.Empty;;
                        txtCurrentBalance.Text  = string.Empty;;
                        txtCurrentWeight.Text   = string.Empty;
                    }
                }
            }
        }
Exemple #6
0
        private void FillWBServiceProvider(DropDownList ddl)
        {
            ddl.DataSource = null;
            List <GINBussiness.StackTransactionModel> lst = StackTransactionModel.GetWBServiceProvider(CurrentGINModel);

            ddl.DataSource     = lst;
            ddl.DataTextField  = "ServiceProviderName";
            ddl.DataValueField = "WBServiceProviderID";
            ddl.DataBind();
        }
Exemple #7
0
        protected void OkButton_Click(object sender, EventArgs e)
        {
            GINModel ginModel        = (GINModel)Session["GINMODEL"];
            StackTransactionModel sm = new StackTransactionModel(CurrentGINModel);

            CurrentGINModel.stackList      = null;
            CurrentGINModel.StackInfosList = new List <StackTransactionModel>();
            Session.Remove("remainingBalance");

            gvStack.DataSource = null;
            gvStack.DataBind();
            PopulateStack(new Guid(drpInventoryCoordinatorLoad.SelectedValue));
            drpStackNo.Items.Insert(0, new ListItem("Select", string.Empty));
        }
Exemple #8
0
        private StackTransactionModel GetStack()
        {
            StackTransactionModel sm = new StackTransactionModel(CurrentGINModel);

            sm.StackID             = Guid.Empty;
            sm.ScaleTicketNumber   = txtScaleTicketNo.Text.Trim();
            sm.LoadUnloadTicketNO  = txtLoadingTicket.Text;
            sm.DateTimeWeighed     = DateTime.Now;
            sm.DateTimeLoaded      = DateTime.Now;
            sm.WeigherID           = Guid.Empty;
            sm.TruckWeight         = TextToDouble(txtTruckWeight.Text);
            sm.GrossWeight         = TextToDouble(txtGrossWeight.Text);
            sm.NoOfBags            = TextToDouble(txtNoOfBags.Text);
            sm.WBServiceProviderID = 1;
            if (CurrentGINModel.PickupNoticesList[0].Commodity != new Guid("71604275-df23-4449-9dae-36501b14cc3b"))
            {
                if (new Guid(drpStackNo.SelectedValue) != Guid.Empty)
                {
                    sm.StackID = new Guid(drpStackNo.SelectedValue);
                }
                if (!string.IsNullOrEmpty(txtScaleTicketNo.Text.Trim()))
                {
                    sm.ScaleTicketNumber = txtScaleTicketNo.Text.Trim();
                }
                if (!string.IsNullOrEmpty(txtLoadingTicket.Text.Trim()))
                {
                    sm.LoadUnloadTicketNO = txtLoadingTicket.Text.Trim();
                }
                DateTime dtm  = DateTime.Parse((Convert.ToDateTime(txtDateWeighted.Text).ToShortDateString()) + " " + Convert.ToDateTime(txtDateWeightedTime.Text).ToShortTimeString());
                DateTime dtm2 = DateTime.Parse((Convert.ToDateTime(txtDateLoaded.Text).ToShortDateString()) + " " + Convert.ToDateTime(txtDateLoadedTime.Text).ToShortTimeString());
                sm.DateTimeWeighed = dtm;
                sm.DateTimeLoaded  = dtm2;
            }
            if (drpWeigherSupervisor.SelectedIndex > 0)
            {
                sm.WeigherID = new Guid(drpWeigherSupervisor.SelectedValue);
            }
            if (drpTruckType.SelectedIndex > 0)
            {
                sm.TruckTypeID = Convert.ToInt32(drpTruckType.SelectedValue);
            }
            if (drpWBServiceProvider.SelectedIndex > 0)
            {
                sm.WBServiceProviderID = Convert.ToInt32(drpWBServiceProvider.SelectedValue);
            }
            sm.TruckWeight = TextToDouble(txtTruckWeight.Text);
            sm.GrossWeight = TextToDouble(txtGrossWeight.Text);
            sm.NoOfBags    = TextToDouble(txtNoOfBags.Text);
            return(sm);
        }
Exemple #9
0
        private void PopulateStack(Guid LIC)
        {
            WarehouseOperator ob = new WarehouseOperator();

            CurrentGINModel.LICShedID = LIC;
            List <StackTransactionModel> list = null;

            list = StackTransactionModel.GetStackInShed(CurrentGINModel);
            if (list != null)
            {
                drpStackNo.DataSource     = list;
                drpStackNo.DataTextField  = "StackNumber";
                drpStackNo.DataValueField = "ID";
                drpStackNo.DataBind();
            }
        }
Exemple #10
0
        protected void gvStack_SelectedIndexChanged(object sender, EventArgs e)
        {
            GINModel gm            = (GINModel)Session["GINMODEL"];
            Guid     stackLoadedId = new Guid(gvStack.SelectedDataKey["StackID"].ToString());

            if (gm.StackInfosList.Count != 0)
            {
                StackTransactionModel stm     = gm.StackInfosList.First(s => s.StackID == stackLoadedId);
                Guid commodityGradeId         = ((GINModel)Session["GINMODEL"]).PickupNoticesList[0].CommodityGradeID;
                List <BagTypeBLL> bagTypeList = BagTypeBLL.GetCommodityGradeBagTypes(commodityGradeId);

                if (Session["remainingBalance"] == null)
                {
                    Session["remainingBalance"] = gm.PickupNoticesList.Sum(s => s.RemainingWeight);//+ (stm.GrossWeight - stm.TruckWeight - bagTypeList[0].Tare * stm.NoOfBags);
                }
                else
                {
                    Session["remainingBalance"] = (double)Session["remainingBalance"] + (stm.GrossWeight - stm.TruckWeight - stm.Tare * stm.NoOfBags);
                }
                txtScaleTicketNo.Text    = stm.ScaleTicketNumber;
                txtDateWeighted.Text     = stm.DateTimeWeighed.ToShortDateString();
                txtDateWeightedTime.Text = stm.DateTimeWeighed.ToShortTimeString();
                txtTruckWeight.Text      = stm.TruckWeight.ToString();
                txtGrossWeight.Text      = stm.GrossWeight.ToString();
                txtNoOfBags.Text         = stm.NoOfBags.ToString();
                txtLoadingTicket.Text    = stm.LoadUnloadTicketNO;
                PopulateStack(new Guid(drpInventoryCoordinatorLoad.SelectedValue));
                drpStackNo.SelectedValue = stm.StackID.ToString();
                //stm.StackID = new Guid(drpStackNo.SelectedValue);
                HiddenFieldTare.Value = stm.Tare.ToString();
                drpWeigherSupervisor.SelectedValue = stm.WeigherID.ToString();// drpWeigherSupervisor.Items.Cast<ListItem>().First(s => new Guid(s.Value) == stm.WeigherID).Value;
                gm.StackInfosList.Remove(stm);
                gm.RemoveStack(stm.StackID);
                btnAddStack.Visible = true;
                FillWBServiceProvider(drpWBServiceProvider);
                drpWBServiceProvider.SelectedValue = stm.WBServiceProviderID.ToString();
                //drp
                FillCarType(drpTruckType);
                drpTruckType.SelectedValue = stm.TruckTypeID.ToString();
                // gvStack.DataSource = gm.StackInfosList;
                // gvStack.DataBind();
            }
            else
            {
                Messages.SetMessage("The stack is already selected or Empty Stack.", WarehouseApplication.Messages.MessageType.Warning);
            }
        }
Exemple #11
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            StackTransactionModel sm = GetStack();
            GINModel gm           = CurrentGINModel;
            string   errorMessage = string.Empty;

            try
            {
                if (RemainingWeight())
                {
                    if (SateGIN())
                    {
                        if (sm.IsValid())
                        {
                            gm.AddStack(sm);
                            if (gm.IsValid())
                            {
                                SaveGIN();
                            }
                            else
                            {
                                errorMessage = gm.ErrorMessage;
                                Messages.SetMessage(gm.ErrorMessage, WarehouseApplication.Messages.MessageType.Error);
                            }
                        }
                        else
                        {
                            errorMessage = gm.ErrorMessage;
                            Messages.SetMessage(gm.ErrorMessage, WarehouseApplication.Messages.MessageType.Error);
                        }
                    }
                    else
                    {
                        Session["remainingBalance"] = null;
                    }
                }
            }
            catch (Exception ex)
            {
                Session["remainingBalance"] = Convert.ToDouble(Session["remainingBalance"]) + Convert.ToDouble(Session["netWeight"]);
                Messages.SetMessage(ex.Message.ToString(), WarehouseApplication.Messages.MessageType.Error);
            }
        }
Exemple #12
0
        private void PopulateStack(Guid LIC)
        {
            WarehouseOperator ob = new WarehouseOperator();

            CurrentGINModel.LICShedID = LIC;
            List <StackTransactionModel> list = null;

            list = StackTransactionModel.GetStackInShed(CurrentGINModel);
            if (list != null)
            {
                //drpStackNo.DataSource = list;
                //drpStackNo.DataTextField = "StackNumber";
                //drpStackNo.DataValueField = "ID";
                //drpStackNo.DataBind();
                DataRow dr = StackTransactionModel.GetShedCurrentBalance(CurrentGINModel);
                txtShedNo.Text          = dr["ShedNo"].ToString();
                txtCommoditySymbol.Text = dr["CommoditySymbol"].ToString();
                txtCurrentBalance.Text  = dr["CurrentBalance"].ToString();
                txtCurrentWeight.Text   = dr["CurrentWeight"].ToString();
            }
        }