Esempio n. 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (ValidateControls())
                {
                    ComArugments args = new ComArugments();
                    args.ParamList[CIS.Common.User.UserId]          = UserId;
                    args.ParamList[CIS.Common.User.FullName]        = txtFullName.Text;
                    args.ParamList[CIS.Common.User.Username]        = txtUsername.Text;
                    args.ParamList[CIS.Common.User.Password]        = new Encryption().Encrypt(txtPassword.Text, true);
                    args.ParamList[CIS.Common.User.UserRole.RoleId] = cboUserRole.SelectedValue;
                    args.ParamList[CIS.Common.User.UserType]        = cboUserType.SelectedValue;

                    int rowsAffected = new clsLabBusinessFacade().AddEditUser(args);
                    if (rowsAffected > 0)
                    {
                        if (UserId == 0)
                        {
                            MessageBox.Show("User is saved", "User", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                        {
                            MessageBox.Show("User is updated", "User", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        ClearControls();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " " + ex.StackTrace);
            }
        }
Esempio n. 2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvTestFieldsMapped.Rows.Count > 0)
         {
             int iDeleted = new clsLabBusinessFacade().DeleteMappedTestFields(Convert.ToInt32(cboTestItem.SelectedValue));
             int order    = 1;
             int iSaved   = 0;
             foreach (DataGridViewRow row in dgvTestFieldsMapped.Rows)
             {
                 ComArugments args = new ComArugments();
                 args.ParamList[clsLabCommon.Laboratory.TestFieldMapping.InvestigationId] = cboTestItem.SelectedValue;
                 args.ParamList[clsLabCommon.Laboratory.TestFieldMapping.TestFieldId]     = row.Cells["test_field_id"].Value.ToString();
                 args.ParamList[clsLabCommon.Laboratory.TestFieldMapping.VisibleOrder]    = order++;
                 iSaved = new clsLabBusinessFacade().SaveMappedTestFields(args);
             }
             if (iSaved > 0)
             {
                 MessageBox.Show("Test Fields are mapped successfully", "Map Test Fields", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
         else
         {
             MessageBox.Show("Test Fields are not selected!", "Map Test Fields", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtCategory.Text))
            {
                ComArugments args = new ComArugments();
                args.ParamList[clsLabCommon.Laboratory.Category.CategoryId]   = CategoryId;
                args.ParamList[clsLabCommon.Laboratory.Category.CategoryName] = txtCategory.Text;

                int rowsAffected = new clsLabBusinessFacade().AddCategory(args);

                if (rowsAffected > 0)
                {
                    if (CategoryId == 0)
                    {
                        MessageBox.Show("Category is saved", "Category", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Category is updated", "Category", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    txtCategory.Text = string.Empty;
                }
            }
            else
            {
                MessageBox.Show("Please enter Category", "Category", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(txtUserRole.Text))
            {
                ComArugments args = new ComArugments();
                args.ParamList[CIS.Common.User.UserRole.RoleId]   = RoleId;
                args.ParamList[CIS.Common.User.UserRole.RoleName] = txtUserRole.Text;

                int rowsAffected = new clsLabBusinessFacade().AddUserRole(args);

                if (rowsAffected > 0)
                {
                    if (RoleId == 0)
                    {
                        MessageBox.Show("User Role is saved", "User Role", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("User Role is updated", "User Role", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    txtUserRole.Text = string.Empty;
                }
            }
            else
            {
                MessageBox.Show("Please enter User Role", "User Role", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtPrinterName.Text))
            {
                ComArugments args = new ComArugments();
                args.ParamList[CIS.Common.Master.PrinterSettings.SettingId]      = SettingId;
                args.ParamList[CIS.Common.Master.PrinterSettings.ReportName]     = cboReportName.Text;
                args.ParamList[CIS.Common.Master.PrinterSettings.PrinterName]    = txtPrinterName.Text;
                args.ParamList[CIS.Common.Master.PrinterSettings.IsLazerPrinter] = chkIsLazer.Checked;

                int rowsAffected = new clsLabBusinessFacade().AddPrinterSetting(args);

                if (rowsAffected > 0)
                {
                    if (SettingId == 0)
                    {
                        MessageBox.Show("Printer Setting is saved", "Printer Setting", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Printer Setting is updated", "Printer Setting", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    txtPrinterName.Text = string.Empty;
                }
            }
            else
            {
                MessageBox.Show("Please enter Printer Name", "Printer Setting", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 6
0
        public frmCategory(int categoryId)
        {
            CategoryId = categoryId;
            InitializeComponent();
            DataTable dtCategory = new clsLabBusinessFacade().FetchCategoryInfoById(CategoryId);

            if (dtCategory.Rows.Count > 0)
            {
                txtCategory.Text = dtCategory.Rows[0]["category_name"].ToString();
            }
        }
Esempio n. 7
0
        public frmUserRole(int roleId)
        {
            RoleId = roleId;
            InitializeComponent();
            DataTable dtCategory = new clsLabBusinessFacade().FetchUserRoleInfoById(RoleId);

            if (dtCategory.Rows.Count > 0)
            {
                txtUserRole.Text = dtCategory.Rows[0]["User Role"].ToString();
            }
        }
Esempio n. 8
0
        public frmUser(int userId)
        {
            UserId = userId;
            InitializeComponent();
            LoadUserRoles();
            LoadUserTypes();
            DataTable dtUser = new clsLabBusinessFacade().FetchUserInfoById(UserId);

            if (dtUser.Rows.Count > 0)
            {
                txtFullName.Text          = dtUser.Rows[0]["full_name"].ToString();
                txtUsername.Text          = dtUser.Rows[0]["user_name"].ToString();
                txtPassword.Text          = new Encryption().Decrypt(dtUser.Rows[0]["password"].ToString(), true);
                cboUserType.SelectedValue = Convert.ToInt32(dtUser.Rows[0]["user_type"].ToString());
                cboUserRole.SelectedValue = Convert.ToInt32(dtUser.Rows[0]["user_role_id"].ToString());
            }
        }
Esempio n. 9
0
 public frmPrinterSettings(int settingId)
 {
     try
     {
         SettingId = settingId;
         InitializeComponent();
         cboReportName.DataSource = Enum.GetValues(typeof(CIS.Common.PrinterSetting));
         DataTable dtPrinterSetting = new clsLabBusinessFacade().FetchPrinterSettingInfoById(SettingId);
         if (dtPrinterSetting.Rows.Count > 0)
         {
             cboReportName.Text  = dtPrinterSetting.Rows[0]["report_name"].ToString();
             txtPrinterName.Text = dtPrinterSetting.Rows[0]["printer_name"].ToString();
             chkIsLazer.Checked  = dtPrinterSetting.Rows[0]["is_lazer_printer"].ToString() == "1" ? true : false;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Category", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 10
0
        private void tsbDelete_Click(object sender, EventArgs e)
        {
            int iDeleted = 0;
            if (MessageBox.Show("Are you sure delete selected  Info ?", Messages.Msg_Title, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                try
                {
                    switch (activity)
                    {
                        case "Category":
                            iDeleted = new clsLabBusinessFacade().DeleteCategory(SelectID());
                            break;
                        case "TestField":
                            iDeleted = new clsLabBusinessFacade().DeleteTestField(SelectID());
                            break;
                        case "UserRole":
                            iDeleted = new clsLabBusinessFacade().DeleteUserRole(SelectID());
                            break;
                        case "User":
                            iDeleted = new clsLabBusinessFacade().DeleteUser(SelectID());
                            break;
                        case "PrinterSetting":
                            iDeleted = new clsLabBusinessFacade().DeletePrinterSetting(SelectID());
                            break;
                    }
                }

                catch (Exception)
                {
                    MessageBox.Show(activity + " Can't be deleted. It has an association", Messages.Msg_Title, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    //throw;
                }

                if (iDeleted > 0)
                    MessageBox.Show(activity + " is deleted ", Messages.Msg_Title, MessageBoxButtons.OK, MessageBoxIcon.Information);
                /*else
                    MessageBox.Show(activity + " is not deleted", Messages.Msg_Title, MessageBoxButtons.OK, MessageBoxIcon.Error);*/
                LoadData();
            }
        }
Esempio n. 11
0
 public frmTestField(int fieldId)
 {
     try
     {
         FieldId = fieldId;
         InitializeComponent();
         LoadTestFieldTypes();
         DataTable dtTestField = new clsLabBusinessFacade().FetchTestFieldInfoById(fieldId);
         if (dtTestField.Rows.Count > 0)
         {
             cboFieldType.SelectedValue = Convert.ToInt16(dtTestField.Rows[0]["test_field_type_id"].ToString());
             txtFieldName.Text          = dtTestField.Rows[0]["test_field_name"].ToString();
             txtUnit.Text            = dtTestField.Rows[0]["unit"].ToString();
             rtxtReferenceValue.Text = dtTestField.Rows[0]["reference_value"].ToString();
             dgvTestItem.DataSource  = objBusinessFacade.LoadTestItem(FieldId);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Test Field", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 12
0
        private void dgvTestItem_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex < 0)
                {
                    return;
                }

                if ((e.ColumnIndex == 3 && FieldId == 0) || (e.ColumnIndex == 0 && FieldId > 0))
                {
                    if (dgvTestItem.Rows[e.RowIndex].Cells["Id"].FormattedValue.ToString() == "")
                    {
                        dgvTestItem.Rows.RemoveAt(e.RowIndex);
                        MessageBox.Show("Item is Deleted!", "Test Field", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        int iDeleted = new clsLabBusinessFacade().DeleteTestItem(Convert.ToInt32(dgvTestItem.Rows[e.RowIndex].Cells["Id"].FormattedValue));
                        if (iDeleted > 0)
                        {
                            dgvTestItem.Rows.RemoveAt(e.RowIndex);
                            MessageBox.Show("Item is deleted ", "Test Field", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                        {
                            MessageBox.Show("Item is not deleted", "Test Field", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " " + ex.StackTrace);
            }
        }
Esempio n. 13
0
        private void frmResultEntryReport_Load(object sender, EventArgs e)
        {
            try
            {
                DataTable dtResultEntry = new clsLabBusinessFacade().LoadResultEntryInfoForLabPrintout(BillId);
                if (dtResultEntry.Rows.Count > 0)
                {
                    if (ConfigurationManager.AppSettings["HospitalName"] == "ST.MARY'S HOSPITAL")
                    {
                        StMaryHosurResultView rptObj = new StMaryHosurResultView();
                        rptObj.SetDataSource(dtResultEntry);
                        crystalReportViewer1.ReportSource    = rptObj;
                        crystalReportViewer1.EnableDrillDown = false;
                    }
                    else
                    {
                        ResultView rptObj = new ResultView();
                        rptObj.SetDataSource(dtResultEntry);
                        crystalReportViewer1.ReportSource = rptObj;
                    }

                    //Add Parameter Fields
                    ParameterDiscreteValue objDiscreteValue;
                    ParameterField         objParameterField;
                    objDiscreteValue       = new ParameterDiscreteValue();
                    objDiscreteValue.Value = ConfigurationManager.AppSettings["LabName"];
                    objParameterField      = crystalReportViewer1.ParameterFieldInfo["LabName"];
                    objParameterField.CurrentValues.Add(objDiscreteValue);
                    crystalReportViewer1.ParameterFieldInfo.Add(objParameterField);

                    ParameterDiscreteValue objDiscreteValue1;
                    ParameterField         objParameterField1;
                    objDiscreteValue1       = new ParameterDiscreteValue();
                    objDiscreteValue1.Value = ConfigurationManager.AppSettings["Address1"];
                    objParameterField1      = crystalReportViewer1.ParameterFieldInfo["Address1"];
                    objParameterField1.CurrentValues.Add(objDiscreteValue1);
                    crystalReportViewer1.ParameterFieldInfo.Add(objParameterField1);

                    ParameterDiscreteValue objDiscreteValue2 = new ParameterDiscreteValue();;
                    ParameterField         objParameterField2;
                    objDiscreteValue2.Value = ConfigurationManager.AppSettings["Address2"];
                    objParameterField2      = crystalReportViewer1.ParameterFieldInfo["Address2"];
                    objParameterField2.CurrentValues.Add(objDiscreteValue2);
                    crystalReportViewer1.ParameterFieldInfo.Add(objParameterField2);

                    ParameterDiscreteValue objDiscreteValue3 = new ParameterDiscreteValue();;
                    ParameterField         objParameterField3;
                    objDiscreteValue3.Value = ConfigurationManager.AppSettings["Address3"];
                    objParameterField3      = crystalReportViewer1.ParameterFieldInfo["Address3"];
                    objParameterField3.CurrentValues.Add(objDiscreteValue3);
                    crystalReportViewer1.ParameterFieldInfo.Add(objParameterField3);

                    crystalReportViewer1.ParameterFieldInfo.Add(objParameterField);
                }
                else
                {
                    MessageBox.Show("Result Entry is not found!", "View Lab Report", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }