System.Data.DataTable ServiceInsuranceList; <pre lang="cs"><pre lang="cs">private void BtnSave_Click(object sender, EventArgs e) { int ServiceID = Convert.ToInt32(CmbService.SelectedValue); int InsuranceId = Convert.ToInt32(CmbInsurance.SelectedValue); if (ServiceInsuranceList == null) { ServiceInsuranceList = new System.Data.DataTable(); ServiceInsuranceList = HLP.Business.Object.Services.ServiseInsuranceList(InsuranceId, ServiceID); GrdServiceInsurance.DataSource = ServiceInsuranceList; } else { ServiceInsuranceList.NewRow(); ServiceInsuranceList.AcceptChanges(); ServiceInsuranceList = HLP.Business.Object.Services.ServiseInsuranceList(InsuranceId, ServiceID); if (ServiceInsuranceList != null) GrdServiceInsurance.DataSource = ServiceInsuranceList; } }</pre></pre>
public static DataTable ServiseInsuranceList(int InsuranceID, int ServiceID) { DataTable PoseDataTable = new DataTable(); SqlCommand Command = HLP.Data.DataProvider.GenerateCommand("Clinic_ServiceInsuranceList", CommandType.StoredProcedure); Command.Parameters.AddWithValue("@InsuranceID", InsuranceID); Command.Parameters.AddWithValue("@ServiceID", ServiceID); try { Command.Connection.Open(); Command.ExecuteNonQuery(); PoseDataTable = HLP.Data.DataProvider.GenerateDataTable(Command, CommandType.StoredProcedure); } catch (Exception ex) { } finally { HLP.Data.DataProvider.DisposeCommand(Command); } return PoseDataTable; }
ALTER PROC [dbo].[Clinic_ServiceInsuranceList] @ServiceID INT , @InsuranceID INT as BEGIN SELECT Service.Title, Service.Code, ActCostService.Cost, InsuranceServiceCost.Cost AS Expr1, InsuraceCost.InsuraceID FROM InsuraceCost INNER JOIN InsuranceServiceCost ON InsuraceCost.ID = InsuranceServiceCost.InsuraceCostID LEFT OUTER JOIN Service ON InsuranceServiceCost.ServiceID = Service.ID FULL OUTER JOIN ActCostService ON Service.ID = ActCostService.ServiceID where dbo.Service.ID=@ServiceID and dbo.InsuraceCost.InsuraceID=@InsuranceID end
where dbo.Service.ID=@ServiceID and dbo.InsuraceCost.InsuraceID=@InsuranceID
where
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)