protected void btnSave_Click(object sender, EventArgs e) { if (((DataTable)Session["GridData"]).Rows.Count < 1) { IQCareMsgBox.Show("PharmacyNoData", this); return; } int Ptn_pk = 0, ARTSponsorID, UserId, LocationID, DeleteFlag, Visit_pk; DateTime DateEffective; PatientClassificationMgr = (IPatientClassification)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientClassification, BusinessProcess.Clinical"); DataTable theDT = (DataTable)Session["GridData"]; foreach (DataRow theDR in theDT.Rows) { IQCareUtils theUtils = new IQCareUtils(); Ptn_pk = Convert.ToInt32(Session["Ptn_Pk"]); ARTSponsorID = Convert.ToInt32(theDR["ARTSponsorID"]); UserId = Convert.ToInt32(Session["AppUserId"]); LocationID = Convert.ToInt32(Session["AppLocationId"]); DeleteFlag = 0; DateEffective = Convert.ToDateTime(theDR["VisitDate"]); Visit_pk = Convert.ToInt32(theDR["Visit_pk"]); PatientClassificationMgr.SaveUpdatePatientClassification(Ptn_pk, LocationID, Visit_pk, ARTSponsorID, UserId, DateEffective, DeleteFlag); DataSet theDS = PatientClassificationMgr.GetAllPatientClassificationData(Convert.ToInt32(Session["Ptn_Pk"])); Session["GridData"] = theDS.Tables[0]; theDT = (DataTable)Session["GridData"]; } ClearSession(); SaveCancel(); }
public void BindClassification() { BindFunctions BindManager = new BindFunctions(); PatientClassificationMgr = (IPatientClassification)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientClassification, BusinessProcess.Clinical"); DataSet dsPatientClassification = PatientClassificationMgr.GetClassification(Convert.ToInt32(Session["SystemId"])); BindManager.BindCombo(ddlclassification, dsPatientClassification.Tables[0], "Name", "Id"); }
protected void grdPClassification_RowDeleting(object sender, GridViewDeleteEventArgs e) { System.Data.DataTable theDT = new System.Data.DataTable(); theDT = ((DataTable)Session["GridData"]); int theRow = Convert.ToInt32(e.RowIndex); PatientClassificationMgr = (IPatientClassification)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientClassification, BusinessProcess.Clinical"); PatientClassificationMgr.DeletePatientClassification(Convert.ToInt32(Session["Ptn_Pk"]), Convert.ToInt32(ViewState["ARTSponsorID"]), Convert.ToDateTime(ViewState["VisitDate"])); theDT.Rows[theRow].Delete(); theDT.AcceptChanges(); Session["GridData"] = theDT; grdPClassification.Columns.Clear(); grdPClassification.DataSource = (DataTable)Session["GridData"]; BindGrid(); IQCareMsgBox.Show("DeleteSuccess", this); Refresh(); btnadd.Text = "Add"; }
private void GetAllData() { PatientClassificationMgr = (IPatientClassification)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientClassification, BusinessProcess.Clinical"); if (Session["Ptn_Pk"].ToString() != "0") { DataSet theDS = PatientClassificationMgr.GetAllPatientClassificationData(Convert.ToInt32(Session["Ptn_Pk"])); DataTable theDT = theDS.Tables[0].Copy(); DataColumn[] thePKey = new DataColumn[3]; thePKey.SetValue(theDT.Columns["Ptn_PK"], 0); thePKey.SetValue(theDT.Columns["ARTSponsorId"], 1); thePKey.SetValue(theDT.Columns["VisitDate"], 2); theDT.PrimaryKey = thePKey; Session["GridData"] = theDT; /// theDS.Tables[0]; grdPClassification.DataSource = (DataTable)Session["GridData"]; BindGrid(); } }