public static void LoadCost(this DropDownList ddl, int CompanyId) { DataTable dt = CostCenter.LoadCostCenter(); ddl.Items.Clear(); ddl.Items.Add(new ListItem("--select--", "0")); if (dt != null) { foreach (DataRow item in dt.Rows) { ddl.Items.Add(new ListItem(item["name"].ToString(), item["id"].ToString())); } } }
public HttpResponseMessage GeCostCenter([FromBody] int CompanyId) { return(Request.CreateResponse(HttpStatusCode.OK, CostCenter.LoadCostCenter())); }