예제 #1
0
        public ActionResult item_company(itemcompanymodel obj, string Add, string Delete)
        {
            if (ModelState.IsValid)
            {
                item_company oo = new item_company(); ////object of model

                oo.item_company_name = obj.item_company_name;


                using (ebmsEntities abj = new ebmsEntities())  ///object of entities
                {
                    if (!string.IsNullOrEmpty(Add))
                    {
                        string item_company_code = objcommon.read_item_company_code();

                        oo.item_company_id   = item_company_code;
                        oo.item_company_name = obj.item_company_name;

                        abj.item_company.Add(oo);
                        abj.SaveChanges();

                        objcommon.update_item_company_code();
                    }

                    if (!string.IsNullOrEmpty(Delete))
                    {
                    }
                }
            }
            return(View());
        }
예제 #2
0
        public ActionResult item_group(itemgroupmodel obj, string Add, string Delete)
        {
            if (ModelState.IsValid)
            {
                using (ebmsEntities abj = new ebmsEntities())
                {
                    if (!string.IsNullOrEmpty(Add))
                    {
                        item_group oo = new item_group();

                        string item_group_code = objcommon.read_item_group_code();

                        oo.item_group_id   = item_group_code;
                        oo.item_group_name = obj.item_group_name;

                        abj.item_group.Add(oo);
                        abj.SaveChanges();                  //// ADD ITEM COMPANY RECORD

                        objcommon.update_item_group_code(); //// UPDATE ITEM COMPANY CODE

                        ModelState.Clear();
                    }
                    if (!string.IsNullOrEmpty(Delete))
                    {
                    }
                }
            }

            return(View());
        }
예제 #3
0
        public ActionResult material_centre_list()
        {
            //try
            //{
            using (ebmsEntities abj = new ebmsEntities())
            {
                List <item_material_centre> ob = (from x in abj.item_material_centre select x).ToList();

                List <materialcentremodel> l = new List <materialcentremodel>();

                foreach (item_material_centre temp in ob)
                {
                    materialcentremodel t = new materialcentremodel();
                    t.material_centre_id      = temp.material_centre_id;
                    t.material_centre_address = temp.material_centre_address;
                    t.material_centre_name    = temp.material_centre_name;
                    t.material_centre_type    = temp.material_centre_type;

                    l.Add(t);
                }

                return(View(l));
            }

            /* }
             * catch(Exception ex)
             * {
             *   Response.Write(ex);
             * }
             *
             * return View();*/
        }
예제 #4
0
        public ActionResult state_list()
        {
            using (ebmsEntities o = new ebmsEntities())
            {
                var obj = (from x in o.state_list select x).ToList();

                return(View(obj));
            }
        }
예제 #5
0
        public ActionResult item_company()
        {
            using (ebmsEntities abj = new ebmsEntities())
            {
                TempData["company_list"] = objcommon.fill_item_company();
            }

            return(View());
        }
예제 #6
0
        public ActionResult material_centre(materialcentremodel obj, string Add)
        {
            if (ModelState.IsValid)
            {
                using (ebmsEntities abj = new ebmsEntities())
                {
                    item_material_centre oo = new item_material_centre();

                    oo.material_centre_name    = obj.material_centre_name.ToString();
                    oo.material_centre_type    = obj.material_centre_type.ToString();
                    oo.material_centre_address = obj.material_centre_address.ToString();

                    objcommon.Add_material_centre_detail(oo);

                    ViewBag.status = "Successfully Add";

                    ModelState.Clear();
                }
            }
            return(View());
        }
예제 #7
0
        public ActionResult state(statelistmodel obj, string Add, string Delete)
        {
            if (ModelState.IsValid)
            {
                using (ebmsEntities abj = new ebmsEntities())
                {
                    state_list oo = new state_list();

                    oo.state_code = obj.state_code.ToString();
                    oo.state_name = obj.state_name.ToString();

                    string state_code = objcommon.read_state_code();

                    oo.state_id = state_code.ToString();

                    bool res = objcommon.check_state_exist(oo.state_code, oo.state_name);

                    if (res == false)
                    {
                        abj.state_list.Add(oo);

                        abj.SaveChanges();

                        objcommon.update_statelist_code();


                        ViewBag.message = "Record Saved Successfully!!!!!";

                        ModelState.Clear();
                    }
                    else
                    {
                        ViewBag.message = "Duplicate Recod Found!!!!!";
                    }
                }
            }

            return(View());
        }