Exemplo n.º 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            string strSql = "";

            hms.Include_Files.Utility.ComboboxItem Dept = cmbDepartment.SelectedItem as hms.Include_Files.Utility.ComboboxItem;

            if (Dept != null)
            {
                objData = new C_Data_Batch();
                objData.OpenConnection("AzharPC-Home", ref strErr);
                strSql = "Insert into dbo_Designation(DeptID, Designation) values (" + Dept.Value.ToString() + ", '" + txtDesigntionName.Text.ToString() + "')";
                objData.ExecuteQuery(strSql, ref strErr);

                if (strErr.ToString() != "")
                {
                    MessageBox.Show("Designation inserted");
                    frmLoad();
                }
                else
                {
                    MessageBox.Show("Designation not inserted");
                }

                objData.CloseConnection();
            }
            else
            {
                MessageBox.Show("Please Select the Department.");
            }
        }
Exemplo n.º 2
0
        private void fillDesignation()
        {
            //throw new NotImplementedException();
            objetdata = new C_Data_Batch();
            string strErr = "";

            objetdata.OpenConnection("PolinPC-Office", ref strErr);
            string strSQL = "";

            hms.Include_Files.Utility.ComboboxItem itms = cmbDepartment.SelectedItem as hms.Include_Files.Utility.ComboboxItem;
            var DeptID = 0;

            if (itms != null)
            {
                DeptID = itms.Value;
                strSQL = "select DegId, Designation from dbo_Designation where DeptID= " + DeptID + " order by DeptID Desc ";
                DataTable arrDept = objetdata.RetriveData(strSQL, ref strErr);
                objetdata.CloseConnection();
                //DataSet ds = new DataSet();
                //ds.Tables.Add(arrDept);
                //dgvEmpprofile.DataSource = ds.Tables["Table1"];
                cmbDesignation.Items.Clear();
                if (arrDept.Rows.Count > 0)
                {
                    for (int i = 0; i < arrDept.Rows.Count; i++)
                    {
                        cmbDesignation.Items.Add(new hms.Include_Files.Utility.ComboboxItem(arrDept.Rows[i][1].ToString(), Convert.ToInt32(arrDept.Rows[i][0].ToString())));
                    }
                }
            }
            else
            {
                MessageBox.Show("Please select the Department");
            }
        }
Exemplo n.º 3
0
        private void dgvServcieInformation_Click(object sender, EventArgs e)
        {
            txtServiceID.Text         = dgvServcieInformation.CurrentRow.Cells[0].Value.ToString();
            cmbCategory.SelectedIndex = cmbCategory.FindStringExact(dgvServcieInformation.CurrentRow.Cells[1].Value.ToString());
            hms.Include_Files.Utility.ComboboxItem valCategory = cmbCategory.SelectedItem as hms.Include_Files.Utility.ComboboxItem;
            if (valCategory != null)
            {
                txtcatagory.Text = valCategory.Value.ToString();
            }
            //txtcatagory.Text = "";

            cmbCommission.SelectedIndex = cmbCommission.FindStringExact(dgvServcieInformation.CurrentRow.Cells[5].Value.ToString());

            cmbDurationType.SelectedIndex = cmbDurationType.FindStringExact(dgvServcieInformation.CurrentRow.Cells[7].Value.ToString());

            txtcommistion.Text    = dgvServcieInformation.CurrentRow.Cells[4].Value.ToString();
            txtpc.Text            = dgvServcieInformation.CurrentRow.Cells[6].Value.ToString();
            txtservicecharge.Text = dgvServcieInformation.CurrentRow.Cells[3].Value.ToString();
            txtservicename.Text   = dgvServcieInformation.CurrentRow.Cells[2].Value.ToString();
            txtDuration.Text      = dgvServcieInformation.CurrentRow.Cells[6].Value.ToString();
            if (dgvServcieInformation.CurrentRow.Cells[10].Value.ToString() == "True")
            {
                chkSample.Checked = true;
            }
            else
            {
                chkSample.Checked = false;
            }
            //chkSample.Checked = false;
            txtSample.Text = dgvServcieInformation.CurrentRow.Cells[9].Value.ToString();
        }
