Ejemplo n.º 1
0
 //[ValidateAntiForgeryToken]
 public JsonResult Edit([Bind(Include = "id,unit_name,category_id,unit_type,ratio")]
                        Unit_of_Measures unit_of_Measures)
 {
     if (ModelState.IsValid)
     {
         db.Entry(unit_of_Measures).State = EntityState.Modified;
         db.SaveChanges();
         return(Json(unit_of_Measures));
     }
     return(null);
 }
Ejemplo n.º 2
0
        //[ValidateAntiForgeryToken]
        public JsonResult DeleteConfirmed(int id)
        {
            Unit_of_Measures unit_of_Measures = db.Unit_of_Measures.Find(id);

            try
            {
                db.Unit_of_Measures.Remove(unit_of_Measures);
                db.SaveChanges();
                return(Json(true));
            }catch (DbUpdateException ex)
            {
                return(null);
            }
        }
Ejemplo n.º 3
0
 //[ValidateAntiForgeryToken]
 public JsonResult Create([Bind(Include = "unit_name,category_id,unit_type,ratio")]
                          Unit_of_Measures unit_of_Measures)
 {
     if (ModelState.IsValid)
     {
         int?catId = unit_of_Measures.category_id;
         if (unit_of_Measures.unit_type == "reference" &&
             db.UoMCategories.Find(catId).refranse_flag == true)
         {
             return(Json("يوجد بالفعل وحدة قياس مرجعية لهذه الفئة"));
         }
         db.Unit_of_Measures.Add(unit_of_Measures);
         db.SaveChanges();
         return(Json(unit_of_Measures));
     }
     return(null);
 }
Ejemplo n.º 4
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Unit_of_Measures unit_of_Measures = db.Unit_of_Measures.Find(id);

            if (unit_of_Measures == null)
            {
                return(HttpNotFound());
            }

            ViewBag.category_id = new SelectList(
                db.UoMCategories, "id", "name", unit_of_Measures.UoMCategory.id);
            return(View(unit_of_Measures));
        }
