public ActionResult Index() { List <Item_Model> item_list = new List <Item_Model>(); dict.Clear(); dict.Add("@mode", "Getall_Items"); DataTable dt = common_class.return_datatable(dict, "proc_item"); int j = dt.Rows.Count; if (j > 0) { for (int i = 0; i < j; i++) { Item_Model item = new Item_Model(); item.id = Convert.ToInt32(dt.Rows[i]["id"].ToString()); item.Item_id = dt.Rows[i]["item_id"].ToString(); item.item_name = dt.Rows[i]["Item_Name"].ToString(); item.category = dt.Rows[i]["category"].ToString(); item.sub_category = dt.Rows[i]["Sub_category"].ToString(); item.UOM = dt.Rows[i]["Uom"].ToString(); item.UOM_value = Convert.ToInt32(dt.Rows[i]["Uom_value"].ToString()); item.rate = Convert.ToDouble(dt.Rows[i]["rate"].ToString()); item.Scheme_values = Convert.ToInt32(dt.Rows[i]["Scheme_value"].ToString()); item.scheme_qty = Convert.ToInt32(dt.Rows[i]["Scheme_Quantity"].ToString()); item.gst = Convert.ToInt32(dt.Rows[i]["Gst"].ToString()); item_list.Add(item); } } ViewBag.get_item = item_list; return(View()); }
// GET: Employee public ActionResult Index() { List <Employees_Modal> employee = new List <Employees_Modal>(); dict.Clear(); dict.Add("@mode", "Get_all_Emp"); global_dt = commonClass.return_datatable(dict, "proc_employee"); int j = global_dt.Rows.Count; if (j > 0) { for (int i = 0; i < j; i++) { Employees_Modal emp = new Employees_Modal(); emp.id = Convert.ToInt32(global_dt.Rows[i]["id"].ToString()); emp.fullName = global_dt.Rows[i]["fullName"].ToString(); emp.gender = global_dt.Rows[i]["gender"].ToString(); emp.dob = global_dt.Rows[i]["dob"].ToString(); emp.mobile = global_dt.Rows[i]["mobile"].ToString(); emp.email = global_dt.Rows[i]["email"].ToString(); emp.address = global_dt.Rows[i]["address"].ToString(); emp.area = global_dt.Rows[i]["area"].ToString(); emp.state = global_dt.Rows[i]["state"].ToString(); emp.Security = global_dt.Rows[i]["Security"].ToString(); emp.pincode = global_dt.Rows[i]["pincode"].ToString(); emp.userName = global_dt.Rows[i]["userName"].ToString(); emp.password = global_dt.Rows[i]["password"].ToString(); emp.role = global_dt.Rows[i]["role"].ToString(); employee.Add(emp); } ViewBag.count = employee.Count; ViewBag.get_employee = employee; } return(View(employee)); }
// [HttpGet] public ActionResult Edit(int id) { #region return State and Role dict.Clear(); dict.Add("@mode", "get_all_zone"); DataSet ds = common_class.return_dataset(dict, "proc_Area"); List <state> list_state = new List <state>(); List <Role> list_role = new List <Role>(); int count_zone = ds.Tables[0].Rows.Count; int count_state = ds.Tables[1].Rows.Count; if (count_state > 0) { for (int i = 0; i < count_state; i++) { state s = new state(); s.Id = Convert.ToInt32(ds.Tables[1].Rows[i]["id"].ToString()); s.State = ds.Tables[1].Rows[i]["state"].ToString(); list_state.Add(s); } if (count_zone > 0) { for (int i = 0; i < count_zone; i++) { Role r = new Role(); r.Id = Convert.ToInt32(ds.Tables[0].Rows[i]["id"].ToString()); r.role = ds.Tables[0].Rows[i]["Zone"].ToString(); list_role.Add(r); } } ViewBag.getzone = list_role; ViewBag.getstate = list_state; } #endregion id = 1; // dict.Clear(); dict.Add("@id", id); dict.Add("@mode", "getAll_Area_ByID"); DataTable dt = common_class.return_datatable(dict, "proc_Area"); Area area = new Area(); if (dt.Rows.Count > 0) { area.id = Convert.ToInt32(dt.Rows[0]["id"].ToString()); area.Area_Name = dt.Rows[0]["Area_name"].ToString(); area.Zone_id = dt.Rows[0]["Zone"].ToString(); area.State_id = dt.Rows[0]["state"].ToString(); area.pincode = Convert.ToInt32(dt.Rows[0]["Pincode"].ToString()); } ViewBag.Edit_Area = area; return(View(area)); }
public ActionResult Emp_Login(string Username, string Password) { if (Username != null && Password != null) { Session["user_name"] = Username.ToString(); Session["Passsword"] = Password.ToString(); dict.Clear(); dict.Add("@UserName", Username); dict.Add("@Password", Password); } else { dict.Clear(); dict.Add("@UserName", Session["user_name"].ToString()); dict.Add("@Password", Session["Passsword"].ToString()); } dict.Add("@mode", "Emp_login"); DataTable dt = common_Class.return_datatable(dict, "proc_employee"); int j = Convert.ToInt32(dt.Rows.Count); List <MenuMaster> menu_list = new List <MenuMaster>(); menu_list.Clear(); if (j > 0) { for (int i = 0; i <= j - 1; i++) { MenuMaster menu = new MenuMaster(); menu.NodeID = Convert.ToInt32(dt.Rows[i]["nodeId"].ToString()); menu.ParentID = Convert.ToInt32(dt.Rows[i]["parentId"].ToString()); menu.NodeName = dt.Rows[i]["nodeName"].ToString(); menu.destination = dt.Rows[i]["destination"].ToString(); menu_list.Add(menu); } ViewBag.MenuList = menu_list; Session["Permission"] = menu_list; return(View(menu_list)); } else { return(JavaScript("\"Check User Name And Password\"")); } }