Exemplo n.º 4
0
        private void InsertData()
        {
            objData = new C_Data_Batch();
            string strErr = "";

            objData.OpenConnection("PolinPC-Office", ref strErr);
            //txtCategoryID
            hms.Include_Files.Utility.ComboboxItem commissionType = cmbCommission.SelectedItem as hms.Include_Files.Utility.ComboboxItem;
            hms.Include_Files.Utility.ComboboxItem DurationType   = cmbDurationType.SelectedItem as hms.Include_Files.Utility.ComboboxItem;

            int isSample = 0;

            if (chkSample.Checked == true)
            {
                isSample = 1;
            }
            string strSQL = "";

            strSQL = "insert into [Dbo_Services] ([Category_ID],[Amount],[Commission],[Commision_Type],[Dutaion],[Duraion_Type],[CC_PC],[isSample],[Sample_Type], [Service_Name] ) ";
            strSQL = strSQL + "Values (" + txtcatagory.Text.ToString() + ", " + txtservicecharge.Text.ToString() + ", " + txtcommistion.Text.ToString() + ", " + commissionType.Value.ToString() + ", " + txtDuration.Text.ToString() + ", " + DurationType.Value.ToString();
            strSQL = strSQL + ", " + txtpc.Text.ToString() + ", " + isSample.ToString() + ", '" + txtSample.Text.ToString() + "', '" + txtservicename.Text.ToString() + "' )";
            //MessageBox.Show(strSQL);
            objData.ExecuteQuery(strSQL, ref strErr);
            if (strErr != "")
            {
                MessageBox.Show("Data not Inserted.");
            }
            else
            {
                MessageBox.Show("Data Inserted Succefully Done.");
                frmLoad();
            }
            objData.CloseConnection();
        }
Exemplo n.º 5
0
        private void cmbServices_SelectedIndexChanged(object sender, EventArgs e)
        {
            hms.Include_Files.Utility.ComboboxItem itms = cmbServices.SelectedItem as hms.Include_Files.Utility.ComboboxItem;

            if (itms != null)
            {
                txtServiceID.Text = itms.Value.ToString();
            }
        }
Exemplo n.º 6
0
        private void cmbMarktingOfficer_SelectedIndexChanged(object sender, EventArgs e)
        {
            hms.Include_Files.Utility.ComboboxItem itms = cmbMarktingOfficer.SelectedItem as hms.Include_Files.Utility.ComboboxItem;

            if (itms != null)
            {
                txtMarketingBy.Text = itms.Name.ToString();
            }
        }
