public bool UpdateOrderPlanModal(OrderPlanModal orderPlan)
        {
            try
            {
                var plan = VMSEntities.plan_quantities.Where(x => x.pqid == orderPlan.ID).FirstOrDefault();
                if (plan != null)
                {
                    plan.plan_quantity = orderPlan.Quantity;
                }
                else
                {
                    VMSEntities.plan_quantities.Add(new plan_quantities {
                        plan_quantity = orderPlan.Quantity, plan_datetime = DateTime.Now, mid = orderPlan.mid, loginid = orderPlan.loginid
                    });
                }


                VMSEntities.SaveChanges();
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public OrderPlanModal GetOrderPlanModal(int mid)
 {
     try
     {
         OrderPlanModal planModal = (from m in VMSEntities.modal_details
                                     join p in VMSEntities.plan_quantities on m.mid equals p.mid
                                     where m.mid == mid
                                     select new { ID = m.mid, ModalName = m.modal_name, ModalColor = m.modal_color, Quantity = p.plan_quantity }).Cast <OrderPlanModal>().FirstOrDefault();
         return(planModal);
     }
     catch (Exception ex)
     {
         throw;
     }
 }