Ejemplo n.º 5
0
    public void ShowDataInGrid()
    {
        DataTable dt;

        dt = new DataTable();
        switch (drpMastertable.SelectedItem.ToString())
        {
        case "Brand Master":

            Brand_Masters Brand_Masters = new Brand_Masters();

            IList <Brand_Master> ilistbrandMaster = Brand_Masters.GetBrand_Masters(txtCode.Text, txtName.Text, drpSelectCompany.SelectedItem.Text);
            dt = ConvertTable.ToDataTable <Brand_Master>(ilistbrandMaster);
            bindBrandMaster(dt);
            // grdMasterTable.DataSource = Brand_Masters.GetBrand_Masters(txtCode.Text, txtName.Text, drpSelectCompany.SelectedItem.Text);
            //grdMasterTable.DataBind();
            txtCode.Visible = true;
            txtName.Visible = true;
            lblName.Visible = true;
            lblCode.Visible = true;
            btnGo.Visible   = true;
            //Added by Jyothi
            btnExport.Visible = true;
            break;

        case "Cancellation Reason Code":
            Cancellation_Reason_Codes Cancellation_Reason_Codes = new Cancellation_Reason_Codes();
            //DataTable dt = new DataTable();
            IList <Cancellation_Reason_Code> ilistCancelReasonCode = Cancellation_Reason_Codes.GetCancellation_Reason_Codes(txtCode.Text, drpSelectCompany.SelectedItem.Text);
            dt = ConvertTable.ToDataTable <Cancellation_Reason_Code>(ilistCancelReasonCode);
            bindCancellationReasonCode(dt);
            txtCode.Visible = true;
            lblCode.Visible = true;
            btnGo.Visible   = true;
            //Added by Jyothi
            btnExport.Visible = true;
            break;

        case "Customer Master":
            Customers        Customer      = new Customers();
            IList <Customer> ilistCustomer = Customer.GetCustomers(txtName.Text, txtCity.Text, drpSelectCompany.SelectedItem.Text);
            dt = ConvertTable.ToDataTable <Customer>(ilistCustomer);
            bindCustomerMaster(dt);
            txtName.Visible = true;
            txtCity.Visible = true;
            lblName.Visible = true;
            lblCity.Visible = true;
            btnGo.Visible   = true;
            //Added by Jyothi
            btnExport.Visible = true;
            break;

        case "Detention Setup":
            Detention_Setups        DetentionSetup      = new Detention_Setups();
            IList <Detention_Setup> ilistDetentionSetup = DetentionSetup.GetDetention_Setups(drpSelectCompany.SelectedItem.Text);
            dt = ConvertTable.ToDataTable <Detention_Setup>(ilistDetentionSetup);
            bindDetentionSetup(dt);
            break;

        case "In-Transit Duration":
            Transit_Durations        Transit_Duration     = new Transit_Durations();
            IList <Transit_Duration> ilistTransitDuration = Transit_Duration.GetTransit_Durations(drpSelectCompany.SelectedItem.Text);
            dt = ConvertTable.ToDataTable <Transit_Duration>(ilistTransitDuration);
            bindInTransitDuration(dt);

            break;


        case "Item Master":
            Items        item      = new Items();
            IList <Item> ilistItem = item.GetItems(drpSelectCompany.SelectedItem.Text);
            dt = ConvertTable.ToDataTable <Item>(ilistItem);
            bindItemMaster(dt);
            break;

        case "Location Master":
            Locations        location      = new Locations();
            IList <Location> ilistLocation = location.GetLocations(txtName.Text, txtCode.Text, txtCity.Text, drpSelectCompany.SelectedItem.Text);
            dt = ConvertTable.ToDataTable <Location>(ilistLocation);
            txtName.Visible = true;
            txtCode.Visible = true;
            txtCity.Visible = true;
            lblCity.Visible = true;
            lblCode.Visible = true;
            lblName.Visible = true;
            btnGo.Visible   = true;
            //Added by Jyothi
            btnExport.Visible = true;
            break;

        case "Payment Discount Scheme":
            Payment_Discount_Schemes        paymentDiscountScheme = new Payment_Discount_Schemes();
            IList <Payment_Discount_Scheme> ilistPaymentDisScheme = paymentDiscountScheme.GetPayment_Discount_Schemes(txtCode.Text, drpSelectCompany.SelectedItem.Text);
            dt = ConvertTable.ToDataTable <Payment_Discount_Scheme>(ilistPaymentDisScheme);
            bindPaymentDiscountScheme(dt);
            txtCode.Visible = true;
            lblCode.Visible = true;
            btnGo.Visible   = true;
            //Added by Jyothi
            btnExport.Visible = true;
            break;

        case "Penalty Reason Code":
            Penalty_Reason_Codes        penaltyReasonCode      = new Penalty_Reason_Codes();
            IList <Penalty_Reason_Code> ilistPenaltyreasonCode = penaltyReasonCode.GetPenalty_Reason_Codes(txtCode.Text, drpSelectCompany.SelectedItem.Text);
            dt = ConvertTable.ToDataTable <Penalty_Reason_Code>(ilistPenaltyreasonCode);
            bindPaneltyReasonCode(dt);
            txtCode.Visible = true;
            lblCode.Visible = true;
            btnGo.Visible   = true;
            //Added by Jyothi
            btnExport.Visible = true;
            break;

        case "Placement Setup":
            Placement_Setups        placement           = new Placement_Setups();
            IList <Placement_Setup> ilistPlacementSetup = placement.GetPlacement_Setups(drpSelectCompany.SelectedItem.Text);
            dt = ConvertTable.ToDataTable <Placement_Setup>(ilistPlacementSetup);
            bindPlacementSetup(dt);
            break;

        case "Rejection Reason Code":
            Rejection_Reason_Codes        rejectionReasonCode      = new Rejection_Reason_Codes();
            IList <Rejection_Reason_Code> ilistRejectionReasonCode = rejectionReasonCode.GetRejection_Reason_Codes(txtCode.Text, drpSelectCompany.SelectedItem.Text);
            dt = ConvertTable.ToDataTable <Rejection_Reason_Code>(ilistRejectionReasonCode);
            bindRejectionReasonCode(dt);
            txtCode.Visible = true;
            lblCode.Visible = true;
            btnGo.Visible   = true;
            //Added by Jyothi
            btnExport.Visible = true;
            break;

        case "Freight Master":
            Shipping_Agent_Purch_PriceINs        shippingAgent = new Shipping_Agent_Purch_PriceINs();
            IList <Shipping_Agent_Purch_PriceIN> ilistShipping_Agent_Purch_PriceIN = shippingAgent.GetShipping_Agent_Purch_PriceINs(drpSelectCompany.SelectedItem.Text);
            dt = ConvertTable.ToDataTable <Shipping_Agent_Purch_PriceIN>(ilistShipping_Agent_Purch_PriceIN);
            bindFreightMaster(dt);
            break;

        case "SKU Master":
            SKU_Masters skuMaster = new SKU_Masters();

            IList <SKU_Master> ilistSKU_Master = skuMaster.GetSKU_Masters(txtName.Text, txtCode.Text, drpSelectCompany.SelectedItem.Text);
            dt = ConvertTable.ToDataTable <SKU_Master>(ilistSKU_Master);
            bindSKUMaster(dt);
            txtCode.Visible = true;
            txtName.Visible = true;
            lblCode.Visible = true;
            lblName.Visible = true;
            btnGo.Visible   = true;
            //Added by Jyothi
            btnExport.Visible = true;
            break;

        case "Transit Loss Charges":
            Transit_Loss_Chargess        transitLossCharge          = new Transit_Loss_Chargess();
            IList <Transit_Loss_Charges> ilistTransit_Loss_Chargess = transitLossCharge.GetTransit_Loss_Chargess(drpSelectCompany.SelectedItem.Text);
            dt = ConvertTable.ToDataTable <Transit_Loss_Charges>(ilistTransit_Loss_Chargess);
            bindTransitLossCharge(dt);
            break;

        case "Unit of Measure":
            Unit_of_Measures        unitMeasure          = new Unit_of_Measures();
            IList <Unit_of_Measure> ilistUnit_of_Measure = unitMeasure.GetUnit_of_Measures(txtCode.Text, drpSelectCompany.SelectedItem.Text);
            dt = ConvertTable.ToDataTable <Unit_of_Measure>(ilistUnit_of_Measure);
            bindUnitOfMeasure(dt);
            txtCode.Visible = true;
            lblCode.Visible = true;
            btnGo.Visible   = true;
            //Added by Jyothi
            btnExport.Visible = true;
            break;

        case "User Transporter Mapping":
            User_Transporter_Mappings        userTransporterMapping        = new User_Transporter_Mappings();
            IList <User_Transporter_Mapping> ilistUser_Transporter_Mapping = userTransporterMapping.GetUser_Transporter_Mappings(drpSelectCompany.SelectedItem.Text);
            dt = ConvertTable.ToDataTable <User_Transporter_Mapping>(ilistUser_Transporter_Mapping);
            bindUserTransporterMapping(dt);
            break;

        case "Vendor":
            Vendors        Vendor      = new Vendors();
            IList <Vendor> ilistVendor = Vendor.GetVendors(txtName.Text, txtCity.Text, drpSelectCompany.SelectedItem.Text);
            dt = ConvertTable.ToDataTable <Vendor>(ilistVendor);
            bindVendor(dt);
            txtName.Visible = true;
            txtCity.Visible = true;
            lblName.Visible = true;
            lblCity.Visible = true;
            btnGo.Visible   = true;
            //Added by Jyothi
            btnExport.Visible = true;
            break;

        case "Whse Shipping Truck IN":
            Whse_Shipping_Truck_INs        whseShippingTruck         = new Whse_Shipping_Truck_INs();
            IList <Whse_Shipping_Truck_IN> ilistWhseShippingTruck_IN = whseShippingTruck.GetWhse_Shipping_Truck_INs(txtCode.Text, drpSelectCompany.SelectedItem.Text);
            dt = ConvertTable.ToDataTable <Whse_Shipping_Truck_IN>(ilistWhseShippingTruck_IN);
            bindWhseShippingTruckIN(dt);
            txtCode.Visible = true;
            lblCode.Visible = true;
            btnGo.Visible   = true;
            //Added by Jyothi
            btnExport.Visible = true;
            break;

        case "User":
            Users        user       = new Users();
            IList <User> ilistUsers = user.GetUsers();
            dt = ConvertTable.ToDataTable <User>(ilistUsers);
            bindUser(dt);
            break;

        default:
            break;
        }
    }