Exemplo n.º 7
0
        private void btnedit_Click(object sender, EventArgs e)
        {
            hms.Include_Files.Utility.ComboboxItem Maritms = cmbMarktingOfficer.SelectedItem as hms.Include_Files.Utility.ComboboxItem;
            var valMar = 0;

            if (Maritms != null)
            {
                valMar = Maritms.Value;
            }
            hms.Include_Files.Utility.ComboboxItem itms = drDoctorType.SelectedItem as hms.Include_Files.Utility.ComboboxItem;
            if (itms != null)
            {
                //MessageBox.Show(itms.Value.ToString());
                int isPC = 0;
                if (chkbispc.Checked == true)
                {
                    isPC = 1;
                }
                string strSql = "";
                //strSql = "insert into dbo_Doctor_List ([Title],[Name],[Degree],[Phone],[IsPc],[Address],[Area],[Specialist],[Doctor_Type],[MarketingBy],[UserID],DocID, Doctype) ";
                //strSql = strSql + "Values ('" + txttitle.Text.ToString() + "', '" + txtdoctorname.Text.ToString();
                //strSql = strSql + "', '" + txtdegree.Text.ToString() + "', '" + txtPhone.Text.ToString() + "'," + isPC.ToString();
                //strSql = strSql + " ,'" + txtAddress.Text.ToString() + "','" + txtArea.Text.ToString() + "','" + txtspecialist.Text.ToString();
                //strSql = strSql + "'," + itms.Value.ToString() + ", 1," + hms.Include_Files.Utility.userID.ToString() + ", " + txtdoctorsid.Text.ToString() + ", '' )";

                strSql = "Update dbo_Doctor_List SET [Title] = '" + txttitle.Text.ToString() + "',[Name] = '" + txtdoctorname.Text.ToString() + "',[Degree] ='" + txtdegree.Text.ToString() + "'";
                strSql = strSql + ",[Phone]='" + txtPhone.Text.ToString() + "',[IsPc]=" + isPC.ToString() + ",[Address]='" + txtAddress.Text.ToString() + "',[Area] = '" + txtArea.Text.ToString() + "',[Specialist] ='" + txtspecialist.Text.ToString() + "'";
                strSql = strSql + ",[Doctor_Type] ='" + itms.Value.ToString() + "', MarketingBy = " + valMar + "  where DocID =" + txtdoctorsid.Text.ToString();


                objData = new C_Data_Batch();

                objData.OpenConnection("sakhawat-pc", ref strErr);

                objData.ExecuteQuery(strSql, ref strErr);

                if (strErr.ToString() == "")
                {
                    MessageBox.Show("Dotor setup Edit succefully done.");
                    frmLoad();
                }
                else
                {
                    MessageBox.Show("Dotor setup Edit not succefully done.");
                }
                objData.CloseConnection();
            }
        }
Exemplo n.º 8
0
 private void dgvServiceWiseSetup_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     txtSIT_ID.Text            = dgvServiceWiseSetup.CurrentRow.Cells[0].Value.ToString();
     cmbServices.SelectedIndex = cmbServices.FindStringExact(dgvServiceWiseSetup.CurrentRow.Cells[1].Value.ToString());
     hms.Include_Files.Utility.ComboboxItem valService = cmbServices.SelectedItem as hms.Include_Files.Utility.ComboboxItem;
     if (valService != null)
     {
         txtServiceID.Text = valService.Value.ToString();
     }
     else
     {
         txtServiceID.Text = "";
     }
     txtOGroup.Text   = dgvServiceWiseSetup.CurrentRow.Cells[2].Value.ToString();
     txtEntity.Text   = dgvServiceWiseSetup.CurrentRow.Cells[3].Value.ToString();
     txtUnit.Text     = dgvServiceWiseSetup.CurrentRow.Cells[4].Value.ToString();
     txtRefRenge.Text = dgvServiceWiseSetup.CurrentRow.Cells[5].Value.ToString();
     txtResultB.Text  = dgvServiceWiseSetup.CurrentRow.Cells[6].Value.ToString();
 }
Exemplo n.º 9
0
        private void dgvPathLab_DoubleClick(object sender, EventArgs e)
        {
            hms.Include_Files.Utility.ComboboxItem LabData = lbPathlab.SelectedItem as hms.Include_Files.Utility.ComboboxItem;
            var ReportId = 2;

            if (LabData != null)
            {
                ReportId = Convert.ToInt16(LabData.Value.ToString());
            }
            if (ReportId == 3)
            {
                frmPathologyLabProcess f = new frmPathologyLabProcess(dgvPathLab.CurrentRow.Cells[8].Value.ToString());
                f.Show();
            }
            //new frmPathologyLabProcess() { Owner = this }.ShowDialog();

            //new frmAdmitedPatientList() { Owner = this }.ShowDialog();
            //var val =
            //MessageBox.Show(loadInvestigationID());
        }
