private void btnSubmit_Click(object sender, EventArgs e) { objTechArea = (IHomePageConfiguration)ObjectFactory.CreateInstance("BusinessProcess.FormBuilder.BHomePageConfiguration,BusinessProcess.FormBuilder"); string strParse = rtbQuery.Text.Trim().ToString().ToUpper(); // string strParse = (string)objTechArea.ParseSQLColoumns(rtbQuery.Text.Trim().ToString()); if (strParse.Contains("@PatientId".ToUpper())) { strParse = strParse.Replace("@PatientId".ToUpper(), "0"); } //else //{ // IQCareWindowMsgBox.ShowWindow("ParameterPatientId", this); // return; //} strParse = (string)objTechArea.ParseSQLColoumns(strParse); if (strParse == "Valid Value" || strParse == "No Records") { string sqlstr = rtbQuery.Text; char[] charsToTrim = { ';' }; sqlstr = sqlstr.TrimEnd(charsToTrim); GblIQCare.Query = sqlstr.ToString(); this.Close(); } else { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = strParse.ToString(); IQCareWindowMsgBox.ShowWindow("#C1", theBuilder, this); return; } }
private void frmHomePageList_Load(object sender, EventArgs e) { DataSet dsTechAreaDetails = new DataSet(); try { //set css begin clsCssStyle theStyle = new clsCssStyle(); theStyle.setStyle(this); //set css end cmbFormStatus.SelectedIndex = 2; objTechArea = (IHomePageConfiguration)ObjectFactory.CreateInstance("BusinessProcess.FormBuilder.BHomePageConfiguration,BusinessProcess.FormBuilder"); dsTechAreaDetails = objTechArea.GetTechnicalArea(); DataTable dt; dt = dsTechAreaDetails.Tables[1]; DataRow drAddSelect; drAddSelect = dt.NewRow(); drAddSelect["ModuleName"] = "All"; drAddSelect["ModuleID"] = 0; dt.Rows.InsertAt(drAddSelect, 0); BindFunctions theBind = new BindFunctions(); theBind.Win_BindCombo(cmbTechnicalArea1, dt, "ModuleName", "ModuleId"); cmbFormStatus.SelectedIndex = 0; BindGrid(); } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareWindowMsgBox.ShowWindow("#C1", theBuilder, this); } }
private void dgwFormDetails_CellClick(object sender, DataGridViewCellEventArgs e) { try { if (e.ColumnIndex == -1) { return; } DialogResult strResult = DialogResult.None; IHomePageConfiguration objTechArea; MsgBuilder theBuilder = new MsgBuilder(); if (dgwFormDetails.Columns[e.ColumnIndex].HeaderText == "Published") { if (Convert.ToString(dgwFormDetails.Rows[e.RowIndex].Cells[4].Value) == "Published") { theBuilder.DataElements["PgStatus"] = "UnPublish"; } else { theBuilder.DataElements["PgStatus"] = "Publish"; } strResult = IQCareWindowMsgBox.ShowWindowConfirm("Publish", theBuilder, this); if (Convert.ToString(dgwFormDetails.Rows[e.RowIndex].Cells[4].Value) == "Published") { if (strResult == DialogResult.No) { return; } Hashtable theHT = new Hashtable(); theHT.Add("Status", "1"); theHT.Add("FeatureID", dgwFormDetails.Rows[e.RowIndex].Cells[5].Value); DataTable theDT = new DataTable(); objTechArea = (IHomePageConfiguration)ObjectFactory.CreateInstance("BusinessProcess.FormBuilder.BHomePageConfiguration, BusinessProcess.FormBuilder"); Int32 intExistModuleId = objTechArea.StatusUpdate(theHT); BindGrid(); } else if (Convert.ToString(dgwFormDetails.Rows[e.RowIndex].Cells[4].Value) == "Un-Published") { if (strResult == DialogResult.No) { return; } Hashtable theHT = new Hashtable(); theHT.Add("Status", "2"); theHT.Add("FeatureID", dgwFormDetails.Rows[e.RowIndex].Cells[5].Value); DataTable theDT = new DataTable(); objTechArea = (IHomePageConfiguration)ObjectFactory.CreateInstance("BusinessProcess.FormBuilder.BHomePageConfiguration, BusinessProcess.FormBuilder"); Int32 intExistModuleId = objTechArea.StatusUpdate(theHT); BindGrid(); } } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareWindowMsgBox.ShowWindowConfirm("#C1", theBuilder, this); } }
private void btnRemove_Click(object sender, EventArgs e) { try { int Row = 0; IHomePageConfiguration objTechArea = (IHomePageConfiguration)ObjectFactory.CreateInstance("BusinessProcess.FormBuilder.BHomePageConfiguration,BusinessProcess.FormBuilder"); if (dgwQueryDetails.Rows.Count <= 1) { return; } else if (dgwQueryDetails.Rows[dgwQueryDetails.CurrentRow.Index].Cells[0].Value == DBNull.Value) { dgwQueryDetails.Rows.Remove(dgwQueryDetails.CurrentRow); } else if (dgwQueryDetails.Rows[dgwQueryDetails.CurrentRow.Index].Cells[0].Value != DBNull.Value) { foreach (DataGridViewRow r in dgwQueryDetails.Rows) { if (r.Cells[2].Selected == true) { string Indicator = Convert.ToString(r.Cells[2].Value); int ID = Convert.ToInt32(r.Cells[0].Value); if (ID != 0) { DialogResult dlgRes; dlgRes = IQCareWindowMsgBox.ShowWindowConfirm("DeleteIndicator", this); if (dlgRes == DialogResult.Yes) { int CheckIndicator = objTechArea.DeleteIndicator(ID, 2); if (CheckIndicator != 0) { Row = objTechArea.DeleteIndicator(ID, 1); } else { IQCareWindowMsgBox.ShowWindow("UnDeleteIndicator", this); } } frmHomePage_Load(sender, e); } } } } else { IQCareWindowMsgBox.ShowWindow("PMTCTNotDeletePredefine", this); } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareWindowMsgBox.ShowWindow("#C1", theBuilder, this); return; } }
private void BindGrid() { DataSet dsQueryIndicaterDetails = new DataSet(); try { int intModuleID = 0; int intPublished = -1; string strPublished = ""; if (cmbTechnicalArea1.SelectedIndex != 0) { intModuleID = Convert.ToInt32(cmbTechnicalArea1.SelectedValue); } if (cmbFormStatus.SelectedIndex != -1) { strPublished = cmbFormStatus.SelectedItem.ToString(); } if (strPublished == "All") { intPublished = -1; } else if (strPublished == "Published") { intPublished = 2; } else if (strPublished == "Un-Published") { intPublished = 1; } objTechArea = (IHomePageConfiguration)ObjectFactory.CreateInstance("BusinessProcess.FormBuilder.BHomePageConfiguration,BusinessProcess.FormBuilder"); dsQueryIndicaterDetails = objTechArea.GetHomePageIndicatorQuery(intModuleID, intPublished); dgwFormDetails.DataSource = null; if (dsQueryIndicaterDetails.Tables[0].Rows.Count > 0) { string strGetPath = GblIQCare.GetPath(); ShowGrid(dsQueryIndicaterDetails.Tables[0]); } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareWindowMsgBox.ShowWindowConfirm("#C1", theBuilder, this); } }
private void btnTestQuery_Click(object sender, EventArgs e) { if (rtbQuery.Text.Trim() == "") { IQCareWindowMsgBox.ShowWindow("BlankQuery", this); return; } try { //objTechArea = (IHomePageConfiguration)ObjectFactory.CreateInstance("BusinessProcess.FormBuilder.BHomePageConfiguration,BusinessProcess.FormBuilder"); string strParse = rtbQuery.Text.Trim().ToString().ToUpper(); if (strParse.Contains("@PatientId".ToUpper())) { strParse = strParse.Replace("@PatientId".ToUpper(), "0"); } //else //{ // IQCareWindowMsgBox.ShowWindow("ParameterPatientId", this); // return; //} objTechArea = (IHomePageConfiguration)ObjectFactory.CreateInstance("BusinessProcess.FormBuilder.BHomePageConfiguration,BusinessProcess.FormBuilder"); //strParse = (string)objTechArea.ParseSQLColoumns(rtbQuery.Text.Trim().ToString()); strParse = (string)objTechArea.ParseSQLColoumns(strParse); if (strParse == "Valid Value" || strParse == "No Records") { IQCareWindowMsgBox.ShowWindow("CheckSyntax", this); return; } else { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = strParse.ToString(); IQCareWindowMsgBox.ShowWindow("#C1", theBuilder, this); return; } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.ToString(); IQCareWindowMsgBox.ShowWindow("#C1", theBuilder, this); return; } finally { objTechArea = null; } }
private void frmHomePage_Load(object sender, EventArgs e) { try { //set css begin clsCssStyle theStyle = new clsCssStyle(); theStyle.setStyle(this); //set css end bCellClick = false; IHomePageConfiguration objTechArea = (IHomePageConfiguration)ObjectFactory.CreateInstance("BusinessProcess.FormBuilder.BHomePageConfiguration,BusinessProcess.FormBuilder"); DataSet dsTechAreaDetails = new DataSet(); dsTechAreaDetails = objTechArea.GetTechnicalArea(); BindFunctions theBind = new BindFunctions(); theBind.Win_BindCombo(cmbTechnicalArea, dsTechAreaDetails.Tables[1], "ModuleName", "ModuleID"); cmbHomePageType.SelectedIndex = 0; DataSet dsIndicatorQuery = new DataSet(); dsIndicatorQuery = objTechArea.GetIndicatorQueryResult(GblIQCare.iHomePageId); if (dsIndicatorQuery.Tables.Count > 1) { if (dsIndicatorQuery.Tables[1].Rows.Count > 0) { txtSectionTitle.Text = dsIndicatorQuery.Tables[1].Rows[0]["FacilityHomeTitle"].ToString(); cmbHomePageType.Text = dsIndicatorQuery.Tables[1].Rows[0]["Feature"].ToString(); cmbTechnicalArea.SelectedValue = dsIndicatorQuery.Tables[1].Rows[0]["Module"].ToString(); ID = Convert.ToInt32(dsIndicatorQuery.Tables[1].Rows[0]["ID"].ToString()); } } DataColumn theColumn = dsIndicatorQuery.Tables[0].Columns["Indicator"]; dsIndicatorQuery.Tables[0].Constraints.Add("Pk", theColumn, true); if (GblIQCare.iHomePageId != 0) { cmbTechnicalArea.Enabled = false; cmbHomePageType.Enabled = false; } BindGrid(dsIndicatorQuery.Tables[0]); } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareWindowMsgBox.ShowWindow("#C1", theBuilder, this); return; } }
private void btnSave_Click(object sender, EventArgs e) { try { if (Validation() == false) { return; } DataTable dtFeature; dtFeature = clsCommon.CreateTableMstFeature(); DataRow theDRFeature; int iFormId; theDRFeature = dtFeature.NewRow(); string FName = cmbHomePageType.Text.Trim() + "-" + cmbTechnicalArea.Text.Trim(); if (GblIQCare.iHomePageId != 0) { iFormId = GblIQCare.iHomePageId; Flag = PMTCTConstants.strUpdate; } else { iFormId = 0; Flag = PMTCTConstants.strInsert; } if (dgwQueryDetails.Rows.Count <= 1) { IQCareWindowMsgBox.ShowWindow("IndicatorMandatory", this); return; } theDRFeature["FeatureId"] = iFormId; theDRFeature["FeatureName"] = cmbHomePageType.Text + "-" + cmbTechnicalArea.Text; theDRFeature["UserId"] = GblIQCare.AppUserId; theDRFeature["ModuleId"] = cmbTechnicalArea.SelectedValue; dtFeature.Rows.Add(theDRFeature); DataTable dtMstHomePage = new DataTable(); DataColumn theDT; theDT = new DataColumn(); theDT.DataType = Type.GetType("System.Int32"); theDT.ColumnName = "Id"; dtMstHomePage.Columns.Add(theDT); theDT = new DataColumn(); theDT.DataType = Type.GetType("System.String"); theDT.ColumnName = "Name"; dtMstHomePage.Columns.Add(theDT); theDT = new DataColumn(); theDT.DataType = Type.GetType("System.Int32"); theDT.ColumnName = "FeatureId"; dtMstHomePage.Columns.Add(theDT); theDT = new DataColumn(); theDT.DataType = Type.GetType("System.Int32"); theDT.ColumnName = "UserId"; dtMstHomePage.Columns.Add(theDT); DataRow theDRHomePage; theDRHomePage = dtMstHomePage.NewRow(); if (GblIQCare.iHomePageId != 0) { theDRHomePage["Id"] = ID; } theDRHomePage["Name"] = txtSectionTitle.Text; theDRHomePage["FeatureId"] = iFormId; theDRHomePage["UserId"] = GblIQCare.AppUserId; dtMstHomePage.Rows.Add(theDRHomePage); DataTable dtlHomePage; dtlHomePage = (DataTable)dgwQueryDetails.DataSource; DataTable dtDtHomePage; dtDtHomePage = dtlHomePage.Copy(); DataSet dsSaveIndicatorQuery = new DataSet(); dsSaveIndicatorQuery.Tables.Add(dtDtHomePage); dsSaveIndicatorQuery.Tables.Add(dtFeature); dsSaveIndicatorQuery.Tables.Add(dtMstHomePage); foreach (DataRow theDR in dtDtHomePage.Rows) { if (theDR["Indicator"].ToString() == "") { IQCareWindowMsgBox.ShowWindow("BlankIndicator", this); return; } } IHomePageConfiguration objTechArea = (IHomePageConfiguration)ObjectFactory.CreateInstance("BusinessProcess.FormBuilder.BHomePageConfiguration,BusinessProcess.FormBuilder"); int iSave = (int)objTechArea.SaveHomePageIndicator(dsSaveIndicatorQuery, Flag, GblIQCare.AppLocationId); btnCancel_Click(sender, e); } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareWindowMsgBox.ShowWindow("#C1", theBuilder, this); return; } }