public static List <contact> GetDepartment(object objReq) { iProductMasterClient productClient = new iProductMasterClient(); CustomProfile profile = CustomProfile.GetProfile(); DataSet ds = new DataSet(); DataTable dt = new DataTable(); List <contact> LocList = new List <contact>(); try { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary = (Dictionary <string, object>)objReq; //ds = ReceivableClient.GetProdLocations(ProdCode.Trim()); long ddlcompanyId = long.Parse(dictionary["ddlcompanyId"].ToString()); /*Add By Suresh For Selected Department List Show */ iUCCommonFilterClient UCCommonFilter = new iUCCommonFilterClient(); //SiteLst = UCCommonFilter.GetAddedDepartmentList(int.Parse(ddlcompanyId.ToString()), profile.Personal.UserID, profile.DBConnection._constr).ToList(); /* Add By Suresh For Selected Department List Show */ if (profile.Personal.UserType == "Admin") { ds = UCCommonFilter.GetAddedDepartmentListDS(int.Parse(ddlcompanyId.ToString()), profile.Personal.UserID, profile.DBConnection._constr); } else { ds = productClient.GetDepartment(ddlcompanyId, profile.DBConnection._constr); } dt = ds.Tables[0]; contact Loc = new contact(); Loc.Name = "Select Department"; Loc.Id = "0"; LocList.Add(Loc); Loc = new contact(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { Loc.Id = dt.Rows[i]["ID"].ToString(); Loc.Name = dt.Rows[i]["Territory"].ToString(); LocList.Add(Loc); Loc = new contact(); } } } catch { } finally { productClient.Close(); } return(LocList); }
public static List <contact> GetDepartment(object objReq) { iProductMasterClient productClient = new iProductMasterClient(); CustomProfile profile = CustomProfile.GetProfile(); DataSet ds = new DataSet(); DataTable dt = new DataTable(); List <contact> LocList = new List <contact>(); try { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary = (Dictionary <string, object>)objReq; //ds = ReceivableClient.GetProdLocations(ProdCode.Trim()); long ddlcompanyId = long.Parse(dictionary["ddlcompanyId"].ToString()); ds = productClient.GetDepartment(ddlcompanyId, profile.DBConnection._constr); dt = ds.Tables[0]; contact Loc = new contact(); Loc.Name = "Select Department"; Loc.Id = "0"; LocList.Add(Loc); Loc = new contact(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { Loc.Id = dt.Rows[i]["ID"].ToString(); Loc.Name = dt.Rows[i]["Territory"].ToString(); LocList.Add(Loc); Loc = new contact(); } } } catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, "Role Master", "GetDepartment"); } finally { productClient.Close(); } return(LocList); }
public void getDepartment(long Companyid) { DataSet ds; CustomProfile profile = CustomProfile.GetProfile(); iProductMasterClient productClient = new iProductMasterClient(); ds = productClient.GetDepartment(Companyid, profile.DBConnection._constr); ddldepartment.DataSource = ds; ddldepartment.DataTextField = "Territory"; ddldepartment.DataValueField = "ID"; ddldepartment.DataBind(); ListItem lst = new ListItem { Text = "-Select-", Value = "0" }; ddldepartment.Items.Insert(0, lst); }