Exemplo n.º 10
0
        private void insertData()
        {
            //throw new NotImplementedException();
            objetdata = new C_Data_Batch();
            string strErr = "";

            hms.Include_Files.Utility.ComboboxItem Department = cmbDepartment.SelectedItem as hms.Include_Files.Utility.ComboboxItem;

            hms.Include_Files.Utility.ComboboxItem Designation = cmbDesignation.SelectedItem as hms.Include_Files.Utility.ComboboxItem;

            if (Department != null && Designation != null)
            {
                var ValDepartment  = Department.Value.ToString();
                var ValDesignation = Designation.Value.ToString();

                //var DeptID = 0;

                objetdata.OpenConnection("PolinPC-Office", ref strErr);
                string strSQL = "";
                var    Gender = "M";
                if (txtgender.Text.ToString() == "F")
                {
                    Gender = "F";
                }

                var IsCommession = 0;
                if (chkIsCommession.Checked == true)
                {
                    IsCommession = 1;
                }
                var isDoc = 0;
                if (chkDoctor.Checked == true)
                {
                    isDoc = 1;
                }

                var valDocID = 0;
                if (isDoc.ToString() == "1")
                {
                    valDocID = Convert.ToInt32(txtDoctorId.Text.ToString());
                }
                var isparmanent = 0;
                if (chkParmanent.Checked == true)
                {
                    isparmanent = 1;
                }

                strSQL = "Insert into dbo_Employee_Profiles ([Name],[PresentAddress],[Gender],[BloodGroup],";
                strSQL = strSQL + "[JoiningDate],[Phone],[DateOfBirth],[ParmanentAddress],[IsDoctor],[IsCommession],[IsEmployment],[FatherName],[MotherName], [DocID]) ";
                strSQL = strSQL + " values ('" + txtEmployeeName.Text.ToString() + "','" + rtbPresentAddress.Text + "','" + Gender + "','" + txtBloodGroup.Text + "',";
                strSQL = strSQL + "'" + dtpJoinDate.Text + "','" + txtMobileNo.Text + "','" + dtpDateOfBirth.Text + "',";
                strSQL = strSQL + "'" + txtParmanentAddress.Text + "'," + isDoc + "," + IsCommession + "," + isparmanent + ",'" + txtFatherName.Text + "','" + txtMotherName.Text + "', " + valDocID + ")";

                objetdata.BeginTransaction(ref strErr);

                objetdata.ExecuteQuery(strSQL, ref strErr);

                if (strErr == "")
                {
                    strSQL = "Select Max(EmpID) From dbo_Employee_Profiles";
                    var arr   = objetdata.RetriveData(strSQL, ref strErr);
                    var EmpId = 1;
                    if (arr.Rows[0][0].ToString() != "")
                    {
                        EmpId = Convert.ToInt32(arr.Rows[0][0].ToString());

                        strSQL = "Insert into dbo_Employee_Designation (EmpID, DegID)  values (" + EmpId.ToString() + ", " + ValDesignation + ")";
                        objetdata.ExecuteQuery(strSQL, ref strErr);
                        if (strErr == "")
                        {
                            strSQL = "Insert into dbo_Employee_Salary(EmpID, Basic, HouseRent, Medical, Others, InActive) ";
                            strSQL = strSQL + " Values(" + EmpId.ToString() + ", " + txtBasic.Text + ", " + txthouse.Text + ", " + txtmedical.Text + ", " + txtother.Text + ", 1)";
                            objetdata.ExecuteQuery(strSQL, ref strErr);
                            if (strErr == "")
                            {
                                objetdata.CommitTransaction(ref strErr);
                                MessageBox.Show("Employe Insert succefully done.");
                                clearFields();
                                getEmployeeID();

                                fillDepartment();
                                ShowdgvEmpprofile();
                            }
                            else
                            {
                                objetdata.Rollback(ref strErr);
                                MessageBox.Show("Employe Not Insert");
                            }
                        }
                        else
                        {
                            objetdata.Rollback(ref strErr);
                            MessageBox.Show("Employe Not Insert");
                        }
                    }
                    else
                    {
                        objetdata.Rollback(ref strErr);
                        MessageBox.Show("Employe Not Insert");
                    }
                }
                else
                {
                    objetdata.Rollback(ref strErr);
                    MessageBox.Show("Employe Not Insert");
                }
            }
            else
            {
                MessageBox.Show("Please select Department or Designation");
            }
        }
