private void BindData(DbObject dbobj) { DataSet dsobj = new DataSet(); SqlParameter[] parameters2 = { new SqlParameter("@OrgId",SqlDbType.Int,4,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,OrgId), }; dsobj=dbobj.dsRunProcedure("sp_SelectEquipAltLists",parameters2,"Lists"); ddStatusId.DataSource = dsobj; ddStatusId.DataMember = "Lists"; ddStatusId.DataValueField = "id"; ddStatusId.DataTextField = "vchName"; ddStatusId.DataBind(); ddPMScheduleId.DataSource = dsobj; ddPMScheduleId.DataMember = "Lists1"; ddPMScheduleId.DataValueField = "id"; ddPMScheduleId.DataTextField = "vchName"; ddPMScheduleId.DataBind(); ddPMScheduleId.Items.Insert(0,""); ddInspectionId.DataSource = dsobj; ddInspectionId.DataMember = "Lists2"; ddInspectionId.DataValueField = "id"; ddInspectionId.DataTextField = "vchName"; ddInspectionId.DataBind(); ddInspectionId.Items.Insert(0,""); }
private void BindData(DbObject dbobj) { DataSet dsobj = new DataSet(); SqlParameter[] parameters2 = { new SqlParameter("@OrgId",SqlDbType.Int) }; parameters2[0].Value = OrgId; dsobj=dbobj.dsRunProcedure("sp_SelectEquipTypesMakesModels",parameters2,"Types"); dsobj.Relations.Add( new DataRelation( "Types_Makes", dsobj.Tables["Types"].Columns["Id"], dsobj.Tables["Types1"].Columns["TypeId"] ) ); dsobj.Relations.Add( new DataRelation( "Makes_Models", dsobj.Tables["Types1"].Columns["Id"], dsobj.Tables["Types2"].Columns["MakeId"] ) ); ddTypeId.DataSource = dsobj; ddTypeId.DataMember = "Types"; ddTypeId.DataValueField = "id"; ddTypeId.DataTextField = "vchName"; ddTypeId.DataBind(); ddTypeId.Items.Insert(0,""); ddMakeId.DataSource = dsobj; ddMakeId.DataMember = "Types1"; ddMakeId.DataValueField = "id"; ddMakeId.DataTextField = "vchMakeName"; ddMakeId.DataBind(); ddMakeId.Items.Insert(0,""); ddModelId.DataSource = dsobj; ddModelId.DataMember = "Types2"; ddModelId.DataValueField = "id"; ddModelId.DataTextField = "vchModelName"; ddModelId.DataBind(); ddModelId.Items.Insert(0,""); ddDeptId.DataSource = dsobj; ddDeptId.DataMember = "Types3"; ddDeptId.DataValueField = "id"; ddDeptId.DataTextField = "vchName"; ddDeptId.DataBind(); ddDeptId.Items.Insert(0,""); ddLocationId.DataSource = dsobj; ddLocationId.DataMember = "Types4"; ddLocationId.DataValueField = "id"; ddLocationId.DataTextField = "vchName"; ddLocationId.DataBind(); ddLocationId.Items.Insert(0,""); ListLink1.DataBind(); ListLink2.DataBind(); }
private void LoadData() { int returnValue; SqlCommand cmd; SqlParameter[] parameters = { new SqlParameter("@OrgId",SqlDbType.Int,4,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,OrgId), new SqlParameter("@Id",SqlDbType.Int,4,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,EquipId), new SqlParameter("@vchEquipId",SqlDbType.Int,4,ParameterDirection.Output,false,0,0,null,DataRowVersion.Default,null), new SqlParameter("@intYear",SqlDbType.Int,4,ParameterDirection.Output,false,0,0,null,DataRowVersion.Default,null), new SqlParameter("@vchType",SqlDbType.VarChar,50,ParameterDirection.Output,false,0,0,null,DataRowVersion.Default,null), new SqlParameter("@vchMake",SqlDbType.VarChar,50,ParameterDirection.Output,false,0,0,null,DataRowVersion.Default,null), new SqlParameter("@vchModel",SqlDbType.VarChar,50,ParameterDirection.Output,false,0,0,null,DataRowVersion.Default,null), new SqlParameter("@vchAssignedTo",SqlDbType.VarChar,100,ParameterDirection.Output,false,0,0,null,DataRowVersion.Default,null) }; DbObject dbobj = new DbObject(); cmd = dbobj.cmdRunProcedure("sp_SelectEquipView",parameters,out returnValue); if(returnValue!=-1) { lbEquipId.Text=cmd.Parameters["@vchEquipId"].Value.ToString(); lbTypeMakeModel.Text=cmd.Parameters["@vchType"].Value.ToString()+"/"+cmd.Parameters["@vchMake"].Value.ToString()+"/"+cmd.Parameters["@vchModel"].Value.ToString(); lbYear.Text=cmd.Parameters["@intYear"].Value.ToString(); lbAssignFrom.Text=cmd.Parameters["@vchAssignedTo"].Value.ToString(); } SqlParameter[] parameters2 = { new SqlParameter("@OrgId",SqlDbType.Int,4,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,OrgId), new SqlParameter("@EquipId",SqlDbType.Int,4,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,EquipId) }; DataSet dsobj=dbobj.dsRunProcedure("sp_SelectEquipAssignTo",parameters2,"Names"); ddAssignTo.DataSource = dsobj; ddAssignTo.DataMember = "Names"; ddAssignTo.DataValueField = "id"; ddAssignTo.DataTextField = "vchName"; ddAssignTo.DataBind(); ddAssignTo.Items.Insert(0,new System.Web.UI.WebControls.ListItem("","0")); }