Exemplo n.º 11
0
        private void fillGridView()
        {
            //throw new NotImplementedException();
            hms.Include_Files.Utility.ComboboxItem LabData = lbPathlab.SelectedItem as hms.Include_Files.Utility.ComboboxItem;
            var ReportId = 1;

            if (LabData != null)
            {
                ReportId = LabData.Value;
            }

            var ids = "";

            for (var i = 0; i < gbtestcatagory.Controls.Count; i++)
            {
                if (gbtestcatagory.Controls[i] is CheckBox)
                {
                    if (((CheckBox)gbtestcatagory.Controls[i]).Checked)
                    {
                        if (ids == "")
                        {
                            ids = ((CheckBox)gbtestcatagory.Controls[i]).Tag.ToString();
                        }
                        else
                        {
                            ids += "," + ((CheckBox)gbtestcatagory.Controls[i]).Tag.ToString();
                        }
                    }
                }
            }

            string strSQL = "";

            strSQL = "select cast(inv.Invetigation_SL as varchar(6))+'/'+cast( MONTH(inv.CreatedON) as varchar(2))+'/'+cast(year(inv.CreatedON) as varchar(4)) investigation ";
            strSQL = strSQL + ", inv.CreatedON 'Date', s.Service_Name 'Test Name', s.Sample_Type 'Sample Type'";
            strSQL = strSQL + ", p.Name+'('+cast(datediff(year, p.BirthDate, getdate()) as varchar(3))+'Y)' 'Tatient' ";
            strSQL = strSQL + ",d.Name 'Doctor', s.Amount 'Charge' ,inv.InvestigationID,  items.ISI_ID ";
            strSQL = strSQL + "From dbo_Investigation Inv inner join dbo_Patient_info P On inv.P_ID = p.P_ID ";
            strSQL = strSQL + "inner join dbo_Doctor_List D on inv.DocID=d.DocID ";
            strSQL = strSQL + "inner Join dbo_InvertigationServiceItem items on inv.InvestigationID=items.Investigationid ";
            strSQL = strSQL + "Inner join Dbo_Services S on s.Service_ID = items.Service_ID ";
            if (ReportId == 3)
            {
                strSQL = strSQL + "where items.Status >=  " + ReportId;
            }
            else
            {
                strSQL = strSQL + "where items.Status =  " + ReportId;
            }

            if (ids != "")
            {
                strSQL = strSQL + " And S.Category_ID in (" + ids + ")";
            }

            string strVal = "";

            strVal = txtinvestigationid.Text;


            string[] arrinv = strVal.Split(new string[] { "/" }, StringSplitOptions.None);

            if (arrinv.Length.ToString() == "3")
            {
                if (arrinv[0].ToString() == "")
                {
                    //MessageBox.Show("please enter valid investifgation no.");
                }
                else
                {
                    if (arrinv[1].ToString() == "")
                    {
                        //MessageBox.Show("please enter valid Month no.");
                    }
                    else
                    {
                        if (arrinv[2].ToString() == "")
                        {
                            //MessageBox.Show("please enter valid year no.");
                        }
                        else
                        {
                            strSQL = strSQL + " and  inv.Invetigation_SL= " + arrinv[0].Trim();
                            strSQL = strSQL + " and  MONTH(inv.CreatedON)= " + arrinv[1].Trim();
                            strSQL = strSQL + " and  year(inv.CreatedON)= " + arrinv[2].Trim();
                        }
                    }
                }
            }



            //objData = new C_Data_Batch();
            //objData.OpenConnection("AzharPC-Home", ref strErr);
            DataTable arrSample = objData.RetriveData(strSQL, ref strErr);

            DataSet ds = new DataSet();

            ds.Tables.Add(arrSample);

            dgvPathLab.DataSource = ds.Tables["Table1"];
            dgvPathLab.Columns["InvestigationID"].Visible = false;
            dgvPathLab.Columns["ISI_ID"].Visible          = false;
        }
Exemplo n.º 12
0
        private void SaveData()
        {
            //throw new NotImplementedException();
            string strSqlUpdateItems   = "";
            string strSqlInsertHistory = "";
            string strIDs = "";
            var    strMsg = "";

            hms.Include_Files.Utility.ComboboxItem LabData = lbPathlab.SelectedItem as hms.Include_Files.Utility.ComboboxItem;
            var ReportId = 2;

            if (LabData != null)
            {
                ReportId = Convert.ToInt16(LabData.Value.ToString()) + 1;
            }

            if (Convert.ToInt32(dgvPathLab.Rows.Count) - 1 > 0)
            {
                for (int i = 0; i < dgvPathLab.Rows.Count - 1; i++)
                {
                    if ((bool)dgvPathLab.Rows[i].Cells[0].FormattedValue == true)
                    {
                        if (strIDs.ToString() == "")
                        {
                            strIDs = dgvPathLab.Rows[i].Cells[9].Value.ToString();
                            strSqlInsertHistory = " (" + dgvPathLab.Rows[i].Cells[9].Value.ToString() + ", " + ReportId + ", " + hms.Include_Files.Utility.userID + ",'" + Utility.PcName + "')";
                        }
                        else
                        {
                            strIDs = strIDs + ", " + dgvPathLab.Rows[i].Cells[9].Value.ToString();
                            strSqlInsertHistory = strSqlInsertHistory + ", (" + dgvPathLab.Rows[i].Cells[9].Value.ToString() + ", " + ReportId + ", " + hms.Include_Files.Utility.userID + ",'" + Utility.PcName + "')";
                        }
                    }
                }
            }

            if (strIDs.ToString() != "")
            {
                strSqlUpdateItems   = "Update dbo_InvertigationServiceItem SET Status=" + ReportId + " where [ISI_ID] in (" + strIDs.ToString() + ")";
                strSqlInsertHistory = "insert into Investigation_Serviceitem_History (ISI_ID, Status, UserID,userPC) values " + strSqlInsertHistory;

                objData = new C_Data_Batch();
                objData.OpenConnection("AzharPC-Home", ref strErr);

                objData.BeginTransaction(ref strErr);
                if (strErr.ToString() == "")
                {
                    objData.ExecuteQuery(strSqlUpdateItems, ref strErr);
                    if (strErr.ToString() == "")
                    {
                        objData.ExecuteQuery(strSqlInsertHistory, ref strErr);
                        if (strErr.ToString() == "")
                        {
                            //MessageBox.Show("sample collection saved succefully done.");
                            hms.Include_Files.Utility.ComboboxItem LabDataMsg = lbPathlab.SelectedItem as hms.Include_Files.Utility.ComboboxItem;
                            strMsg = "Test Complete";
                            if (LabDataMsg != null)
                            {
                                strMsg = LabDataMsg.Name;
                            }
                            strMsg = strMsg + " saved succefully done.";
                            MessageBox.Show(strMsg);
                            objData.CommitTransaction(ref strErr);
                            frmLoad();
                        }
                        else
                        {
                            objData.Rollback(ref strErr);
                            MessageBox.Show("System cannot deal at this moment.");
                        }
                    }
                    else
                    {
                        objData.Rollback(ref strErr);
                        MessageBox.Show("System cannot deal at this moment.");
                    }
                }
            }
        }