示例#1
0
    private void GetUserRecords()
    {
        try
        {
            Iuser UserManager;
            UserManager = (Iuser)ObjectFactory.CreateInstance("BusinessProcess.Administration.BUser, BusinessProcess.Administration");
            DataSet theDS = UserManager.GetUserRecord(theUserId);
            txtfirstname.Text           = theDS.Tables[0].Rows[0]["UserFirstName"].ToString();
            txtlastname.Text            = theDS.Tables[0].Rows[0]["UserLastName"].ToString();
            txtEmail.Text               = theDS.Tables[0].Rows[0]["Email"].ToString();
            txtPhone.Text               = theDS.Tables[0].Rows[0]["Phone"].ToString();
            dddesignation.SelectedValue = theDS.Tables[0].Rows[0]["Designation"].ToString();
            if (theUserId != 0 && txtusername.Text == "")
            {
                txtusername.Text = theDS.Tables[0].Rows[0]["UserName"].ToString();
            }
            Utility theUtil = new Utility();
            string  thePass = theUtil.Decrypt(theDS.Tables[0].Rows[0]["Password"].ToString());
            txtPassword.Attributes.Add("Value", thePass);
            txtConfirmpassword.Attributes.Add("Value", thePass);
            //ddEmployee.SelectedValue = theDS.Tables[0].Rows[0]["EmployeeId"].ToString();
            //txtusername.ReadOnly = true;

            foreach (DataRow theDR in theDS.Tables[1].Rows)
            {
                int i = 0;
                for (i = 0; i < lstUsergroup.Items.Count; i++)
                {
                    if (lstUsergroup.Items[i].Value == theDR["groupid"].ToString())
                    {
                        lstUsergroup.Items[i].Selected = true;

                        if (lstUsergroup.Items[i].Text == "System Admin")
                        {
                            lstUsergroup.Items[i].Enabled = false;
                            txtfirstname.ReadOnly         = true;
                            txtlastname.ReadOnly          = true;
                            txtusername.ReadOnly          = true;
                            btnDelete.Enabled             = false;
                        }
                    }
                }
            }

            foreach (DataRow theDR in theDS.Tables[2].Rows)
            {
                int i = 0;

                for (i = 0; i < chklistStores.Items.Count; i++)
                {
                    if (chklistStores.Items[i].Value == theDR["StoreId"].ToString())
                    {
                        chklistStores.Items[i].Selected = true;
                    }
                }
            }
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
        }
    }
示例#2
0
        void theCombo_SelectedValueChanged(object sender, EventArgs e)
        {
            try
            {
                if (theGrdCombo.Focused == true && theGrdCombo.SelectedValue != null)
                {
                    if (theGrdCombo.DataSource != null && theGrdCombo.SelectedValue.GetType().ToString() != "System.Data.DataRowView")
                    {
                        string    strdrug = theGrdCombo.SelectedValue.ToString();
                        string[]  strArry = strdrug.Split('-');
                        DataTable theDT   = new DataTable();
                        theDT = dsPOItems.Tables[1].Copy();
                        DataView  dvFilteredRow = theDT.DefaultView;
                        DataTable dtRow         = new DataTable();
                        dvFilteredRow.RowFilter = "Drug_Pk=" + strArry[0];

                        dtRow = dvFilteredRow.ToTable();
                        if (dtRow.Rows.Count > 0)
                        {
                            if (!deletedGridByKey)
                            {
                                dgwItemSubitemDetails.CurrentRow.Cells["ItemCode"].Value    = dtRow.Rows[0]["DrugId"].ToString();
                                dgwItemSubitemDetails.CurrentRow.Cells["ItemTypeId"].Value  = dtRow.Rows[0]["ItemTypeId"].ToString();
                                dgwItemSubitemDetails.CurrentRow.Cells["ItemCode"].ReadOnly = true;
                                dgwItemSubitemDetails.CurrentRow.Cells["Units"].Value       = dtRow.Rows[0]["PurchaseUnitName"].ToString();
                                dgwItemSubitemDetails.CurrentRow.Cells["Units"].ReadOnly    = true;
                                dgwItemSubitemDetails.CurrentRow.Cells["Price"].Value       = Convert.ToDecimal(dtRow.Rows[0]["PurchaseUnitPrice"].ToString());
                                dgwItemSubitemDetails.CurrentRow.Cells["Price"].ReadOnly    = false;
                                if (Convert.ToString(dtRow.Rows[0]["QtyPerPurchaseunit"]) != "")
                                {
                                    dgwItemSubitemDetails.CurrentRow.Cells["UnitQuantity"].Value = Convert.ToDecimal(dtRow.Rows[0]["QtyPerPurchaseunit"].ToString());
                                }
                                else
                                {
                                    dgwItemSubitemDetails.CurrentRow.Cells["UnitQuantity"].Value = "";
                                }
                                dgwItemSubitemDetails.CurrentRow.Cells["UnitQuantity"].ReadOnly = true;
                                dgwItemSubitemDetails.CurrentRow.Cells["OrderQuantity"].Value   = 0;
                                dgwItemSubitemDetails.CurrentRow.Cells["TotPrice"].ReadOnly     = true;

                                dgwItemSubitemDetails.AllowUserToAddRows = true;
                                dvFilteredRow = null;
                                dtRow         = null;
                                theDT         = null;
                            }
                        }
                        else
                        {
                            if (dgwItemSubitemDetails.SelectedRows.Count > 0)
                            {
                                foreach (DataGridViewRow row in dgwItemSubitemDetails.SelectedRows)
                                {
                                    dgwItemSubitemDetails.Rows.Remove(row);
                                    //theGrdCombo.SelectedValueChanged += null;
                                    deletedGridByKey = true;
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareWindowMsgBox.ShowWindow("#C1", theBuilder, this);
                return;
            }

            finally
            {
            }
        }
    protected void Init_ARTCare()
    {
        IPatientARTCare IEManager;

        try
        {
            txtarttransdate.Attributes.Add("OnBlur", "DateFormat(this,this.value,event,true,'3'), isCheckValidDate('" + Application["AppCurrentDate"] + "', '" + txtarttransdate.ClientID + "', '" + txtarttransdate.ClientID + "')");
            txtarttransdate.Attributes.Add("onkeyup", "DateFormat(this,this.value,event,false,'3')");
            txtanotherRegimendate.Attributes.Add("OnBlur", "DateFormat(this,this.value,event,true,'3'), isCheckValidDate('" + Application["AppCurrentDate"] + "', '" + txtanotherRegimendate.ClientID + "', '" + txtanotherRegimendate.ClientID + "')");
            txtanotherRegimendate.Attributes.Add("onkeyup", "DateFormat(this,this.value,event,false,'3')");

            PId = Convert.ToInt32(Session["PatientId"]);

            if (Session["PatientSex"].ToString() == "Female" && Convert.ToDecimal(Session["PatientAge"]) > 12)
            {
                divanothpreg.Visible = true;
                spnthispreg.Visible  = true;
            }
            else
            {
                divanothpreg.Visible = false;
                spnthispreg.Visible  = false;
            }

            IEManager = (IPatientARTCare)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientARTCare, BusinessProcess.Clinical");
            DataSet theDS = IEManager.GetPatientARTCare(Convert.ToInt32(Session["PatientId"]), Convert.ToInt32(Session["AppLocationId"]));
            Session["ARVMasterData"]   = theDS.Tables[1];
            ViewState["MasterData"]    = theDS.Tables[1];
            ViewState["MasterARVData"] = theDS.Tables[1];
            if (theDS.Tables[4].Rows.Count > 0 && theDS.Tables[4].Rows[0]["Visit_Id"] != System.DBNull.Value)
            {
                Session["PatientVisitId"] = theDS.Tables[4].Rows[0]["Visit_Id"].ToString();
                visitPK = Convert.ToInt32(Session["PatientVisitId"]);
            }
            else
            {
                Session["PatientVisitId"] = 0;
            }



            if (theDS.Tables[0].Rows.Count > 0)
            {
                if (theDS.Tables[0].Rows[0]["ARTStartDate"] != System.DBNull.Value)
                {
                    this.txtcohortmnth.Value = String.Format("{0:MMM}", theDS.Tables[0].Rows[0]["ARTStartDate"]).ToUpper();
                }
                if (theDS.Tables[0].Rows[0]["ARTStartDate"] != System.DBNull.Value)
                {
                    this.txtcohortyear.Value = String.Format("{0:yyyy}", theDS.Tables[0].Rows[0]["ARTStartDate"]).ToUpper();
                }

                // ART Start at This Facility Section
                if (theDS.Tables[0].Rows[0]["ARTStartDate"] != System.DBNull.Value)
                {
                    this.txtthisRegimendate.Value = String.Format("{0:dd-MMM-yyyy}", theDS.Tables[0].Rows[0]["ARTStartDate"]);
                }
            }
            if (theDS.Tables[8].Rows.Count > 0 && theDS.Tables[8].Rows[0]["FirstLineRegimen"] != System.DBNull.Value)
            {
                txtthisregimen.Value = theDS.Tables[8].Rows[0]["FirstLineRegimen"].ToString();
            }
            if (theDS.Tables[3].Rows.Count > 0 && theDS.Tables[3].Rows[0]["weight"] != System.DBNull.Value)
            {
                this.txtthiswght.Value = theDS.Tables[3].Rows[0]["weight"].ToString();
            }
            if (theDS.Tables[6].Rows.Count > 0 && theDS.Tables[6].Rows[0]["cd4"] != System.DBNull.Value)
            {
                this.txtthisCD4.Value = theDS.Tables[6].Rows[0]["cd4"].ToString();
            }
            if (theDS.Tables[7].Rows.Count > 0 && theDS.Tables[7].Rows[0]["CD4Percent"] != System.DBNull.Value)
            {
                this.txtthisCD4percent.Value = theDS.Tables[7].Rows[0]["cd4percent"].ToString();
            }
            if (theDS.Tables[5].Rows.Count > 0 && theDS.Tables[5].Rows[0]["pregnant"] != System.DBNull.Value)
            {
                if (theDS.Tables[5].Rows[0]["pregnant"].ToString() == "1")
                {
                    this.ddlpregthis.SelectedValue = "309";
                }
                else
                {
                    this.ddlpregthis.SelectedValue = "311";
                }
            }
            if (theDS.Tables[9].Rows.Count > 0 && theDS.Tables[9].Rows[0]["whostage"] != System.DBNull.Value)
            {
                this.lstthisClinicalStage.SelectedValue = theDS.Tables[9].Rows[0]["whostage"].ToString();
            }
            //////////////////////////////////////////////////////////////////////////////////////////////
            //Grid Substitution of ARVs
            grdSubsARVs.DataSource = theDS.Tables[12];
            grdSubsARVs.DataBind();

            /////////////////////////////////////////////////////////////////////////////////////////////

            //Grid Interuptions of ARVs
            grdInteruptions.DataSource = theDS.Tables[13];
            grdInteruptions.DataBind();
            //For Editing Records
            if (Convert.ToInt32(Session["PatientVisitId"]) > 0)
            {
                //Transfer in on ART Section
                if (theDS.Tables[10].Rows.Count > 0)
                {
                    if (theDS.Tables[10].Rows[0]["ARTTransferInDate"] != System.DBNull.Value)
                    {
                        string ARTTransDate = String.Format("{0:dd-MMM-yyyy}", theDS.Tables[10].Rows[0]["ARTTransferInDate"]);
                        if (ARTTransDate.ToString() != "01-Jan-1900")
                        {
                            this.txtarttransdate.Value = ARTTransDate.ToString();
                        }
                    }
                    if (theDS.Tables[10].Rows[0]["LPTFTransferId"] != System.DBNull.Value)
                    {
                        this.ddlarttransferinfrom.SelectedValue = theDS.Tables[10].Rows[0]["LPTFTransferId"].ToString();
                    }
                    if (theDS.Tables[10].Rows[0]["PrevARVRegimen"] != System.DBNull.Value)
                    {
                        this.txttransferARVs.Value = theDS.Tables[10].Rows[0]["PrevARVRegimen"].ToString();
                        string[] thetransStrRegimen = txttransferARVs.Value.Split(new Char[] { '/' });
                        DataView theARVTransDV      = new DataView(theDS.Tables[1]);
                        if (txttransferARVs.Value != "")
                        {
                            ViewState["SelectedData"] = OldRegimenList(thetransStrRegimen, theARVTransDV);
                        }
                    }
                }
                if (theDS.Tables[11].Rows.Count > 0)
                {
                    // ART Start at another Facility Section
                    if ((theDS.Tables[11].Rows[0]["FirstLineRegStDate"] != System.DBNull.Value) || (theDS.Tables[11].Rows[0]["FirstLineRegStDate"] != "1900-01-01"))
                    {
                        string firsLineRegDate = String.Format("{0:dd-MMM-yyyy}", theDS.Tables[11].Rows[0]["FirstLineRegStDate"]);
                        if (firsLineRegDate.ToString() != "01-Jan-1900")
                        {
                            this.txtanotherRegimendate.Value = firsLineRegDate.ToString();
                        }
                    }
                    // Add By Deepak
                    if (txtanotherRegimendate.Value != string.Empty)
                    {
                        this.txtcohortmnth.Value = String.Format("{0:MMM}", Convert.ToDateTime(txtanotherRegimendate.Value)).ToUpper();
                    }
                    if (txtanotherRegimendate.Value != string.Empty)
                    {
                        this.txtcohortyear.Value = String.Format("{0:yyyy}", Convert.ToDateTime(txtanotherRegimendate.Value)).ToUpper();
                    }
                    if (theDS.Tables[11].Rows[0]["FirstLineReg"] != System.DBNull.Value)
                    {
                        txtanotherregimen.Value = theDS.Tables[11].Rows[0]["FirstLineReg"].ToString();
                        string[] theStrRegimen = txtanotherregimen.Value.Split(new Char[] { '/' });
                        DataView theARVDV      = new DataView(theDS.Tables[1]);
                        if (txtanotherregimen.Value != "")
                        {
                            ViewState["TransSelectedData"] = OldRegimenList(theStrRegimen, theARVDV);
                        }
                    }

                    if (theDS.Tables[11].Rows[0]["weight"] != System.DBNull.Value)
                    {
                        this.txtanotherwght.Value = theDS.Tables[11].Rows[0]["weight"].ToString();
                    }
                    if (theDS.Tables[11].Rows[0]["cd4"] != System.DBNull.Value)
                    {
                        this.txtanotherCD4.Value = theDS.Tables[11].Rows[0]["cd4"].ToString();
                    }
                    if (theDS.Tables[11].Rows[0]["cd4percent"] != System.DBNull.Value)
                    {
                        this.txtanotherCD4percent.Value = theDS.Tables[11].Rows[0]["cd4percent"].ToString();
                    }
                    if (theDS.Tables[11].Rows[0]["pregnant"] != System.DBNull.Value)
                    {
                        this.ddlpregnantanother.SelectedValue = theDS.Tables[11].Rows[0]["pregnant"].ToString();
                    }
                    if (theDS.Tables[11].Rows[0]["whostage"] != System.DBNull.Value)
                    {
                        this.lstanotherClinicalStage.SelectedValue = theDS.Tables[11].Rows[0]["whostage"].ToString();
                    }
                }
                //////////////////////////////////////////////////////////////////////////////////////////////
                //if (theDS1.Tables[0].Rows[0]["DataQuality"] != System.DBNull.Value && Convert.ToInt32(theDS1.Tables[0].Rows[0]["DataQuality"]) == 1)
                //{
                //    btncomplete.CssClass = "greenbutton";
                //}
            }
            FillOldData(PId);
        }
        // }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
            return;
        }
        finally
        {
            IEManager = null;
        }
    }
示例#4
0
        /// <summary>
        /// Handles the Click event of the btnLogin control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            if (btnLogin.CommandName == "Setup")
            {
                string theUrl = string.Format("{0}", "./AdminForms/frmAdmin_FacilityList.aspx");

                HttpContext.Current.ApplicationInstance.CompleteRequest();
                Response.Redirect(theUrl, false);
                return;
            }

            if (ValidateLogin() == false)
            {
                Init_Form();
                return;
            }

            // IUser LoginManager;
            string redirectURL = this.RedirectURL;


            try
            {
                //LoginManager = (IUser)ObjectFactory.CreateInstance("BusinessProcess.Security.BUser, BusinessProcess.Security");
                //DataSet theDS = LoginManager.GetUserCredentials(txtuname.Text.Trim(), Convert.ToInt32(ddLocation.SelectedValue), Convert.ToInt32(Session["SystemId"]));
                LoginResponseCode response = CurrentSession.Login(this, txtuname.Text.Trim(), Convert.ToInt32(ddLocation.SelectedValue), Convert.ToInt32(Session["SystemId"]), txtpassword.Text.Trim());
                if (response == LoginResponseCode.Success)
                {
                    DataSet theDS = CurrentSession.Current.UserDetail;
                    Session["AppUserId"]      = Convert.ToString(theDS.Tables[0].Rows[0]["UserId"]);
                    Session["AppUserName"]    = Convert.ToString(theDS.Tables[0].Rows[0]["UserFirstName"]) + " " + Convert.ToString(theDS.Tables[0].Rows[0]["UserLastName"]);
                    Session["EnrollFlag"]     = theDS.Tables[1].Rows[0]["EnrollmentFlag"].ToString();
                    Session["CareEndFlag"]    = theDS.Tables[1].Rows[0]["CareEndFlag"].ToString();
                    Session["IdentifierFlag"] = theDS.Tables[1].Rows[0]["IdentifierFlag"].ToString();
                    Session["UserRight"]      = theDS.Tables[1];
                    DataTable theDT = theDS.Tables[2];
                    Session["AppLocationId"]     = theDT.Rows[0]["FacilityID"].ToString();
                    Session["AppLocation"]       = theDT.Rows[0]["FacilityName"].ToString();
                    Session["AppCountryId"]      = theDT.Rows[0]["CountryID"].ToString();
                    Session["AppPosID"]          = theDT.Rows[0]["PosID"].ToString();
                    Session["AppSatelliteId"]    = theDT.Rows[0]["SatelliteID"].ToString();
                    Session["GracePeriod"]       = theDT.Rows[0]["AppGracePeriod"].ToString();
                    Session["AppDateFormat"]     = theDT.Rows[0]["DateFormat"].ToString();
                    Session["BackupDrive"]       = theDT.Rows[0]["BackupDrive"].ToString();
                    Session["SystemId"]          = theDT.Rows[0]["SystemId"].ToString();
                    Session["AppCurrency"]       = theDT.Rows[0]["Currency"].ToString();
                    Session["AppUserEmployeeId"] = theDS.Tables[0].Rows[0]["EmployeeId"].ToString();
                    Session["DosageFrequency"]   = theDT.Rows[0]["Frequency"].ToString();
                    Session["PatientTrace"]      = "";

                    //Session["AppSystemId"] = theDT.Rows[0]["SystemId"].ToString();

                    #region "ModuleId"
                    Session["AppModule"] = theDS.Tables[3];
                    DataView theSCMDV = new DataView(theDS.Tables[3]);
                    theSCMDV.RowFilter = "ModuleId=201";
                    if (theSCMDV.Count > 0)
                    {
                        Session["SCMModule"] = theSCMDV[0]["ModuleName"];
                    }

                    DataView theSamePointDispenseDV = new DataView(theDS.Tables[3]);
                    theSamePointDispenseDV.RowFilter = "ModuleId=30";
                    if (theSamePointDispenseDV.Count > 0)
                    {
                        Session["SCMSamePointDispense"] = theSamePointDispenseDV[0]["ModuleName"];
                    }


                    Session["BillingON"]        = theDS.Tables[3].Select("ModuleName = 'Billing'").Length > 0;
                    Session["AdmissionWardsON"] = theDS.Tables[3].Select("ModuleName = 'Ward Admission'").Length > 0;
                    #endregion
                    IQWebUtils theIQUtils = new IQWebUtils();
                    //theIQUtils.CreateSessionObject(Session.SessionID);
                    Session["Paperless"] = theDT.Rows[0]["Paperless"].ToString();
                    Session["Program"]   = "";
                    HttpContext.Current.ApplicationInstance.CompleteRequest();

                    // FormsAuthentication.SetAuthCookie(txtuname.Text.Trim(), false);
                    Response.Redirect(redirectURL, false);
                }
                else if (response == LoginResponseCode.PasswordNotMatch)
                {
                    if ((Request.Browser.Cookies))
                    {
                        HttpCookie theCookie = Request.Cookies[txtuname.Text];
                        if (theCookie == null)
                        {
                            HttpCookie theNCookie = new HttpCookie(txtuname.Text);
                            theNCookie.Value = txtuname.Text + ",1";
                            DateTime theNewDTTime = Convert.ToDateTime(ViewState["theCurrentDate"]).AddMinutes(5);
                            theNCookie.Expires = theNewDTTime;
                            Response.Cookies.Add(theNCookie);
                        }

                        else
                        {
                            string[] theVal = (theCookie.Value.ToString()).Split(',');
                            if (Convert.ToInt32(theVal[1]) >= 3 && theCookie.Name == txtuname.Text)
                            {
                                MsgBuilder theBuilder = new MsgBuilder();
                                theBuilder.DataElements["MessageText"] = "User Account Locked. Try again after 5 Mins.";
                                IQCareMsgBox.Show("#C1", theBuilder, this);
                                return;
                            }
                            else
                            {
                                theVal[1]       = (Convert.ToInt32(theVal[1]) + 1).ToString();
                                theCookie.Value = txtuname.Text + "," + theVal[1];
                                DateTime theAddNewDTTime = Convert.ToDateTime(ViewState["theCurrentDate"]).AddMinutes(5);
                                theCookie.Expires = theAddNewDTTime;
                                Response.Cookies.Add(theCookie);
                            }
                        }
                    }
                    IQCareMsgBox.Show("PasswordNotMatch", this);
                    Init_Form();
                    return;
                }
                else if (response == LoginResponseCode.PasswordExpired)
                {
                    string theUrl    = string.Format("{0}", "./AdminForms/frmAdmin_ChangePassword.aspx");
                    string msgString = "Your Password has expired. Please Change it now.\\n";
                    string script    = "<script language = 'javascript' defer ='defer' id = 'changePwdfunction2'>\n";
                    script += "alert('" + msgString + "');\n";
                    string url = Request.RawUrl.ToString();
                    Application["PrvFrm"]      = url;
                    Session["MandatoryChange"] = "1";
                    script += "window.location.href='" + theUrl + "'\n";
                    script += "</script>\n";
                    ClientScript.RegisterStartupScript(this.GetType(), "changePwdfunction2", script);
                }
                else if (response == LoginResponseCode.InvalidLogin)
                {
                    IQCareMsgBox.Show("InvalidLogin", this);
                    Init_Form();
                    return;
                }
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
            }
            finally
            {
                //LoginManager = null;
            }
        }
示例#5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (ddlSupplier.SelectedValue.ToString() == "0")
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["Control"] = "Supplier Name";
                IQCareWindowMsgBox.ShowWindow("BlankDropDown", theBuilder, this);
                ddlSupplier.Focus();
                return;
            }
            if (ddlDestinationStore.SelectedValue.ToString() == "0")
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["Control"] = "Destination Store";
                IQCareWindowMsgBox.ShowWindow("BlankDropDown", theBuilder, this);
                ddlSupplier.Focus();
                return;
            }
            if (ddlPreparedBy.SelectedValue.ToString() == "0")
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["Control"] = "Prepared By";
                IQCareWindowMsgBox.ShowWindow("BlankDropDown", theBuilder, this);
                ddlSupplier.Focus();
                return;
            }
            dtOrdermaster = CreateOrderMasterTable();
            DataRow theDRow = dtOrdermaster.NewRow();

            theDRow["OrderDate"] = dtpOrderDate.Text;
            if (txtOrderNumber.Text != "")
            {
                theDRow["PONumber"] = txtOrderNumber.Text.Trim();
            }

            theDRow["DestStore"]   = Convert.ToInt32(ddlDestinationStore.SelectedValue);
            theDRow["SupplierID"]  = Convert.ToInt32(ddlSupplier.SelectedValue);
            theDRow["PreparedBy"]  = Convert.ToInt32(ddlPreparedBy.SelectedValue);
            theDRow["AthorizedBy"] = Convert.ToInt32(ddlAuthorisedBy.SelectedValue);

            theDRow["UserID"]     = Convert.ToInt32(GblIQCare.AppUserId);
            theDRow["LocationID"] = Convert.ToInt32(GblIQCare.AppLocationId);
            if (IsPOUpdated)
            {
                theDRow["IsRejectedStatus"] = chkRejectedStatus.Checked ? 1 : 0;
                theDRow["POID"]             = GblIQCare.PurchaseOrderID;
            }
            dtOrdermaster.Rows.Add(theDRow);

            //DataTable theGrdTable = (DataTable)dgwItemSubitemDetails.DataSource;
            dtOrderItem = CreateOrderItemTable();

            for (int i = 0; i < dgwItemSubitemDetails.Rows.Count; i++)
            {
                // if (Convert.ToInt32(dgwItemSubitemDetails.Rows[i].Cells[0].Value) > 0)
                if (!string.IsNullOrEmpty(Convert.ToString(dgwItemSubitemDetails.Rows[i].Cells[0].Value)))
                {
                    if (Convert.ToString(dgwItemSubitemDetails.Rows[i].Cells["Units"].Value) == "")
                    {
                        IQCareWindowMsgBox.ShowWindow("PurchaseOrderUnitempty", this);
                        return;
                    }

                    if (Convert.ToString(dgwItemSubitemDetails.Rows[i].Cells["OrderQuantity"].Value) == "0")
                    {
                        IQCareWindowMsgBox.ShowWindow("PurchaseOrderQuantityZero", this);
                        return;
                    }
                    if (string.IsNullOrEmpty(Convert.ToString(dgwItemSubitemDetails.Rows[i].Cells["OrderQuantity"].Value)))
                    {
                        dgwItemSubitemDetails.Rows[i].Cells["OrderQuantity"].Value = 0;
                        IQCareWindowMsgBox.ShowWindow("PurchaseOrderQuantityZero", this);
                        return;
                    }

                    DataRow theDRowItem = dtOrderItem.NewRow();
                    if (GblIQCare.ModePurchaseOrder == 1)
                    {
                        theDRowItem["ItemID"]       = Convert.ToInt32(dgwItemSubitemDetails.Rows[i].Cells[0].Value);
                        theDRowItem["SupplierId"]   = Convert.ToInt32(ddlSupplier.SelectedValue);
                        theDRowItem["BatchID"]      = 0;
                        theDRowItem["ExpiryDate"]   = DBNull.Value;
                        theDRowItem["AvaliableQty"] = 0;
                    }
                    theDRowItem["ItemTypeId"]   = Convert.ToInt32(dgwItemSubitemDetails.Rows[i].Cells["ItemTypeId"].Value);
                    theDRowItem["ItemName"]     = dgwItemSubitemDetails.Rows[i].Cells[0].FormattedValue.ToString();
                    theDRowItem["Quantity"]     = Convert.ToInt32(dgwItemSubitemDetails.Rows[i].Cells["OrderQuantity"].Value);
                    theDRowItem["priceperunit"] = Convert.ToDecimal(dgwItemSubitemDetails.Rows[i].Cells["Price"].Value);
                    theDRowItem["UnitQuantity"] = Convert.ToDecimal(dgwItemSubitemDetails.Rows[i].Cells["UnitQuantity"].Value);

                    dtOrderItem.Rows.Add(theDRowItem);
                }
            }

            if (dtOrderItem.Rows.Count <= 0)
            {
                IQCareWindowMsgBox.ShowWindow("PurchaseOrderItem", this);
                return;
            }
            //bool isDuplicate = false;
            for (int iDupitem = 0; iDupitem < dtOrderItem.Rows.Count; iDupitem++)
            {
                for (int x = iDupitem + 1; x < dtOrderItem.Rows.Count; x++)
                {
                    if (dtOrderItem.Rows[iDupitem]["ItemName"].ToString() == dtOrderItem.Rows[x]["ItemName"].ToString())
                    {
                        //pass message builder message
                        MsgBuilder theBuilder = new MsgBuilder();
                        theBuilder.DataElements["Control"] = dtOrderItem.Rows[iDupitem]["ItemName"].ToString();
                        IQCareWindowMsgBox.ShowWindow("DuplicatePOItems", theBuilder, this);

                        //isDuplicate = true;
                        //break;
                        return;
                    }
                }
            }



            IPurchase objMasterlist = (IPurchase)ObjectFactory.CreateInstance("BusinessProcess.SCM.BPurchase,BusinessProcess.SCM");
            int       ret           = objMasterlist.SavePurchaseOrder(dtOrdermaster, dtOrderItem, IsPOUpdated);

            if (ret > 0)
            {
                IQCareWindowMsgBox.ShowWindow("ProgramSave", this);
                if (GblIQCare.PurchaseOrderID == 0)
                {
                    GblIQCare.PurchaseOrderID = ret;
                }
                formInit();
                return;
            }
        }
示例#6
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            //(Master.FindControl("lblRoot") as Label).Text = "Clinical Forms >>";
            //(Master.FindControl("lblMark") as Label).Visible = false;
            //(Master.FindControl("lblheader") as Label).Text = "Patient History";
            //(Master.FindControl("lblformname") as Label).Text = "Existing Forms";
            (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text     = "Clinical Forms >> ";
            (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text   = "Patient History";
            (Master.FindControl("levelTwoNavigationUserControl1").FindControl("lblformname") as Label).Text = "Existing Forms";
            IPatientHome PatientManager;

            try
            {
                if (Session["urlOrigin"] != null)
                {
                    origin = Session["urlOrigin"].ToString();
                }
                #region "Refresh Patient Records"

                if (null == Session["PatientInformation"] || origin == "greencard")
                {
                    if (PatientService.LoadPatientModuleData(Convert.ToInt32(Session["TechnicalAreaId"]), Convert.ToInt32(Session["PatientId"]), Convert.ToInt32(Session["SystemId"])))
                    {
                    }
                    else
                    {
                        throw new Exception("Patient information could not be retrieved");
                    }
                    //PatientManager = (IPatientHome)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientHome, BusinessProcess.Clinical");
                    //System.Data.DataSet thePDS = PatientManager.GetPatientDetails(Convert.ToInt32(Session["PatientId"]), Convert.ToInt32(Session["SystemId"]), Convert.ToInt32(Session["TechnicalAreaId"]));
                    ////System.Data.DataSet thePDS = PManager.GetPatientDetails(Convert.ToInt32(Request.QueryString["PatientId"]), Convert.ToInt32(Session["SystemId"]));
                    //if (null != thePDS && thePDS.Tables.Count > 0)
                    //{
                    //    Session["PatientInformation"] = thePDS.Tables[0];
                    //}
                    //else
                    //{
                    //    throw new Exception("Patient information could not be retrieved");
                    //}
                }
                #endregion

                // IPatientHome PatientManager;
                PatientManager = (IPatientHome)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientHome, BusinessProcess.Clinical");


                (Master.FindControl("levelTwoNavigationUserControl1").FindControl("lblpntStatus") as Label).Text = Convert.ToString(Session["PatientStatus"]);
                if (!IsPostBack)
                {
                    IFacilitySetup FacilityMaster = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
                    //theFacilityDS = FacilityMaster.GetFacilityList(Convert.ToInt32(Session["SystemId"]), 1001);
                    //theFacilityDS = FacilityMaster.GetSystemBasedLabels(Convert.ToInt32(Session["SystemId"]), 1001, 0);
                    //ViewState["FacilityDS"] = theFacilityDS;
                    //SetPageLabels();
                    //******************************************************//
                    if (Session["PatientId"] == null || Convert.ToString(Session["PatientId"]) == "0")
                    {
                        Session["PatientId"] = Request.QueryString["PatientId"];  //remove it after session of patient set on find add when patient selected from grid.
                    }

                    PId    = Convert.ToString(Session["PatientId"]);
                    PtnSts = Convert.ToString(Session["PatientStatus"]);;
                    if (Session["PatientId"] != null && Convert.ToInt32(Session["PatientId"]) != 0)
                    {
                        PId = Session["PatientId"].ToString();
                    }
                    if (Session["PatientStatus"] != null)
                    {
                        PtnSts = Session["PatientStatus"].ToString();
                    }
                    DataSet theDS = PatientManager.GetPatientHistory(Convert.ToInt32(PId));
                    ViewState["theCFDT"] = theDS.Tables[3].Copy();
                    FormIQCare(theDS);
                }
            }

            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
                return;
            }
            finally
            {
                PatientManager = null;
            }
        }
示例#7
0
        protected Hashtable HT(int qltyFlag)
        {
            Hashtable theHT = new Hashtable();

            try
            {
                theHT.Add("PatientId", Session["PatientId"]);
                theHT.Add("VisitId", Session["PatientVisitId"]);
                theHT.Add("LocationId", Session["AppLocationId"]);
                theHT.Add("UserID", Session["AppUserId"].ToString());
                //todo
                theHT.Add("visitdate", txtVisitDate.Text);
                theHT.Add("VisitTypeId", ddlvisittype.SelectedValue);
                theHT.Add("TransferInFrom", ddltransferfrom.SelectedValue);
                theHT.Add("TransferInDate", txtTransferInDate.Text);
                theHT.Add("TransferInDistrictId", dddistrict.SelectedValue);
                theHT.Add("TransferInFacilityId", ddfacility.SelectedValue);
                theHT.Add("TransferMFLCode", txtMFLCode.Text);
                theHT.Add("TransferInCountryId", ddlCountryFrom.SelectedValue);
                theHT.Add("ARTStartDate", txtDateARTStarted.Text);
                theHT.Add("BaseWHOStage", ddlbaseWHO.SelectedValue);
                theHT.Add("BaseCD4", String.IsNullOrWhiteSpace(Convert.ToString(txtbaseCD4.Text)) ? "0" : Convert.ToString(txtbaseCD4.Text));
                theHT.Add("BaseHepB", rdoHepByes.Checked ? 1 : rdoHepBNo.Checked ? 0 : 9);
                theHT.Add("BasePregnancy", rdobasePrgencyYes.Checked ? 1 : rdobasePrgencyNo.Checked ? 0 : 9);
                theHT.Add("BaseBreastFeeding", rdobasebrestFeedYes.Checked ? 1 : rdobasebrestFeedNo.Checked ? 0 : 9);
                theHT.Add("BaseTBHIV", rdobaseTBYes.Checked ? 1 : rdobaseTBNo.Checked ? 0 : 9);
                theHT.Add("BaseDiscordant", rdoDiscordantYes.Checked ? 1 : rdoDiscordantNo.Checked ? 0 : 9);
                theHT.Add("BaseWeight", txtbaseweight.Text);
                theHT.Add("BaseHeight", txtbaseheight.Text);
                theHT.Add("BaseMUAC", txtbaseMUAC.Text);
                theHT.Add("ARTRegimen", txtFirstARTRegimen.Text);
                theHT.Add("BaseViralLoad", String.IsNullOrWhiteSpace(Convert.ToString(txtBaseViral.Text)) ? "0" : Convert.ToString(txtBaseViral.Text));
                theHT.Add("BaseViralLoadDate", txtbaseviraldate.Text);
                theHT.Add("TransferOutDate", txttransferdate.Text);
                theHT.Add("DeathDate", txtdeathdate.Text);
                theHT.Add("PartnerDisclosure", rdodiclosureyes.Checked ? 1 : rdodiclosureno.Checked ? 0 : 9);
                theHT.Add("PartnerDisclosureDate", txtsexDisDate.Text);
                theHT.Add("AdolPartialDisclosureDate", partDisDate.Text);
                theHT.Add("AdolFullDisclosureDate", txtFullDisDate.Text);
                theHT.Add("INHStartDate", txtINHStartDate.Text);
                theHT.Add("INHCompletion", Inhcompyes.Checked ? 1 : InhcompNo.Checked ? 0 : 9);
                theHT.Add("INHCompletionDate", txtINHCompDate.Text);
                theHT.Add("Measles", txtMeasles.Text);
                theHT.Add("IPV", txtIPV.Text);
                theHT.Add("Penta", txtPenta.Text);
                theHT.Add("PCV", txtPCV.Text);
                theHT.Add("BCG", txtDiphtheria.Text);
                theHT.Add("HBV", txtHBV.Text);
                theHT.Add("Flu", txtFlu.Text);
                theHT.Add("HepatitisB", txtHepatitis.Text);
                theHT.Add("Tetanus", txtTetanus.Text);
                theHT.Add("Pertussis", txtPertussis.Text);
                theHT.Add("Haemophilus", txtHaemophilus.Text);
            }
            catch (Exception err)
            {
                MsgBuilder theMsg = new MsgBuilder();
                theMsg.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theMsg, this);
            }
            return(theHT);
        }
示例#8
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        if (!ValidateLogin())
        {
            Init_Form();
            return;
        }

        IUser LoginManager;

        try
        {
            //CLogger.WriteLog(ELogLevel.INFO, "Form: frmLogin, Method: btnLogin_Click() begin!");
            LoginManager = (IUser)ObjectFactory.CreateInstance("BusinessProcess.Security.BUser, BusinessProcess.Security");
            if (object.Equals(Session["SystemId"], null))
            {
                if (ConfigurationManager.AppSettings["SystemId"] != null)
                {
                    Session["SystemId"] = ConfigurationManager.AppSettings["SystemId"].ToString();
                }
            }

            DataSet theDS = LoginManager.GetUserCredentials(txtuname.Text.Trim(), Convert.ToInt32(ddLocation.SelectedValue), Convert.ToInt32(Session["SystemId"]));
            if (theDS.Tables.Count > 0)
            {
                int FacilityExist = 1;
                if (theDS.Tables[5].Rows.Count > 0)
                {
                    DataView theDV = new DataView();
                    FacilityExist = 0;
                    foreach (DataRow theDR in theDS.Tables[5].Rows)
                    {
                        if (Convert.ToInt32(theDR["GroupId"]) > 1)
                        {
                            theDV           = new DataView(theDS.Tables[1]);
                            theDV.RowFilter = "FacilityID= " + ddLocation.SelectedValue + "";
                            if (theDV.ToTable().Rows.Count > 0)
                            {
                                FacilityExist = 1;
                            }
                        }
                        else if (Convert.ToInt32(theDR["GroupId"]) == 1)
                        {
                            FacilityExist = 1;
                        }
                    }
                }

                if (FacilityExist == 0)
                {
                    IQCareMsgBox.Show("AccessDenied", this);
                    ////CLogger.WriteLog(ELogLevel.INFO, "Form: frmLogin, Method: btnLogin_Click() end!");
                    return;
                }

                if (theDS.Tables[1].Rows.Count == 0)
                {
                    MsgBuilder theBuilder = new MsgBuilder();
                    theBuilder.DataElements["Control"] = "User Group";
                    IQCareMsgBox.Show("BlankList", theBuilder, this);
                    //CLogger.WriteLog(ELogLevel.INFO, "Form: frmLogin, Method: btnLogin_Click() end!");
                    return;
                }

                Utility theUtil = new Utility();
                if (theDS.Tables[0].Rows.Count > 0)
                {
                    //if (theUtil.Decrypt(Convert.ToString(theDS.Tables[0].Rows[0]["Password"])) != txtpassword.Text.Trim())
                    if (Convert.ToString(theDS.Tables[0].Rows[0]["Password"]) != theUtil.Encrypt(txtpassword.Text.Trim().ToString()))
                    {
                        if ((Request.Browser.Cookies))
                        {
                            HttpCookie theCookie = Request.Cookies[txtuname.Text];
                            if (theCookie == null)
                            {
                                HttpCookie theNCookie = new HttpCookie(txtuname.Text);
                                theNCookie.Value = txtuname.Text + ",1";
                                DateTime theNewDTTime = Convert.ToDateTime(ViewState["theCurrentDate"]).AddMinutes(5);
                                theNCookie.Expires = theNewDTTime;
                                Response.Cookies.Add(theNCookie);
                            }

                            else
                            {
                                string[] theVal = (theCookie.Value.ToString()).Split(',');
                                if (Convert.ToInt32(theVal[1]) >= 3 && theCookie.Name == txtuname.Text)
                                {
                                    MsgBuilder theBuilder = new MsgBuilder();
                                    theBuilder.DataElements["MessageText"] = "User Account Locked. Try again after 5 Mins.";
                                    IQCareMsgBox.Show("#C1", theBuilder, this);
                                    return;
                                }
                                else
                                {
                                    theVal[1]       = (Convert.ToInt32(theVal[1]) + 1).ToString();
                                    theCookie.Value = txtuname.Text + "," + theVal[1];
                                    DateTime theAddNewDTTime = Convert.ToDateTime(ViewState["theCurrentDate"]).AddMinutes(5);
                                    theCookie.Expires = theAddNewDTTime;
                                    Response.Cookies.Add(theCookie);
                                }
                            }
                        }
                        IQCareMsgBox.Show("PasswordNotMatch", this);
                        Init_Form();
                        //CLogger.WriteLog(ELogLevel.INFO, "Form: frmLogin, Method: btnLogin_Click() end!");
                        return;
                    }
                    else
                    {
                        HttpCookie theCookie = Request.Cookies[txtuname.Text];
                        if (theCookie != null)
                        {
                            string[] theVal = (theCookie.Value.ToString()).Split(',');
                            if (Convert.ToInt32(theVal[1]) >= 3)
                            {
                                MsgBuilder theBuilder = new MsgBuilder();
                                theBuilder.DataElements["MessageText"] = "User Account Locked. Try again after 5 Mins.";
                                IQCareMsgBox.Show("#C1", theBuilder, this);
                                //CLogger.WriteLog(ELogLevel.INFO, "Form: frmLogin, Method: btnLogin_Click() end!");
                                return;
                            }
                        }
                    }
                }

                else
                {
                    IQCareMsgBox.Show("InvalidLogin", this);
                    Init_Form();
                    //CLogger.WriteLog(ELogLevel.INFO, "Form: frmLogin, Method: btnLogin_Click() end!");
                    return;
                }

                Session["AppUserId"]   = Convert.ToString(theDS.Tables[0].Rows[0]["UserId"]);
                Session["AppUserName"] = Convert.ToString(theDS.Tables[0].Rows[0]["UserFirstName"]) + " " + Convert.ToString(theDS.Tables[0].Rows[0]["UserLastName"]);
                if (!string.IsNullOrEmpty(theDS.Tables[0].Rows[0]["Designation"].ToString()))
                {
                    Session["Signature"] = theDS.Tables[0].Rows[0]["UserName"].ToString() + " - " + theDS.Tables[0].Rows[0]["Designation"].ToString();
                }
                Session["EnrollFlag"]        = theDS.Tables[1].Rows[0]["EnrollmentFlag"].ToString();
                Session["CareEndFlag"]       = "0";
                Session["IdentifierFlag"]    = theDS.Tables[1].Rows[0]["IdentifierFlag"].ToString();
                Session["UserRight"]         = theDS.Tables[1];
                Session["UserFeatures"]      = theDS.Tables[6];
                Session["AppUserCustomList"] = theDS.Tables[7];
                DataTable theDT = theDS.Tables[2];
                Session["AppLocationId"]     = theDT.Rows[0]["FacilityID"].ToString();
                Session["AppLocation"]       = theDT.Rows[0]["FacilityName"].ToString();
                Session["AppCountryId"]      = theDT.Rows[0]["CountryID"].ToString();
                Session["AppPosID"]          = theDT.Rows[0]["PosID"].ToString();
                Session["AppSatelliteId"]    = theDT.Rows[0]["SatelliteID"].ToString();
                Session["GracePeriod"]       = theDT.Rows[0]["AppGracePeriod"].ToString();
                Session["AppDateFormat"]     = theDT.Rows[0]["DateFormat"].ToString();
                Session["BackupDrive"]       = theDT.Rows[0]["BackupDrive"].ToString();
                Session["SystemId"]          = theDT.Rows[0]["SystemId"].ToString();
                Session["AppCurrency"]       = theDT.Rows[0]["Currency"].ToString();
                Session["AppUserEmployeeId"] = theDS.Tables[0].Rows[0]["EmployeeId"].ToString();
                Session["FacilityID"]        = theDT.Rows[0]["FacilityID"].ToString();
                //Session["AppSystemId"] = theDT.Rows[0]["SystemId"].ToString();
                Session["Billing"] = theDT.Rows[0]["Billing"].ToString();
                //Session["Records"] = theDT.Rows[0]["Records"].ToString();
                Session["Wards"]          = theDT.Rows[0]["Wards"].ToString();
                Session["LMIS"]           = theDT.Rows[0]["LMIS"].ToString();
                Application["MasterData"] = theDS.Tables[8];
                #region "ModuleId"
                Session["AppModule"] = theDS.Tables[3];
                //DataView theSCMDV = new DataView(theDS.Tables[3]);
                //theSCMDV.RowFilter = "ModuleId=201";
                if (theDS.Tables[2].Rows[0]["PMSCM"].ToString() == "1")
                {
                    Session["SCMModule"] = "PMSCM";
                }
                #endregion
                IQWebUtils theIQUtils = new IQWebUtils();
                //theIQUtils.CreateSessionObject(Session.SessionID);
                Session["Paperless"] = theDT.Rows[0]["Paperless"].ToString();

                Session["Program"] = "";
                LoginManager       = null;

                //john screen size
                //Session["browserWidth"] = ScreenWidth.Value;
                //Session["browserHeight"] = ScreenHeight.Value;
                ///////////

                /*
                 * Commented by Gaurav & Suggested by Joseph
                 * Purpose: Everytime not to update appoinments
                 * Date: 23 Sept 2014
                 */
                /////////////// Appointment Updates//////////////////
                //UpdateAppointment();
                /////////////////////////////////////////////////////

                if (Convert.ToString(theDS.Tables[0].Rows[0]["forcelogin"]) == "0")
                {
                    string theUrl    = string.Format("{0}", "./AdminForms/frmAdmin_ChangePassword.aspx");
                    String msgString = "First time login: please change your password.\\n";
                    string script    = "<script language = 'javascript' defer ='defer' id = 'changePwd'>\n";
                    script += "alert('" + msgString + "');\n";
                    string url = Request.RawUrl.ToString();
                    Application["PrvFrm"]      = url;
                    Session["MandatoryChange"] = "1";
                    script += "window.location.href='" + theUrl + "'\n";
                    script += "</script>\n";
                    RegisterStartupScript("changePwd", script);
                }
                else if (theDS.Tables[3].Rows[0]["ExpPwdFlag"] != null && Convert.ToString(theDS.Tables[3].Rows[0]["ExpPwdFlag"]) != "")
                {
                    if (Convert.ToInt32(theDS.Tables[0].Rows[0]["UserId"]) != 1)
                    {
                        if (Convert.ToInt32(theDS.Tables[3].Rows[0]["ExpPwdFlag"]) == 1)
                        {
                            //DateTime lastcontDate = Convert.ToDateTime(theDS.Tables[0].Rows[0]["PwdDate"]).AddDays(Convert.ToInt32(theDS.Tables[3].Rows[0]["ExpPwdDays"]));
                            //lastcontDate.AddDays(90);
                            DateTime lastcontDate      = Convert.ToDateTime(theDS.Tables[0].Rows[0]["PwdDate"]);
                            TimeSpan t                 = Convert.ToDateTime(theDS.Tables[4].Rows[0]["CurrentDate"]) - lastcontDate;
                            double   NrOfDaysdiffernce = t.TotalDays;
                            //int result = Convert.ToInt32(theDS.Tables[3].Rows[0]["ExpPwdDays"]) - Convert.ToInt32(NrOfDays);
                            string msgString;
                            string theUrl = string.Format("{0}", "./AdminForms/frmAdmin_ChangePassword.aspx");
                            if (NrOfDaysdiffernce > Convert.ToInt32(theDS.Tables[3].Rows[0]["ExpPwdDays"]))
                            {
                                msgString = "Your Password has expired. Please Change it now.\\n";
                                string script = "<script language = 'javascript' defer ='defer' id = 'changePwdfunction2'>\n";
                                script += "alert('" + msgString + "');\n";
                                string url = Request.RawUrl.ToString();
                                Application["PrvFrm"]      = url;
                                Session["MandatoryChange"] = "1";
                                script += "window.location.href='" + theUrl + "'\n";
                                script += "</script>\n";
                                RegisterStartupScript("changePwdfunction2", script);
                                //ClientScript.RegisterClientScriptBlock(this.GetType(), "changePwdfunction2", script,true);
                            }

                            else
                            {
                                // adding the false parameter value to continue the execution of current page....
                                Response.Redirect("frmFacilityHome.aspx", false);
                                // Response.Redirect("frmFindAddPatient.aspx");
                            }
                        }
                        else
                        {
                            // adding the false parameter value to continue the execution of current page....
                            Response.Redirect("frmFacilityHome.aspx", false);
                            // Response.Redirect("frmFindAddPatient.aspx");
                        }
                    }
                    else
                    {
                        // adding the false parameter value to continue the execution of current page....
                        Response.Redirect("frmFacilityHome.aspx", false);
                        // Response.Redirect("frmFindAddPatient.aspx");
                    }
                }
                else
                {
                    // adding the false parameter value to continue the execution of current page....
                    Response.Redirect("frmFacilityHome.aspx", false);
                    //Response.Redirect("frmFindAddPatient.aspx");
                }

                //Response.Redirect("frmFacilityHomenew.aspx");
            }
            else
            {
                IQCareMsgBox.Show("InvalidLogin", this);
                //CLogger.WriteLog(ELogLevel.INFO, "Form: frmLogin, Method: btnLogin_Click() end!");
                return;
            }
            //CLogger.WriteLog(ELogLevel.INFO, "Form: frmLogin, Method: btnLogin_Click() end!");
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
            CLogger.WriteLog(ELogLevel.ERROR, "Form: frmLogin, Method: btnLogin_Click()", err);
        }
        finally
        {
            LoginManager = null;
        }
    }
示例#9
0
    private Boolean FieldValidation()
    {
        int j = 0;

        for (int i = 0; i < chkOrderLabTests.Items.Count; i++)
        {
            if (chkOrderLabTests.Items[i].Selected == false)
            {
                j = j + 1;
            }
        }

        string LabDate = "";

        if (Request.QueryString["name"] == "Edit")
        {
            if (txtlaborderedbydate.Text != ViewState["TestDatetxt"].ToString())
            {
                foreach (DataRow DR in ((DataTable)ViewState["TestDate"]).Rows)
                {
                    LabDate = String.Format("{0:dd-MMM-yyyy}", DR[0]);
                    if (txtlaborderedbydate.Text == LabDate)
                    {
                        IQCareMsgBox.Show("LaborderTestdate", this);
                        return(false);
                    }
                }
            }
        }
        ////else
        ////{
        ////    foreach (DataRow DR in ((DataTable)ViewState["TestDate"]).Rows)
        ////    {
        ////        LabDate = String.Format("{0:dd-MMM-yyyy}", DR[0]);
        ////        if (txtlaborderedbydate.Text == LabDate)
        ////        {
        ////            IQCareMsgBox.Show("LaborderTestdate", this);
        ////            return false;
        ////        }
        ////    }

        ////}


        if (chkOrderLabTests.Items.Count == j)
        {
            IQCareMsgBox.Show("Laborderchklist", this);
            return(false);
        }

        else if (ddlaborderedbyname.SelectedIndex == 0)
        {
            MsgBuilder theMsg = new MsgBuilder();
            theMsg.DataElements["Control"] = "Ordered By";
            IQCareMsgBox.Show("BlankDropDown", theMsg, this);
            return(false);
        }
        else if (txtlaborderedbydate.Text.ToString() == "")
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["Control"] = "Ordered By Date";
            IQCareMsgBox.Show("BlankTextBox", theBuilder, this);
            txtlaborderedbydate.Focus();
            return(false);
        }

        else if (Convert.ToDateTime(txtlaborderedbydate.Text) > Convert.ToDateTime(Application["AppCurrentDate"]))

        {
            IQCareMsgBox.Show("OrderedToDate", this);
            return(false);
        }
        return(true);
    }
示例#10
0
    protected void btnRemove_Click(object sender, EventArgs e)
    {
        #region Custom Form Section

        #endregion

        //Jayant Start 29-11-2008
        if (Session["PtnRegCTC"] != null && Session["PtnRegCTC"].ToString() == "PtnRegCTC")
        {
            RegistrationCTCRemoveDrug();
        }
        //Jayant End 29-11-2008

        //Jayant Start 27-11-2010
        else if (Session["CustomfrmDrug"].ToString() == "CustomfrmDrug")
        {
            if (Request.QueryString["BtnDrg"] == "customfrmDrug")
            {
                int RemoveDrgtypeID = Convert.ToInt32(Request.QueryString["DrugType"]);

                CustomFormRemoveDrug(RemoveDrgtypeID);
            }
            else if (Request.QueryString["BtnRegimen"] == "customfrmReg")
            {
                int RemoveRegtypeID = Convert.ToInt32(Request.QueryString["RegType"]);
                CustomFormRemoveRegimen(RemoveRegtypeID);
            }
        }
        //Jayant End 27-11-2010
        else
        {
            try
            {
                DataRow   theDR;
                DataTable theDT = (DataTable)Session["DrugTable"];
                theDR    = theDT.NewRow();
                theDR[0] = Convert.ToInt32(lstSelectedDrug.SelectedValue);
                theDR[1] = lstSelectedDrug.SelectedItem.Text;
                DataTable theDT1 = new DataTable();
                if (Request.QueryString["btnreg"].ToString() == "btnRegimenGCFWP")
                {
                    theDT1 = (DataTable)Session["SelectedDataGCFWP"];
                }
                else if (Request.QueryString["btnreg"].ToString() == "btnRegimenGCIE")
                {
                    theDT1 = (DataTable)Session["SelectedDataGCIE"];
                }
                else if (Request.QueryString["btnreg"].ToString() == "btnRegimenGCIEFA")
                {
                    theDT1 = (DataTable)Session["SelectedDataGCIEFA"];
                }
                else
                {
                    theDT1 = (DataTable)Session["SelectedData"];
                }

                DataRow[] theDR1 = theDT1.Select("DrugId=" + lstSelectedDrug.SelectedValue);
                theDR[2] = theDR1[0][2];
                theDR[3] = theDR1[0][3];
                theDT.Rows.Add(theDR);

                DataTable theDT2 = (DataTable)Session["DrugData"];
                DataRow   theDR2 = theDT2.NewRow();
                theDR2[0] = Convert.ToInt32(lstSelectedDrug.SelectedValue);
                theDR2[1] = lstSelectedDrug.SelectedItem.Text;
                theDR2[2] = theDR1[0][2];
                theDR2[3] = theDR1[0][3];
                theDT2.Rows.Add(theDR2);
                Session["DrugData"] = theDT2;

                IQCareUtils theUtils = new IQCareUtils();
                DataView    theDV    = theUtils.GridSort(theDT, "DrugName", "asc");
                theDT = theUtils.CreateTableFromDataView(theDV);
                lstDrugList.DataSource = theDT;
                lstDrugList.DataBind();
                Session["DrugTable"] = theDT;

                theDT1.Rows.Remove(theDR1[0]);
                lstSelectedDrug.DataSource = theDT1;
                lstSelectedDrug.DataBind();
                Session["SelectedData"] = theDT1;
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "")
        {
            IQCareMsgBox.Show("SessionExpired", this);
            Response.Redirect("~/frmlogin.aspx", true);
        }
        (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Visible = false;
        (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text  = "Customise List";
        IDesignation DesignationManager;

        if (!IsPostBack)
        {
            try
            {
                ViewState["TableName"]  = Request.QueryString["TableName"].ToString();
                ViewState["CategoryId"] = Request.QueryString["CategoryId"].ToString();
                ViewState["ListName"]   = Request.QueryString["LstName"].ToString();
                ViewState["FID"]        = Request.QueryString["Fid"].ToString();
                ViewState["Update"]     = Request.QueryString["Upd"].ToString();
                if (Request.QueryString["CCID"] != null)
                {
                    ViewState["CCID"] = Request.QueryString["CCID"].ToString();
                }
                if (Request.QueryString["ModId"].ToString() != "")
                {
                    ViewState["ModuleId"] = Convert.ToInt32(Request.QueryString["ModId"]);
                }

                if (Request.QueryString["Upd"] == "1")
                {
                    DesignationId      = Convert.ToInt32(Request.QueryString["SelectedId"]);
                    DesignationManager = (IDesignation)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDesignation, BusinessProcess.Administration");
                    DataSet theDS = DesignationManager.GetDesignationByID(DesignationId);
                    this.txtDesignationName.Text = theDS.Tables[0].Rows[0]["Designation_Name"].ToString();
                    DesignationName = theDS.Tables[0].Rows[0]["Designation_Name"].ToString();
                    if (theDS.Tables[0].Rows[0]["Status"].ToString() == "Active")
                    {
                        this.ddStatus.SelectedValue = "0";
                    }
                    else
                    {
                        this.ddStatus.SelectedValue = "1";
                    }
                    if (Convert.ToString(theDS.Tables[0].Rows[0]["DisplayMode"]) == "0")
                    {
                        this.rdouserName.Checked = true;
                    }
                    else if (Convert.ToString(theDS.Tables[0].Rows[0]["DisplayMode"]) == "1")
                    {
                        this.rdouserlist.Checked = true;
                    }
                    this.txtSeq.Text = theDS.Tables[0].Rows[0]["Sequence"].ToString();
                }
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
                return;
            }
            finally
            {
                DesignationManager = null;
            }
        }
    }
示例#12
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (FieldValidation() == false)
        {
            return;
        }

        IFacilitySetup FacilityManager;
        IQCareUtils    theUtils = new IQCareUtils();

        if (txtPEPFAR_Fund.Text.Trim() == "")
        {
            txtPEPFAR_Fund.Text = "01-01-1900";
        }
        if (txtPEPFAR_Fund.Text.Trim() != "")
        {
            thePepFarDate = theUtils.MakeDate(txtPEPFAR_Fund.Text);
        }
        try
        {
            if (FileLoad.PostedFile.FileName != "")
            {
                HttpPostedFile theFile = FileLoad.PostedFile;
                theFile.SaveAs(Server.MapPath(string.Format("..//images//{0}", "Login.jpg")));
                theFName = "Login.jpg";
            }
            else if (ViewState["LoginImage"] != null)
            {
                theFName = ViewState["LoginImage"].ToString();
            }
            else
            {
                theFName = "";
            }

            if (chkPreferred.Checked == true)
            {
                Preferred = 1;
            }
            else
            {
                Preferred = 0;
            }

            int Paperless;
            if (chkPaperlessclinic.Checked == true)
            {
                Paperless = 1;
            }
            else
            {
                Paperless = 0;
            }

            DataTable dtModule = AddModule();
            if (Filelogo.PostedFile.FileName != "")
            {
                HttpPostedFile theFilelogo = Filelogo.PostedFile;
                theFilelogo.SaveAs(Server.MapPath(string.Format("..//images//{0}", txtfacilityname.Text + ".jpg")));
            }
            Hashtable htFacilityParameters = new Hashtable();
            htFacilityParameters.Add("FacilityLogo", txtfacilityname.Text + ".jpg");
            htFacilityParameters.Add("FacilityAddress", txtFacAddress.Text);
            htFacilityParameters.Add("FacilityTel", txtFactele.Text);
            htFacilityParameters.Add("FacilityCell", txtFacCell.Text);
            htFacilityParameters.Add("FacilityFax", txtFacFax.Text);
            htFacilityParameters.Add("FacilityEmail", txtFacEmail.Text);
            htFacilityParameters.Add("FacilityFootertext", txtpharmfoottext.Text);
            htFacilityParameters.Add("FacilityURL", txtFacURL.Text);
            htFacilityParameters.Add("Facilitytemplate", this.Radio1.Checked == true ? Radio1.Value.ToString() : (this.Radio2.Checked == true ? Radio2.Value.ToString():"0"));
            htFacilityParameters.Add("StrongPassword", this.chkStrongPwd.Checked == true ? 1 : 0);
            htFacilityParameters.Add("ExpirePaswordFlag", this.chkexpPwd.Checked == true ? 1 : 0);
            htFacilityParameters.Add("ExpirePaswordDays", this.chkexpPwd.Checked == true ? txtnoofdays.Text : "");


            /////////////////////////////////
            if (btnSave.Text == "Save")
            {
                FacilityManager = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");

                int Rows = FacilityManager.SaveNewFacility(txtfacilityname.Text, txtcountryno.Text, txtLPTF.Text, txtSatelliteID.Text, txtNationalId.Text, Convert.ToInt32(ddlprovince.SelectedValue), Convert.ToInt32(ddldistrict.SelectedValue), theFName, Convert.ToInt32(cmbCurrency.SelectedValue), Convert.ToInt32(txtGrace.Text), "dd-MMM-yyyy", Convert.ToDateTime(thePepFarDate), Convert.ToInt32(Session["SystemId"]), Preferred, Paperless, Convert.ToInt32(Session["AppUserId"]), dtModule, htFacilityParameters, getCheckBoxListItemValues(cblStores));
                if (Rows > 0)
                {
                    IQCareMsgBox.Show("FacilityMasterSave", this);
                    if (Session["AppUserName"] != "")
                    {
                        Response.Redirect("frmAdmin_FacilityList.aspx");
                    }
                    else
                    {
                        Response.Redirect("../frmLogOff.aspx");
                    }
                }
                else
                {
                    IQCareMsgBox.Show("FacilityMasterExists", this);
                    return;
                }
            }
            else
            {
                int Paperlessclinic = this.chkPaperlessclinic.Checked == true ? 1 : 0;
                //int PMTCTclinic = this.chkPMTCT.Checked == true ? 1 : 0;|| (Convert.ToInt32(ViewState["PMTCT"])!= PMTCTclinic)
                if ((Convert.ToInt32(ViewState["Paperless"]) != Paperlessclinic))
                {
                    SaveYesNoforPaperless();
                }
                else if (Convert.ToInt32(ViewState["Paperless"]) == Paperlessclinic)
                {
                    FacilityManager = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
                    int Rows = FacilityManager.UpdateFacility(Convert.ToInt32(ViewState["FacilityId"]), txtfacilityname.Text, txtcountryno.Text, txtLPTF.Text, txtSatelliteID.Text, txtNationalId.Text, Convert.ToInt32(ddlprovince.SelectedValue), Convert.ToInt32(ddldistrict.SelectedValue), theFName, Convert.ToInt32(cmbCurrency.SelectedValue), Convert.ToInt32(txtGrace.Text), "dd-MMM-yyyy", Convert.ToDateTime(thePepFarDate), Convert.ToInt32(ddStatus.SelectedValue), Convert.ToInt32(Session["SystemId"]), Preferred, Paperless, Convert.ToInt32(Session["AppUserId"]), dtModule, htFacilityParameters, getCheckBoxListItemValues(cblStores));
                    if (Rows > 0)
                    {
                        IQCareMsgBox.Show("FacilityMasterUpdate", this);
                        Response.Redirect("frmAdmin_FacilityList.aspx");
                    }
                }
                else
                {
                    IQCareMsgBox.Show("FacilityMasterExists", this);
                    return;
                }
            }
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
        }
        finally
        {
            FacilityManager = null;
        }
    }
示例#13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Page.IsPostBack != true)
            {
                if (Session["AppUserName"] != "")
                {
                    AuthenticationManager Authentiaction = new AuthenticationManager();
                    if (Authentiaction.HasFunctionRight(ApplicationAccess.FacilitySetup, FunctionAccess.Add, (DataTable)Session["UserRight"]) == false &&
                        Authentiaction.HasFunctionRight(ApplicationAccess.FacilitySetup, FunctionAccess.Update, (DataTable)Session["UserRight"]) == false)
                    {
                        btnSave.Enabled   = false;
                        btnCancel.Enabled = false;
                    }
                }
                else
                {
                    btnExit.Enabled = false;
                }
                ViewState["FacilityId"] = Convert.ToInt32(Request.QueryString["FacilityId"]);
                if (Convert.ToInt32(ViewState["FacilityId"]) < 1)
                {
                    //(Master.FindControl("lblheader") as Label).Text = "Add Facility";
                    (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Visible = false;
                    (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text  = "Add Facility";
                    lblForm.Text = "Add Facility";
                }
                else
                {
                    //(Master.FindControl("lblheader") as Label).Text = "Edit Facility";
                    (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Visible = false;
                    (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text  = "Edit Facility";
                    lblForm.Text = "Edit Facility";
                }
                //(Master.FindControl("lblMark") as Label).Visible = false;
                ViewState["FacilityDS"] = (DataSet)Session["FacilityDS"];
                //Session.Remove("FacilityDS");

                txtPEPFAR_Fund.Attributes.Add("onkeyup", "DateFormat(this,this.value,event,false,'3')");
                txtPEPFAR_Fund.Attributes.Add("OnBlur", "DateFormat(this,this.value,event,true,'3')");
                Init_Form();
                Fill_Details();
                if (Convert.ToInt32(ViewState["FacilityId"]) == 0)
                {
                    btnSave.Text     = "Save";
                    ddStatus.Enabled = false;
                    IQCareMsgBox.ShowConfirm("FacilitySaveRecord", btnSave);
                }
                else
                {
                    btnSave.Text = "Update";
                    IQCareMsgBox.ShowConfirm("FacilityUpdateRecord", btnSave);
                }
            }

            Page.EnableViewState = true;
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
        }
    }
示例#14
0
    private Boolean FieldValidation()
    {
        if (txtfacilityname.Text.Trim() == "")
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["Control"] = "Facility Name";
            IQCareMsgBox.Show("BlankTextBox", theBuilder, this);
            txtfacilityname.Focus();
            return(false);
        }

        if (txtcountryno.Text.Trim() == "")
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["Control"] = "Country No";
            IQCareMsgBox.Show("BlankTextBox", theBuilder, this);
            txtcountryno.Focus();
            return(false);
        }
        if (txtLPTF.Text.Trim() == "")
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["Control"] = "Facility No";
            IQCareMsgBox.Show("BlankTextBox", theBuilder, this);
            txtLPTF.Focus();
            return(false);
        }
        if (txtSatelliteID.Text.Trim() == "")
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["Control"] = "Satelite No";
            IQCareMsgBox.Show("BlankTextBox", theBuilder, this);
            txtSatelliteID.Focus();
            return(false);
        }

        /* if (ddsatelliteloc.SelectedIndex < 1)
         * {
         *   MsgBuilder theBuilder = new MsgBuilder();
         *   theBuilder.DataElements["Control"] = "Satelite No";
         *   IQCareMsgBox.Show("BlankTextBox", theBuilder, this);
         *   txtcountryno.Focus();
         *   return false;
         * }*/
        if (txtGrace.Text.Trim() == "")
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["Control"] = "Grace Period";
            IQCareMsgBox.Show("BlankTextBox", theBuilder, this);
            txtGrace.Focus();
            return(false);
        }
        if (Convert.ToInt32(txtGrace.Text) < 0)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["Control"] = "Grace Period";
            IQCareMsgBox.Show("GreatThanZero", theBuilder, this);
            txtGrace.Focus();
            return(false);
        }
        if (Convert.ToInt32(cmbCurrency.SelectedValue) < 1)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["Control"] = "Currency";
            IQCareMsgBox.Show("BlankDropDown", theBuilder, this);
            cmbCurrency.Focus();
            return(false);
        }

        if (txtFacAddress.Text.Trim() == "")
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["Control"] = "Facility Address";
            IQCareMsgBox.Show("BlankTextBox", theBuilder, this);
            txtFacAddress.Focus();
            return(false);
        }
        if (txtFactele.Text.Trim() == "")
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["Control"] = "Facility Telephone";
            IQCareMsgBox.Show("BlankTextBox", theBuilder, this);
            txtFactele.Focus();
            return(false);
        }
        if (txtFacEmail.Text.Trim() != "")
        {
            if (IsValidEmailAddress(txtFacEmail.Text) == false)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = "InValid Email";
                IQCareMsgBox.Show("#C1", theBuilder, this);
                txtFacEmail.Focus();
                return(false);
            }
        }
        if (chkexpPwd.Checked && Convert.ToInt32(txtnoofdays.Text) < 0)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["Control"] = "Expire Password No of Days";
            IQCareMsgBox.Show("GreatThanZero", theBuilder, this);
            Page.ClientScript.RegisterStartupScript(this.GetType(), "toggledivnoofdays", "toggle('divnoofdays');", true);
            //divexppwd.Style.Remove("display");
            //divexppwd.Style["display"] = "block";
            txtnoofdays.Focus();
            return(false);
        }

        for (int i = 0; i < cblPMTCT.Items.Count; i++)
        {
            if (cblPMTCT.Items[i].Selected == true)
            {
                flag = true;
                return(flag);
            }
        }

        if (flag == false)
        {
            MsgBuilder theMsg = new MsgBuilder();
            theMsg.DataElements["Control"] = "Select any one technical area";
            IQCareMsgBox.Show("UncheckedButton", theMsg, this);

            return(false);
        }



        return(true);
    }
示例#15
0
        private void ShowGrid(DataTable theDT)
        {
            try
            {
                dgwOpeningStock.Columns.Clear();
                dgwOpeningStock.DataSource = null;

                DataGridViewTextBoxColumn ItemId = new DataGridViewTextBoxColumn();
                ItemId.HeaderText = "Item Id";
                ItemId.Name       = ItemId.DataPropertyName = "ItemId";
                ItemId.Width      = 10;
                ItemId.ReadOnly   = true;
                ItemId.Visible    = false;

                DataGridViewTextBoxColumn ItemName = new DataGridViewTextBoxColumn();
                ItemName.HeaderText = "Item Name";
                ItemName.Name       = ItemName.DataPropertyName = "ItemName";
                ItemName.Width      = 420;
                ItemName.ReadOnly   = true;
                ItemName.Visible    = true;

                DataGridViewTextBoxColumn StoreId = new DataGridViewTextBoxColumn();
                StoreId.HeaderText = "Store";
                StoreId.Name       = StoreId.DataPropertyName = "StoreId";
                StoreId.Width      = 15;
                StoreId.ReadOnly   = true;
                StoreId.Visible    = false;

                DataGridViewTextBoxColumn StoreName = new DataGridViewTextBoxColumn();
                StoreName.HeaderText = "Store";
                StoreName.Name       = StoreName.DataPropertyName = "StoreName";
                StoreName.Width      = 130;
                StoreName.ReadOnly   = true;
                StoreName.Visible    = true;

                DataGridViewTextBoxColumn DispensingUnit = new DataGridViewTextBoxColumn();
                DispensingUnit.HeaderText = "Dispensing Unit";
                DispensingUnit.Name       = DispensingUnit.DataPropertyName = "DispensingUnit";
                DispensingUnit.Width      = 50;
                DispensingUnit.ReadOnly   = true;
                DispensingUnit.Visible    = false;

                DataGridViewTextBoxColumn BatchId = new DataGridViewTextBoxColumn();
                BatchId.HeaderText = "BatchNo";
                BatchId.Name       = BatchId.DataPropertyName = "BatchId";
                BatchId.Width      = 15;
                BatchId.ReadOnly   = true;
                BatchId.Visible    = false;


                DataGridViewTextBoxColumn BatchName = new DataGridViewTextBoxColumn();
                BatchName.HeaderText = "Batch No.";
                BatchName.Name       = BatchName.DataPropertyName = "BatchNo";
                BatchName.Width      = 135;
                BatchName.ReadOnly   = true;
                BatchName.Visible    = true;


                DataGridViewTextBoxColumn ExpiryDate = new DataGridViewTextBoxColumn();
                ExpiryDate.HeaderText = "Expiry Date";
                ExpiryDate.Name       = ExpiryDate.DataPropertyName = "ExpiryDate";
                ExpiryDate.Width      = 120;
                ExpiryDate.ReadOnly   = true;
                ExpiryDate.Visible    = true;

                DataGridViewTextBoxColumn Quantity = new DataGridViewTextBoxColumn();
                Quantity.HeaderText = "Quantity";
                Quantity.Name       = Quantity.DataPropertyName = "Quantity";
                Quantity.Width      = 120;
                Quantity.ReadOnly   = true;
                Quantity.Visible    = true;

                DataGridViewTextBoxColumn OpeningStock = new DataGridViewTextBoxColumn();
                OpeningStock.HeaderText = "OpeningStock";
                OpeningStock.Name       = OpeningStock.DataPropertyName = "OpeningStock";
                OpeningStock.Width      = 10;
                OpeningStock.ReadOnly   = true;
                OpeningStock.Visible    = false;

                //DataGridViewTextBoxColumn TransDate = new DataGridViewTextBoxColumn();
                //TransDate.HeaderText = "TransDate";
                //TransDate.DataPropertyName = "TransDate";
                //TransDate.Width = 10;
                //TransDate.ReadOnly = true;
                //TransDate.Visible = false;

                dgwOpeningStock.Columns.Add(ItemId);
                dgwOpeningStock.Columns.Add(ItemName);
                dgwOpeningStock.Columns.Add(StoreId);
                dgwOpeningStock.Columns.Add(StoreName);
                dgwOpeningStock.Columns.Add(DispensingUnit);
                dgwOpeningStock.Columns.Add(BatchId);
                dgwOpeningStock.Columns.Add(BatchName);
                dgwOpeningStock.Columns.Add(ExpiryDate);
                dgwOpeningStock.Columns.Add(Quantity);
                dgwOpeningStock.Columns.Add(OpeningStock);
                //dgwOpeningStock.Columns.Add(TransDate);
                dgwOpeningStock.AutoGenerateColumns = false;
                dgwOpeningStock.DataSource          = theDT;
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareWindowMsgBox.ShowWindowConfirm("#C1", theBuilder, this);
            }
        }
示例#16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "")
            {
                IQCareMsgBox.Show("SessionExpired", this);
                Response.Redirect("~/frmlogin.aspx", true);
            }
            (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Visible = false;
            (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text  = "User Group Administration";

            if (Request.QueryString["name"] != null)
            {
                lblh3.Text = Request.QueryString["name"];
            }
            try
            {
                if (Page.IsPostBack != true)
                {
                    if (Request.QueryString["name"] != null)
                    {
                        AunthenticationFunction();
                    }
                    if (lblh3.Text == "Add")
                    {
                        MsgBuilder theBuilder = new MsgBuilder();
                        theBuilder.DataElements["Name"] = "User Group Roles";
                        IQCareMsgBox.ShowConfirm("UserGroupDetailSaveRecord", theBuilder, btnsave);
                        lblh3.Text = "Add User Group";
                    }
                    else
                    {
                        MsgBuilder theBuilder = new MsgBuilder();
                        theBuilder.DataElements["Name"] = "User Group Roles";
                        IQCareMsgBox.ShowConfirm("UserGroupDetailUpdateRecord", theBuilder, btnsave);
                        lblh3.Text = "Edit User Group";
                    }

                    if (Request.QueryString["name"] != null && Request.QueryString["name"] == "Edit")
                    {
                        GroupId = Convert.ToInt32(Request.QueryString["GroupID"]);
                        IUserRole UserGroupManager;
                        UserGroupManager = (IUserRole)ObjectFactory.CreateInstance("BusinessProcess.Administration.BUserRole, BusinessProcess.Administration");
                        DataSet       theDS       = UserGroupManager.GetUserGroupFeatureList(1, 0);
                        BindFunctions BindManager = new BindFunctions();
                        DataView      DVDD        = new DataView(theDS.Tables[4]);
                        DVDD.RowFilter = "GroupID <> " + GroupId + "";
                        BindManager.BindCombo(ddGroupName, DVDD.ToTable(), "GroupName", "GroupID");
                        ViewState["DataPopulate"] = theDS;
                        //GetGeneralDataforTreeView(theDS.Tables[1]);
                        //GetModuleCustomListTreeView(theDS.Tables[3]);
                        //GetCommonItemsinTreeView(theDS.Tables[0]);
                        //GetSPlPriviledgesinTreeView(theDS.Tables[5]);
                        DataSet theOtherDS = UserGroupManager.GetUserGroupFeatureListByID(GroupId);
                        GetFacilityServiceUserGroupData(theOtherDS);
                        txtusergroupname.Text = Request.QueryString["Grpnm"].ToString();
                    }
                    else if (Request.QueryString["name"] != null && Request.QueryString["name"] == "Add")
                    {
                        IUserRole UserGroupManager;
                        UserGroupManager = (IUserRole)ObjectFactory.CreateInstance("BusinessProcess.Administration.BUserRole, BusinessProcess.Administration");
                        DataSet       theDS       = UserGroupManager.GetUserGroupFeatureList(1, 0);
                        BindFunctions BindManager = new BindFunctions();
                        DataView      DVDD        = new DataView(theDS.Tables[4]);
                        DVDD.RowFilter = "GroupID <> " + GroupId + "";
                        BindManager.BindCombo(ddGroupName, DVDD.ToTable(), "GroupName", "GroupID");
                        ViewState["DataPopulate"] = theDS;
                        //GetGeneralDataforTreeView(theDS.Tables[1]);
                        //GetModuleCustomListTreeView(theDS.Tables[3]);
                        //GetCommonItemsinTreeView(theDS.Tables[0]);
                        //GetSPlPriviledgesinTreeView(theDS.Tables[5]);
                    }
                }
            }
            catch (Exception err)
            {
                MsgBuilder theMsgBuilder = new MsgBuilder();
                theMsgBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theMsgBuilder, this);
                return;
            }
            finally
            {
            }
        }
    protected Boolean Validation()
    {
        string  Msg   = "";
        DataSet theDS = (DataSet)ViewState["MstDS"];

        //----incase of add - check
        //1.if same unit already exists
        //2. if default is being saved, then chk if anything else is already default

        //---- incase of edit - check
        //1. if default is being saved, then chk if anything else is already default

        if (txtLower.Text == "")
        {
            MsgBuilder theMsg = new MsgBuilder();
            theMsg.DataElements["Control"] = "Lower Boundary";
            IQCareMsgBox.Show("BlankTextBox", theMsg, this);
            return(false);
        }
        if (txtUpper.Text == "")
        {
            MsgBuilder theMsg = new MsgBuilder();
            theMsg.DataElements["Control"] = "Upper Boundary";
            IQCareMsgBox.Show("BlankTextBox", theMsg, this);
            return(false);
        }
        if (ddUnit.SelectedIndex == 0)
        {
            MsgBuilder theMsg = new MsgBuilder();
            theMsg.DataElements["Control"] = "Unit";
            IQCareMsgBox.Show("BlankDropDown", theMsg, this);
            return(false);
        }
        if (Convert.ToDecimal(txtLower.Text) > Convert.ToDecimal(txtUpper.Text))
        {
            IQCareMsgBox.Show("Boundary", this);
            txtUpper.Focus();
            return(false);
        }

        //if (txtOperation.Value == "ADD")
        if (txtOperation.Value == "")
        {
            foreach (DataRow theDR in theDS.Tables[1].Rows)
            {
                if (theDR["UnitID"].ToString() == ddUnit.SelectedValue.ToString())
                {
                    IQCareMsgBox.Show("UnitExists", this);
                    ddUnit.Focus();
                    return(false);
                }
                //if ((theDR["DefaultUnit"].ToString() == "Yes") && (ddDefault.SelectedIndex ==1))
                {
                    //IQCareMsgBox.Show("DefaultUnitExists", this);
                    //ddDefault.Focus();
                    //return false;
                }
            }
        }
        else if (txtOperation.Value == "EDIT")
        {
            //dont let any "Yes" to be converted to "No"
            if ((ViewState["Default"].ToString() == "Yes") && (ddDefault.SelectedIndex == 0)) //for selected labtest original is yes/no
            {
                IQCareMsgBox.Show("ChooseOtherDefault", this);
                ddDefault.Focus();
                return(false);
            }
        }
        return(true);
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        IDrugMst DrugManager    = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration");
        string   strRegimenName = txtRegimenName.Text;
        string   strRegimeCode  = txtRegimenCode.Text;
        string   strStage       = ddStage.SelectedItem.Value.ToString();
        string   strStatus      = ddStatus.SelectedItem.Value;
        int      intSrNo        = 0;



        if (txtSeqNo.Text != "")
        {
            intSrNo = Convert.ToInt32(txtSeqNo.Text);
        }
        string strGeneric = "";


        if (lstGeneric.Items.Count > 0)
        {
            foreach (ListItem lstItem in lstGeneric.Items)
            {
                if (strGeneric == "")
                {
                    strGeneric = lstItem.Value.ToString();
                }
                else
                {
                    strGeneric = strGeneric + "," + lstItem.Value.ToString();
                }
            }
        }
        if (btnSave.Text == "Save")
        {
            try
            {
                if (strRegimenName != "")
                {
                    //if (FieldValidation() == false)
                    //{
                    //    return;
                    //}
                    int therows = DrugManager.SaveUpdateRegimenGeneric(strRegimenName, strRegimeCode, 0, strStage, Convert.ToInt32(strStatus), strGeneric, Convert.ToInt32(Session["AppUserId"]), intSrNo, 1);
                    Response.Redirect("frmAdmin_RegimenGenericList.aspx");
                }
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
                return;
            }
        }
        if (btnSave.Text == "Update")
        {
            try
            {
                if (strRegimenName != "")
                {
                    int therows = DrugManager.SaveUpdateRegimenGeneric(strRegimenName, strRegimeCode, Convert.ToInt32(Session["rid"]), strStage, Convert.ToInt32(strStatus), strGeneric, Convert.ToInt32(Session["AppUserId"]), intSrNo, 2);
                    Response.Redirect("frmAdmin_RegimenGenericList.aspx");
                }
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
                return;
            }
        }
    }
示例#19
0
        /// <summary>
        /// Handles the SelectedNodeChanged event of the TreeViewExisForm control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        protected void TreeViewExisForm_SelectedNodeChanged(object sender, EventArgs e)
        {
            if (TreeViewExisForm.SelectedNode.Value == "")
            {
                return;
            }

            string[] theName  = TreeViewExisForm.SelectedNode.Text.Split('(');
            string[] theValue = TreeViewExisForm.SelectedNode.Value.Split('%');
            string   url      = "";
            string   PgName;

            Session["PatientId"]         = Convert.ToInt32(theValue[0]);
            Session["PatientVisitId"]    = Convert.ToInt32(theValue[1]);
            Session["ServiceLocationId"] = Convert.ToInt32(theValue[2]);
            Session["PatientStatus"]     = Convert.ToInt32(theValue[3]);
            Session["CEModule"]          = theValue[4].ToString();

            Session["Redirect"] = "1";
            string strFormName = theName[0];

            if (strFormName.Contains("Service Request"))
            {
                Guid g = Guid.NewGuid();
                url = string.Format("{0}", "~/./ClinicalService/ServiceSubmitResult.aspx?key=" + g.ToString());
                Session["PatientClientId"] = Convert.ToInt32(theValue[0]);
                Response.Redirect(url);
            }
            else
            {
                switch (theName[0].Trim())
                {
                case "Patient Registration":
                    //url = string.Format("{0}", "~/frmPatientRegistration.aspx");
                    url = string.Format("{0}", "~/Patient/Registration.aspx");
                    Response.Redirect(url);
                    break;

                case "HIV-Enrollment":
                    if (Convert.ToInt32(Session["TechnicalAreaId"]) == 2)
                    {
                        if (Session["SystemId"].ToString() == "1")
                        {
                            PgName = "frmClinical_Enrolment.aspx";
                        }
                        else
                        {
                            PgName = "frmClinical_PatientRegistrationCTC.aspx";
                        }
                        url = string.Format("{0}", "" + PgName + "");
                        Response.Redirect(url);
                    }
                    break;

                case "Initial Evaluation":
                    if (Convert.ToInt32(Session["TechnicalAreaId"]) == 2)
                    {
                        url = string.Format("{0}", "./frmClinical_InitialEvaluation.aspx");
                        Response.Redirect(url);
                    }
                    break;


                case "Prior ART/HIV Care":
                    if (Convert.ToInt32(Session["TechnicalAreaId"]) == 202)
                    {
                        url = string.Format("{0}", "./frm_PriorArt_HivCare.aspx");
                        Response.Redirect(url);
                    }
                    break;

                case "ART Care":
                    if (Convert.ToInt32(Session["TechnicalAreaId"]) == 202)
                    {
                        url = string.Format("{0}", "./frmClinical_ARTCare.aspx");
                        Response.Redirect(url);
                    }
                    break;

                //********************//
                //john - start
                case "ART Therapy":
                    if (Convert.ToInt32(Session["TechnicalAreaId"]) == 203)
                    {
                        url = string.Format("{0}", "./frmClinical_ARVTherapy.aspx");
                        Response.Redirect(url);
                    }
                    break;
                //john - end

                case "ART History":
                    if (Convert.ToInt32(Session["TechnicalAreaId"]) == 203)
                    {
                        url = string.Format("{0}", "./frmClinical_ARTHistory.aspx");
                        Response.Redirect(url);
                    }
                    break;

                case "Pharmacy":
                    //if (Convert.ToInt32(Session["TechnicalAreaId"]) == 2)
                    //{
                    if (Session["SystemId"].ToString() == "1")
                    {
                        url = string.Format("{0}", "~/./Pharmacy/frmPharmacyForm.aspx");
                        Response.Redirect(url);
                    }
                    else
                    {
                        url = string.Format("{0}", "~/./Pharmacy/frmPharmacy_CTC.aspx");
                        Response.Redirect(url);
                    }
                    //}
                    break;

                case "Paediatric Pharmacy":
                    //if (Convert.ToInt32(Session["TechnicalAreaId"]) == 2)
                    //{
                    url = string.Format("{0}", "~/./Pharmacy/frmPharmacyForm.aspx");
                    Response.Redirect(url);
                    //}
                    break;

                case "ART Follow-Up":
                    //if (Convert.ToInt32(Session["TechnicalAreaId"]) == 2)
                    //{
                    //url = string.Format("{0}&patientid={1}&visitid={2}&locationid={3}&sts={4}", "./frmClinical_ARTFollowup.aspx?name=Edit", Convert.ToInt32(PId), theDR["OrderNo"].ToString(), theDR["LocationID"].ToString(), PtnARTStatus);
                    url = string.Format("{0}", "./frmClinical_ARTFollowup.aspx");
                    //theFrmRoot.NavigateUrl = url;
                    Response.Redirect(url);
                    //}
                    break;

                case "HIV Care/ART Encounter":
                    url = string.Format("{0}", "./frmClinical_HIVCareARTCardEncounter.aspx");
                    Response.Redirect(url);
                    break;

                case "Initial and Follow up Visits":
                    url = string.Format("{0}", "./frmClinical_InitialFollowupVisit.aspx");
                    Response.Redirect(url);
                    break;

                case "Laboratory":
                    // if (Session["Paperless"].ToString() == "0")
                    url = string.Format("{0}", "~/./Laboratory/LabResultPage.aspx");
                    //else
                    //{
                    //    // url = string.Format("{0}", "~/./Laboratory/frmDynamicLab.aspx");
                    //    url = string.Format("{0}", "~/./Laboratory/LabRequestForm.aspx?mode=results");
                    //}
                    Response.Redirect(url);

                    break;

                case "X-Ray":
                    if (Session["Paperless"].ToString() == "1")
                    {
                        url = string.Format("{0}", "~/./Laboratory/frmDynamicLab.aspx?mode=xray");
                    }
                    else
                    {
                        url = string.Format("{0}", "~/./Laboratory/frmLabOrder.aspx");
                    }
                    Response.Redirect(url);


                    break;

                case "Home Visit":
                    url = string.Format("{0}", "~/./Scheduler/frmScheduler_HomeVisit.aspx");
                    Response.Redirect(url);
                    break;

                case "Non-ART Follow-Up":
                    if (Convert.ToInt32(Session["TechnicalAreaId"]) == 2)
                    {
                        url = string.Format("{0}", "./frmClinical_NonARTFollowUp.aspx");
                        Response.Redirect(url);
                    }
                    break;

                case "Care Tracking":
                    url = string.Format("{0}", "~/./Scheduler/frmScheduler_ContactCareTracking.aspx");
                    Response.Redirect(url);
                    // theFrmRoot.NavigateUrl = url;
                    break;

                    //default: break;
                }
            }
            foreach (DataRow DRCustomFrm in ((DataTable)ViewState["theCFDT"]).Rows)
            {
                if (DRCustomFrm["FeatureName"].ToString() == theName[0].Trim())
                {
                    DataView theDV = new DataView((DataTable)ViewState["theCFDT"]);
                    theDV.RowFilter = "FeatureName='" + theName[0].Trim() + "'";
                    DataTable dtview = theDV.ToTable();
                    Session["FeatureID"] = Convert.ToString(dtview.Rows[0]["FeatureID"]);
                    AuthenticationManager Authentication = new AuthenticationManager();
                    if (Authentication.HasFunctionRight(Convert.ToInt32(dtview.Rows[0]["FeatureID"]), FunctionAccess.View, (DataTable)Session["UserRight"]) == true)
                    {
                        //url = string.Format("{0}", "./frmClinical_CustomForm.aspx");
                        url = string.Format("{0}", "~/ClinicalForms/CustomForm.aspx");
                        Response.Redirect(url);
                    }
                    else
                    {
                        MsgBuilder theBuilder = new MsgBuilder();
                        theBuilder.DataElements["MessageText"] = "You are Not Authorized to Access this Form.";
                        IQCareMsgBox.Show("#C1", theBuilder, this);
                    }
                }
            }

            TreeViewExisForm.SelectedNode.NavigateUrl = url;
        }
        private void ShowGrid(DataTable theDT)
        {
            try
            {
                dgwDisposeItem.Columns.Clear();
                dgwDisposeItem.DataSource = null;

                DataGridViewTextBoxColumn ItemCode = new DataGridViewTextBoxColumn();
                ItemCode.HeaderText       = "Item Code";
                ItemCode.DataPropertyName = "ItemId";
                ItemCode.Width            = 50;
                ItemCode.ReadOnly         = true;
                ItemCode.Visible          = false;


                DataGridViewTextBoxColumn ItemName = new DataGridViewTextBoxColumn();
                ItemName.HeaderText       = "Item Name";
                ItemName.DataPropertyName = "ItemName";
                ItemName.Width            = 270;
                ItemName.ReadOnly         = true;

                DataGridViewTextBoxColumn BatchId = new DataGridViewTextBoxColumn();
                BatchId.HeaderText       = "Batch No";
                BatchId.DataPropertyName = "BatchId";
                BatchId.Width            = 50;
                BatchId.ReadOnly         = true;
                BatchId.Visible          = false;


                DataGridViewTextBoxColumn BatchName = new DataGridViewTextBoxColumn();
                BatchName.HeaderText       = "Batch No.";
                BatchName.DataPropertyName = "BatchName";
                BatchName.Width            = 100;
                BatchName.ReadOnly         = true;

                DataGridViewTextBoxColumn Quantity = new DataGridViewTextBoxColumn();
                Quantity.HeaderText       = "Quantity";
                Quantity.DataPropertyName = "Quantity";
                Quantity.Width            = 70;
                Quantity.ReadOnly         = true;

                DataGridViewTextBoxColumn DispensingUnit = new DataGridViewTextBoxColumn();
                DispensingUnit.HeaderText       = "Dispensing Unit";
                DispensingUnit.DataPropertyName = "DispensingUnit";
                DispensingUnit.Width            = 120;
                DispensingUnit.ReadOnly         = true;

                DataGridViewTextBoxColumn ExpiryDate = new DataGridViewTextBoxColumn();
                ExpiryDate.HeaderText       = "Expiry Date";
                ExpiryDate.DataPropertyName = "ExpiryDate";
                ExpiryDate.Width            = 100;
                ExpiryDate.ReadOnly         = true;

                DataGridViewTextBoxColumn TotalPurchasePrice = new DataGridViewTextBoxColumn();
                TotalPurchasePrice.HeaderText       = "Total Purchase Price";
                TotalPurchasePrice.DataPropertyName = "TotPurcPrice";
                TotalPurchasePrice.Width            = 130;
                TotalPurchasePrice.ReadOnly         = true;

                DataGridViewTextBoxColumn UnitPrice = new DataGridViewTextBoxColumn();
                UnitPrice.HeaderText       = "Unit Price";
                UnitPrice.DataPropertyName = "DispensingUnitPrice";
                UnitPrice.Width            = 80;
                UnitPrice.ReadOnly         = true;

                DataGridViewCheckBoxColumn chkDispose = new DataGridViewCheckBoxColumn();
                chkDispose.HeaderText       = "Dispose";
                chkDispose.DataPropertyName = "Dispose";
                chkDispose.Width            = 80;

                dgwDisposeItem.Columns.Add(ItemCode);
                dgwDisposeItem.Columns.Add(ItemName);
                dgwDisposeItem.Columns.Add(BatchId);
                dgwDisposeItem.Columns.Add(BatchName);
                dgwDisposeItem.Columns.Add(Quantity);
                dgwDisposeItem.Columns.Add(DispensingUnit);
                dgwDisposeItem.Columns.Add(ExpiryDate);
                dgwDisposeItem.Columns.Add(TotalPurchasePrice);
                dgwDisposeItem.Columns.Add(UnitPrice);
                dgwDisposeItem.Columns.Add(chkDispose);
                dgwDisposeItem.AutoGenerateColumns = false;
                dgwDisposeItem.DataSource          = theDT;
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareWindowMsgBox.ShowWindowConfirm("#C1", theBuilder, this);
            }
        }
示例#21
0
        private void ShowGrid(DataTable theDT)
        {
            try
            {
                dgwFormDetails.Columns.Clear();
                dgwFormDetails.AutoGenerateColumns = false;
                dgwFormDetails.DataSource          = null;
                DataGridViewTextBoxColumn col1 = new DataGridViewTextBoxColumn();
                col1.HeaderText       = "Home Page Name";
                col1.DataPropertyName = "FeatureName";
                col1.Width            = 268;
                col1.ReadOnly         = true;

                DataGridViewTextBoxColumn col2 = new DataGridViewTextBoxColumn();
                col2.HeaderText       = "Service";
                col2.DataPropertyName = "ModuleName";
                col2.Width            = 270;
                col2.ReadOnly         = true;

                DataGridViewTextBoxColumn col3 = new DataGridViewTextBoxColumn();
                col3.HeaderText       = "Updated By";
                col3.DataPropertyName = "UserName";
                col3.Width            = 150;
                col3.ReadOnly         = true;

                DataGridViewTextBoxColumn col4 = new DataGridViewTextBoxColumn();
                col4.HeaderText       = "Last Updated";
                col4.DataPropertyName = "ModifiedDate";
                col4.Width            = 150;
                col4.ReadOnly         = true;

                DataGridViewTextBoxColumn col5 = new DataGridViewTextBoxColumn();
                col5.HeaderText       = "Published";
                col5.DataPropertyName = "Published";
                col5.Width            = 100;
                col5.ReadOnly         = true;

                DataGridViewTextBoxColumn col6 = new DataGridViewTextBoxColumn();
                col6.HeaderText       = "FeatureID";
                col6.DataPropertyName = "FeatureID";
                col6.Width            = 0;
                col6.Visible          = false;


                DataGridViewTextBoxColumn col7 = new DataGridViewTextBoxColumn();
                col7.HeaderText       = "ModuleID";
                col7.DataPropertyName = "ModuleID";
                col7.Width            = 0;
                col7.Visible          = false;

                dgwFormDetails.DefaultCellStyle.ForeColor = System.Drawing.Color.Black;
                dgwFormDetails.DefaultCellStyle.Font.Size.Equals(12);
                dgwFormDetails.ColumnHeadersDefaultCellStyle.Font.Bold.Equals(true);

                dgwFormDetails.Columns.Add(col1);
                dgwFormDetails.Columns.Add(col2);
                dgwFormDetails.Columns.Add(col3);
                dgwFormDetails.Columns.Add(col4);
                dgwFormDetails.Columns.Add(col5);
                dgwFormDetails.Columns.Add(col6);
                dgwFormDetails.Columns.Add(col7);
                dgwFormDetails.DataSource = theDT;
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareWindowMsgBox.ShowWindowConfirm("#C1", theBuilder, this);
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "")
        {
            IQCareMsgBox.Show("SessionExpired", this);
            Response.Redirect("~/frmlogin.aspx", true);
        }
        IDrugMst DrugManager;

        try
        {
            DrugManager = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration");
            if (IsPostBack != true)
            {
                ViewState["Type"]     = Request.QueryString["Type"].ToString();
                ViewState["DrugType"] = Request.QueryString["DrugType"].ToString();
                ViewState["DrugData"] = (DataTable)Session["DrugData"];
                if (Session["SelectedData"] != null)
                {
                    ViewState["SelectedData"] = (DataTable)Session["SelectedData"];
                }
                Session.Remove("DrugData");
                Session.Remove("SelectedData");
                if (Request.QueryString["Page"] != null)
                {
                    if (Request.QueryString["Page"].ToString() == "RegimenGeneric")
                    {
                        showAbbv.Visible = false;
                    }
                    else
                    {
                        showAbbv.Visible = true;
                    }
                    if (Request.QueryString["Page"].ToString() == "TBRegimenGeneric")
                    {
                        showAbbv.Visible = false;
                    }
                    else
                    {
                        showAbbv.Visible = true;
                    }
                }
                Init_Form();
            }

            if (ViewState["Type"] != null)
            {
                if (ViewState["Type"].ToString() == "Strength")
                {
                    lblHeader.Text = "Drug Strength Mapping";
                }
                else if (ViewState["Type"].ToString() == "Frequency")
                {
                    lblHeader.Text = "Drug Frequency Mapping";
                }
                else
                {
                    lblHeader.Text = "Drug Generic Mapping";
                }
                lstAvailable.Focus();
            }
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
            return;
        }
        finally
        {
            DrugManager = null;
        }
    }
示例#23
0
    /////////////////////////////////////////////////////////////////////
    // Code Written By   : Sanjay Rana
    // Written Date      : 25th July 2006
    // Modification Date :
    // Description       : Drug List
    //
    /// /////////////////////////////////////////////////////////////////


    protected void Page_Load(object sender, EventArgs e)
    {
        IDrugMst DrugManager;

        try
        {
            if (!IsPostBack)
            {
                //(Master.FindControl("lblRoot") as Label).Text = " » Customize Lists";
                //(Master.FindControl("lblMark") as Label).Visible = false;
                //(Master.FindControl("lblheader") as Label).Text = "Drugs";
                (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text   = "Customize Lists >> ";
                (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = "Drugs";

                //checking the NULL condition, if user close the page without doing anything......
                //ViewState["FID"] = Request.QueryString["Fid"].ToString(); commented on 23 Jan 2014
                if (!string.IsNullOrEmpty(Request.QueryString["Fid"]))
                {
                    ViewState["FID"] = Request.QueryString["Fid"].ToString();
                }


                DrugManager = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration");
                //pr_Admin_SelectDrug_Constella
                DataSet theDS = DrugManager.GetDrug();
                MakeDrugList(theDS);//11Mar08
                //--------- 11Mar08---------
                //string theStr;
                //foreach (DataRow theDR in theDS.Tables[0].Rows)
                //{
                //    theStr = theDR["DrugGeneric"].ToString();
                //    if (theStr.IndexOf("/") != -1)
                //        theStr = theStr.Replace("/", "/ ");
                //    theDR["DrugGeneric"] = theStr;

                //    theStr = theDR["GenericAbbv"].ToString();
                //    if (theStr.IndexOf("/") != -1)
                //        theStr = theStr.Replace("/", "/ ");
                //    theDR["GenericAbbv"] = theStr;

                //}
                //grdMasterDrugs.DataSource = theDS.Tables[0];
                //BindGrid();
                //--------------------------
                AuthenticationManager Authentication = new AuthenticationManager();
                if (Authentication.HasFunctionRight(22, FunctionAccess.Add, (DataTable)Session["UserRight"]) == false)
                {
                    btnAdd.Enabled = false;
                }
                //if (Authentication.HasFunctionRight(Convert.ToInt32(ViewState["FID"]), FunctionAccess.Add, (DataTable)Session["UserRight"]) == false)
                //{
                //    btnAdd.Enabled = false;
                //}
            }
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
            return;
        }
        finally
        {
            DrugManager = null;
        }
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        try
        {
            if (lstAvailable.SelectedIndex >= 0)
            {
                BindFunctions BindManager = new BindFunctions();
                IQCareUtils   theUtils    = new IQCareUtils();

                if (Request.QueryString["Type"] == "Strength")
                {
                    DataRow   theDR;
                    DataTable theDTAvail = (DataTable)ViewState["MasterTable"];

                    DataTable theDTSel = (DataTable)ViewState["SelectedData"];

                    DataView theDV = new DataView(theDTAvail);
                    theDV.RowFilter = "StrengthId =" + lstAvailable.SelectedValue;
                    theDR           = theDTSel.NewRow();
                    theDR[0]        = Convert.ToInt32(theDV[0][0]);
                    theDR[1]        = theDV[0][1].ToString();
                    theDTSel.Rows.Add(theDR);
                    lstSelected.DataSource = theDTSel;
                    lstSelected.DataBind();
                    ViewState["SelectedData"] = theDTSel;

                    DataRow[] theDR1 = theDTAvail.Select("StrengthId='" + lstAvailable.SelectedValue + "'");
                    theDTAvail.Rows.Remove(theDR1[0]);
                    lstAvailable.DataSource = theDTAvail;
                    lstAvailable.DataBind();
                    ViewState["MasterTable"] = theDTAvail;
                }
                else if (Request.QueryString["Type"] == "Frequency")
                {
                    DataRow   theDR;
                    DataTable theDTAvail = (DataTable)ViewState["MasterTable"];

                    DataTable theDTSel = (DataTable)ViewState["SelectedData"];

                    DataView theDV = new DataView(theDTAvail);
                    theDV.RowFilter = "Id =" + lstAvailable.SelectedValue;
                    theDR           = theDTSel.NewRow();
                    theDR[0]        = Convert.ToInt32(theDV[0][0]);             ////(lstAvailable.SelectedValue);
                    theDR[1]        = theDV[0][1].ToString();
                    theDTSel.Rows.Add(theDR);
                    lstSelected.DataSource = theDTSel;
                    lstSelected.DataBind();
                    ViewState["SelectedData"] = theDTSel;

                    theDR = null;
                    theDV.Dispose();
                    // theDR[2] = "";
                    /////lstAvailable.SelectedItem.Text;

                    DataRow[] theDR1;
                    theDR1 = theDTAvail.Select("Id='" + lstAvailable.SelectedValue + "'");
                    theDTAvail.Rows.Remove(theDR1[0]);
                    lstAvailable.DataSource = theDTAvail;
                    lstAvailable.DataBind();
                    ViewState["MasterTable"] = theDTAvail;
                }
                else
                {
                    DataRow   theDR;
                    DataTable theDTAvail = (DataTable)ViewState["MasterTable"];

                    //if (ViewState["DrugStrengthSel"] != null)
                    //{
                    DataTable theDTSel = (DataTable)ViewState["SelectedData"];

                    DataView theDV = new DataView(theDTAvail);
                    theDV.RowFilter = "GenericId =" + lstAvailable.SelectedValue;
                    theDR           = theDTSel.NewRow();
                    theDR[0]        = Convert.ToInt32(theDV[0][0]);             ////(lstAvailable.SelectedValue);
                    theDR[1]        = theDV[0][1].ToString();
                    theDR[2]        = theDV[0]["GenericAbbrevation"];
                    /////lstAvailable.SelectedItem.Text;
                    theDTSel.Rows.Add(theDR);
                    lstSelected.DataSource = theDTSel;
                    lstSelected.DataBind();
                    ViewState["SelectedData"] = theDTSel;

                    DataRow[] theDR1 = theDTAvail.Select("GenericId=" + lstAvailable.SelectedValue);
                    theDTAvail.Rows.Remove(theDR1[0]);
                    lstAvailable.DataSource = theDTAvail;
                    lstAvailable.DataBind();
                    ViewState["MasterTable"] = theDTAvail;
                }
            }
            else
            {
                IQCareMsgBox.Show("NoItemToAdd", this);
            }
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
        }
    }
示例#25
0
        private void BindGrid(DataSet theDS)
        {
            try
            {
                dgwItemSubitemDetails.Columns.Clear();
                dgwItemSubitemDetails.AutoGenerateColumns = false;
                dgwItemSubitemDetails.AllowUserToAddRows  = false;
                DataGridViewComboBoxColumn theColumnItemName = new DataGridViewComboBoxColumn();
                // ComboBox theColumnItemName = new ComboBox();
                theColumnItemName.HeaderText       = "Item Name";
                theColumnItemName.Name             = "ItemName";
                theColumnItemName.DataPropertyName = "ItemId";
                if (GblIQCare.ModePurchaseOrder == 1)
                {
                    DataView theItemDV;
                    theItemDV = new DataView(theDS.Tables[0]);

                    theItemDV.RowFilter = "SupplierId =" + ddlSupplier.SelectedValue.ToString();

                    DataTable theComDT = theItemDV.ToTable();

                    DataRow drItemSelect;
                    drItemSelect               = theComDT.NewRow();
                    drItemSelect["ItemId"]     = 0;
                    drItemSelect["ItemName"]   = "Select";
                    drItemSelect["SupplierId"] = ddlSupplier.SelectedValue.ToString();
                    theComDT.Rows.InsertAt(drItemSelect, 0);

                    theColumnItemName.DataSource = theComDT;
                }
                else if (GblIQCare.ModePurchaseOrder == 2)
                {
                    DataRow drItemSelect;
                    drItemSelect               = theDS.Tables[0].NewRow();
                    drItemSelect["ItemId"]     = 0;
                    drItemSelect["ItemTypeId"] = 0;
                    drItemSelect["ItemName"]   = "Select";
                    theDS.Tables[0].Rows.InsertAt(drItemSelect, 0);

                    theColumnItemName.DataSource = theDS.Tables[0];
                }
                theColumnItemName.DisplayMember = "ItemName";
                theColumnItemName.ValueMember   = "ItemId";
                theColumnItemName.Width         = 350;
                theColumnItemName.ReadOnly      = false;
                //theColumnItemName.AutoComplete = true;
                theColumnItemName.DefaultCellStyle.NullValue = "Select";


                DataGridViewTextBoxColumn theColumnItemCode = new DataGridViewTextBoxColumn();
                theColumnItemCode.HeaderText       = "Item Code";
                theColumnItemCode.Name             = "ItemCode";
                theColumnItemCode.DataPropertyName = "ItemCode";
                theColumnItemCode.ReadOnly         = true;

                DataGridViewTextBoxColumn theColumnItemTypeId = new DataGridViewTextBoxColumn();
                theColumnItemTypeId.HeaderText       = "Item Type";
                theColumnItemTypeId.Name             = "ItemTypeId";
                theColumnItemTypeId.DataPropertyName = "ItemTypeId";
                theColumnItemTypeId.ReadOnly         = true;
                theColumnItemTypeId.Visible          = false;

                DataGridViewTextBoxColumn theColumnUnit = new DataGridViewTextBoxColumn();
                theColumnUnit.HeaderText       = "Purchase Units";
                theColumnUnit.Name             = "Units";
                theColumnUnit.DataPropertyName = "Units";
                theColumnUnit.ReadOnly         = true;

                DataGridViewTextBoxColumn theColumnUnitQuantity = new DataGridViewTextBoxColumn();
                theColumnUnitQuantity.HeaderText       = "Unit Quantity";
                theColumnUnitQuantity.DataPropertyName = "UnitQuantity";
                theColumnUnitQuantity.Name             = "UnitQuantity";
                theColumnUnitQuantity.ReadOnly         = false;

                DataGridViewTextBoxColumn theColumnQuantity = new DataGridViewTextBoxColumn();
                theColumnQuantity.HeaderText       = "Order Quantity";
                theColumnQuantity.DataPropertyName = "OrderQuantity";
                theColumnQuantity.Name             = "OrderQuantity";
                theColumnQuantity.ReadOnly         = false;

                DataGridViewTextBoxColumn theColumnPrice = new DataGridViewTextBoxColumn();
                theColumnPrice.HeaderText       = "Price /Unit";
                theColumnPrice.DataPropertyName = "Price";
                theColumnPrice.Name             = "Price";
                theColumnPrice.ReadOnly         = false;

                DataGridViewTextBoxColumn theColumnTotPrice = new DataGridViewTextBoxColumn();
                theColumnTotPrice.HeaderText       = "Total Price";
                theColumnTotPrice.DataPropertyName = "TotPrice";
                theColumnTotPrice.Name             = "TotPrice";
                theColumnTotPrice.ReadOnly         = true;

                dgwItemSubitemDetails.DataSource = dsPOItems.Tables[2];
                dgwItemSubitemDetails.Columns.Add(theColumnItemName);
                dgwItemSubitemDetails.Columns.Add(theColumnItemCode);
                dgwItemSubitemDetails.Columns.Add(theColumnUnit);
                dgwItemSubitemDetails.Columns.Add(theColumnUnitQuantity);
                dgwItemSubitemDetails.Columns.Add(theColumnQuantity);
                dgwItemSubitemDetails.Columns.Add(theColumnPrice);
                if (GblIQCare.ModePurchaseOrder == 1)
                {
                    theColumnItemCode.Width = 100;
                    theColumnUnit.Width     = 90;
                    theColumnQuantity.Width = 90;
                    theColumnPrice.Width    = 90;
                    theColumnTotPrice.Width = 85;
                }

                dgwItemSubitemDetails.Columns.Add(theColumnTotPrice);
                dgwItemSubitemDetails.Columns.Add(theColumnItemTypeId);
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareWindowMsgBox.ShowWindow("#C1", theBuilder, this);
                return;
            }
        }
    protected void btnRemove_Click(object sender, EventArgs e)
    {
        try
        {
            if (lstSelected.SelectedIndex >= 0)
            {
                if (Request.QueryString["Type"] == "Strength")
                {
                    DataRow   theDR;
                    DataTable theDT = (DataTable)ViewState["MasterTable"];
                    theDR    = theDT.NewRow();
                    theDR[0] = Convert.ToInt32(lstSelected.SelectedValue);
                    theDR[1] = lstSelected.SelectedItem.Text;
                    theDT.Rows.Add(theDR);
                    IQCareUtils theUtils = new IQCareUtils();
                    DataView    theDV    = theUtils.GridSort(theDT, "StrengthName", "asc");
                    theDT = theUtils.CreateTableFromDataView(theDV);
                    lstAvailable.DataSource = theDT;
                    lstAvailable.DataBind();
                    ViewState["MasterTable"] = theDT;

                    //DataTable theDT1 = (DataTable)ViewState["SelectedData"];
                    //DataRow[] theDR1 = theDT1.Select("Id=" + lstSelected.SelectedValue);
                    //theDT1.Rows.Remove(theDR1[0]);

                    foreach (DataRow theDR2 in ((DataTable)ViewState["SelectedData"]).Rows)
                    {
                        if (theDR2["Id"].ToString() == lstSelected.SelectedValue.ToString())
                        {
                            ((DataTable)ViewState["SelectedData"]).Rows.Remove(theDR2);
                            break;
                        }
                    }
                    DataTable theDT1 = (DataTable)ViewState["SelectedData"];
                    lstSelected.DataSource = theDT1;
                    lstSelected.DataBind();
                    ViewState["SelectedData"] = theDT1;
                }
                else if (Request.QueryString["Type"] == "Frequency")
                {
                    DataRow   theDR;
                    DataTable theDT = (DataTable)ViewState["MasterTable"];
                    theDR    = theDT.NewRow();
                    theDR[0] = Convert.ToInt32(lstSelected.SelectedValue);
                    theDR[1] = lstSelected.SelectedItem.Text;
                    theDT.Rows.Add(theDR);
                    IQCareUtils theUtils = new IQCareUtils();
                    DataView    theDV    = theUtils.GridSort(theDT, "Name", "asc");
                    theDT = theUtils.CreateTableFromDataView(theDV);
                    lstAvailable.DataSource = theDT;
                    lstAvailable.DataBind();
                    ViewState["MasterTable"] = theDT;

                    foreach (DataRow theDR2 in ((DataTable)ViewState["SelectedData"]).Rows)
                    {
                        if (theDR2["Id"].ToString() == lstSelected.SelectedValue.ToString())
                        {
                            ((DataTable)ViewState["SelectedData"]).Rows.Remove(theDR2);
                            break;
                        }
                    }
                    DataTable theDT1 = (DataTable)ViewState["SelectedData"];
                    lstSelected.DataSource = theDT1;
                    lstSelected.DataBind();
                    ViewState["SelectedData"] = theDT1;
                }
                else
                {
                    DataRow   theDR;
                    DataTable theDT  = (DataTable)ViewState["MasterTable"];
                    DataTable theDT1 = (DataTable)ViewState["SelectedData"];
                    DataRow[] theDR1 = theDT1.Select("Id=" + lstSelected.SelectedValue);
                    theDR    = theDT.NewRow();
                    theDR[0] = Convert.ToInt32(lstSelected.SelectedValue);
                    theDR[1] = lstSelected.SelectedItem.Text;
                    theDR["GenericAbbrevation"] = theDR1[0][2];
                    theDR["DrugTypeID"]         = ViewState["DrugType"].ToString();


                    theDT.Rows.Add(theDR);
                    IQCareUtils theUtils = new IQCareUtils();
                    DataView    theDV    = theUtils.GridSort(theDT, "GenericName", "asc");
                    theDT = theUtils.CreateTableFromDataView(theDV);
                    lstAvailable.DataSource = theDT;
                    lstAvailable.DataBind();
                    ViewState["MasterTable"] = theDT;

                    theDT1.Rows.Remove(theDR1[0]);
                    lstSelected.DataSource = theDT1;
                    lstSelected.DataBind();
                    ViewState["SelectedData"] = theDT1;
                }
            }
            else
            {
                IQCareMsgBox.Show("NoItemToRemove", this);
            }
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
        }
    }
示例#27
0
        public void formInit()
        {
            try
            {
                //IMasterList objPOItem = (IMasterList)ObjectFactory.CreateInstance("BusinessProcess.SCM.BMasterList,BusinessProcess.SCM");
                IPurchase objPOItem = (IPurchase)ObjectFactory.CreateInstance("BusinessProcess.SCM.BPurchase,BusinessProcess.SCM");
                dsPOItemsDetail = objPOItem.GetPurchaseOrderDetailsByPoid(GblIQCare.PurchaseOrderID);
                if (dsPOItemsDetail.Tables.Count > 0)
                {
                    if (dsPOItemsDetail.Tables[0].Rows.Count > 0)
                    {
                        dtpOrderDate.Text         = dsPOItemsDetail.Tables[0].Rows[0]["OrderDate"].ToString();
                        dtpOrderDate.CustomFormat = "dd-MMM-yyyy";
                        dtpOrderDate.Enabled      = false;
                        txtOrderNumber.Text       = dsPOItemsDetail.Tables[0].Rows[0]["PONumber"].ToString();
                        txtOrderNumber.Enabled    = true;
                        // ddlSourceStore.SelectedValue = Convert.ToInt32(dsPOItemsDetail.Tables[0].Rows[0]["SourceStoreID"].ToString());


                        if (GblIQCare.ModePurchaseOrder == 1)
                        {
                            ddlSupplier.DataSource = null;
                            BindFunctions theBind = new BindFunctions();
                            ddlSupplier.DataSource = null;
                            DataSet XMLDS = new DataSet();
                            XMLDS.ReadXml(GblIQCare.GetXMLPath() + "\\AllMasters.con");
                            BindFunctions theBindManager = new BindFunctions();
                            DataView      theDV          = new DataView(XMLDS.Tables["Mst_Supplier"]);
                            theDV.RowFilter = "(DeleteFlag = 0 or  DeleteFlag is null) or  (Id = " + Convert.ToInt32(dsPOItemsDetail.Tables[0].Rows[0]["SupplierID"].ToString()) + ")";
                            DataTable theStoreDT = theDV.ToTable();
                            theBind.Win_BindCombo(ddlSupplier, theStoreDT, "SupplierName", "Id");

                            ddlSupplier.SelectedValue = Convert.ToInt32(dsPOItemsDetail.Tables[0].Rows[0]["SupplierID"].ToString());
                            ddlSupplier.Enabled       = false;
                        }

                        ddlDestinationStore.SelectedValue = Convert.ToInt32(dsPOItemsDetail.Tables[0].Rows[0]["DestinStoreID"].ToString());
                        ddlDestinationStore.Enabled       = false;
                        ddlPreparedBy.SelectedValue       = Convert.ToInt32(dsPOItemsDetail.Tables[0].Rows[0]["PreparedBy"].ToString());
                        if (dsPOItemsDetail.Tables[0].Rows[0]["Status"].ToString() == "1")
                        {
                            chkRejectedStatus.Visible = true;
                            Btndelete.Enabled         = true;
                            btnSave.Enabled           = true;
                            IsPOUpdated      = true;
                            btnPrint.Enabled = false;
                        }
                        else if (dsPOItemsDetail.Tables[0].Rows[0]["Status"].ToString() == "5")
                        {
                            btnSave.Enabled           = false;
                            Btndelete.Enabled         = false;
                            IsPOUpdated               = false;
                            chkRejectedStatus.Visible = true;
                            chkRejectedStatus.Checked = true;
                            chkRejectedStatus.Enabled = false;
                            btnPrint.Enabled          = true;
                        }
                        else
                        {
                            ddlAuthorisedBy.SelectedValue = Convert.ToInt32(dsPOItemsDetail.Tables[0].Rows[0]["AuthorizedBy"].ToString());
                            btnSave.Enabled           = false;
                            Btndelete.Enabled         = false;
                            chkRejectedStatus.Visible = false;
                            btnPrint.Enabled          = true;
                        }
                        lblTotalAmount.Text = dsPOItemsDetail.Tables[1].Rows[0]["TotalAmount"].ToString();
                        BindGrid(dsPOItems);
                        dgwItemSubitemDetails.AllowUserToAddRows = true;
                        dgwItemSubitemDetails.DataSource         = dsPOItemsDetail.Tables[1];
                    }
                }
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareWindowMsgBox.ShowWindow("#C1", theBuilder, this);
                return;
            }
        }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            #region "Data Validation"
            if (FieldValidation() == false)
            {
                return;
            }
            #endregion

            //DataTable theDT = (DataTable)ViewState["DrugData"]; //rupesh
            DataTable theDT = (DataTable)ViewState["MasterTable"];

            IDrugMst DrugManager = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration");
            if (ViewState["Type"].ToString() == "Strength")
            {
                DataTable theNDT = (DataTable)DrugManager.CreateStrength(txtAdd.Text.Trim(), Convert.ToInt32(Session["AppUserId"].ToString()));
                if (theNDT.Rows[0][0].ToString() == "0")
                {
                    IQCareMsgBox.Show("StrengthExists", this);
                    return;
                }
                else
                {
                    DataRow theDR = theDT.NewRow();
                    theDR[0] = theNDT.Rows[0][0];
                    theDR[1] = theNDT.Rows[0][1];
                    theDT.Rows.Add(theDR);
                    IQCareUtils theUtil = new IQCareUtils();
                    DataView    theDV   = theUtil.GridSort(theDT, "StrengthName", "asc");
                    ViewState["DrugStrengthAvail"] = theUtil.CreateTableFromDataView(theDV);
                    lstAvailable.DataSource        = (DataTable)ViewState["DrugStrengthAvail"];
                    lstAvailable.DataBind();
                    txtAdd.Text = "";
                    ViewState["MasterTable"] = ViewState["DrugStrengthAvail"];
                }
            }
            else if (ViewState["Type"].ToString() == "Frequency")
            {
                DataTable theNDT = (DataTable)DrugManager.CreateFrequency(txtAdd.Text.Trim(), Convert.ToInt32(Session["AppUserId"]));
                if (theNDT.Rows[0][0].ToString() == "0")
                {
                    IQCareMsgBox.Show("FrequencyExists", this);
                    return;
                }
                else
                {
                    DataRow theDR = theDT.NewRow();
                    theDR[0] = theNDT.Rows[0][0];
                    theDR[1] = theNDT.Rows[0][1];
                    theDT.Rows.Add(theDR);
                    IQCareUtils theUtil = new IQCareUtils();
                    DataView    theDV   = theUtil.GridSort(theDT, "Name", "asc");
                    ViewState["DrugFrequencyAvail"] = theUtil.CreateTableFromDataView(theDV);
                    lstAvailable.DataSource         = (DataTable)ViewState["DrugFrequencyAvail"];
                    lstAvailable.DataBind();
                    txtAdd.Text = "";
                    ViewState["MasterTable"] = ViewState["DrugFrequencyAvail"];
                }
            }
            else if (ViewState["Type"].ToString() == "Generic")
            {
                //DataTable theDT = (DataTable)ViewState["DrugData"];
                string theGenericAbbrv;
                if (txtAbbv.Text == "")
                {
                    theGenericAbbrv = "";
                }
                else
                {
                    theGenericAbbrv = txtAbbv.Text;
                }
                int theDrgType = Convert.ToInt32(ViewState["DrugType"]);

                DataSet theNDT = (DataSet)DrugManager.CreateGeneric(txtAdd.Text.Trim(), theGenericAbbrv, theDrgType, Convert.ToInt32(Session["AppUserId"]));
                if (theNDT.Tables[0].Rows[0][0].ToString() == "0")
                {
                    if (theDrgType == 37)
                    {
                        IQCareMsgBox.Show("GenericExists", this);
                        return;
                    }
                    else
                    {
                        IQCareMsgBox.Show("NonARVGenericExists", this);
                        return;
                    }
                }

                else
                {
                    DataTable DT = new DataTable();
                    DT = theDT.Copy();
                    DataRow theDR = DT.NewRow();
                    theDR[0] = theNDT.Tables[0].Rows[0][0];
                    theDR[1] = theNDT.Tables[0].Rows[0][1];
                    theDR[2] = theNDT.Tables[0].Rows[0][2];
                    theDR[3] = theNDT.Tables[1].Rows[0][0];
                    DT.Rows.Add(theDR);

                    IQCareUtils theUtil = new IQCareUtils();
                    DataView    theDV   = theUtil.GridSort(DT, "GenericName", "asc");
                    DT = theUtil.CreateTableFromDataView(theDV);

                    ViewState["DrugData"] = DT;
                    theDV           = new DataView(DT);
                    theDV.RowFilter = "DrugTypeId=" + ViewState["DrugType"].ToString();
                    DT = theUtil.CreateTableFromDataView(theDV);
                    ViewState["MasterTable"] = DT;

                    lstAvailable.DataSource = DT;
                    lstAvailable.DataBind();
                    if (theDrgType == 37)
                    {
                        txtAbbv.Text = "";
                        txtAdd.Text  = "";
                    }
                    else
                    {
                        txtAdd.Text = "";
                    }
                }
            }
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["PatientID"] != null)
            {
                try
                {
                    patientid = Convert.ToInt32(Session["PatientId"]);
                    IReports theQBuilderReports = (IReports)ObjectFactory.CreateInstance("BusinessProcess.Reports.BReports, BusinessProcess.Reports");
                    theRepDS = theQBuilderReports.GetbluecartIEFUinfo(patientid);

                    //  theRepDS.WriteXml("c:\\TestHL7.xml");
                    #region "TableNames"
                    // Moh reg
                    theRepDS.Tables[0].TableName = "patientinfo";
                    theRepDS.Tables[1].TableName = "EmergContact";
                    theRepDS.Tables[2].TableName = "Referred";
                    theRepDS.Tables[3].TableName = "PrevARV";
                    theRepDS.Tables[4].TableName = "HIVDiagnosis";
                    theRepDS.Tables[5].TableName = "patientAllergy";
                    theRepDS.Tables[6].TableName = "FamilyInfo";
                    theRepDS.Tables[7].TableName = "patientlabresults";
                    theRepDS.Tables[8].TableName = "firstgegimen";
                    // theRepDS.Tables[9].TableName = "secondregimen";

                    // Moh visit
                    theRepDS.Tables[9].TableName  = "IEFuinfopervisit";
                    theRepDS.Tables[10].TableName = "Disclosure";
                    theRepDS.Tables[11].TableName = "NewOisOtherProblems";
                    // theRepDS.Tables[12].TableName = "Assessment";
                    theRepDS.Tables[12].TableName = "CotrimoxazoleAdherence";
                    theRepDS.Tables[13].TableName = "INHdrug";
                    theRepDS.Tables[14].TableName = "sideeffect";
                    theRepDS.Tables[15].TableName = "Patientvisitinfo";
                    theRepDS.Tables[16].TableName = "Tuberclulosis";
                    theRepDS.Tables[17].TableName = "otherMedication";
                    theRepDS.Tables[18].TableName = "labinvestigation";
                    theRepDS.Tables[19].TableName = "ArvdrugAdherence";
                    theRepDS.Tables[20].TableName = "HIVTest";


                    #endregion

                    // Use For HL7 add namespace <ClinicalDocument xmlns=""urn:hl7-org:v3"">")
                    StringBuilder a = new StringBuilder();
                    StringBuilder b = new StringBuilder();
                    StringBuilder c = new StringBuilder();
                    StringBuilder d = new StringBuilder();
                    b.Append(@"<?xml version=""1.0""?><ClinicalDocument xmlns=""urn:hl7-org:v3"">");
                    d.Append("</ClinicalDocument>");



                    //Response.Redirect("..\\ExcelFiles\\TZNACPMonthlyReport.xls");
                    theRepDS.WriteXml(Server.MapPath("..\\XMLFiles\\HL7\\" + patientid.ToString() + "HLData.xml"), XmlWriteMode.WriteSchema);


                    // Use For HL7 new xml file with namespace

                    XmlDocument doc1 = new XmlDocument();
                    doc1.Load(Server.MapPath("..\\XMLFiles\\HL7\\" + patientid.ToString() + "HLData.xml"));
                    XmlNode rootNode = doc1.SelectSingleNode("NewDataSet");
                    a.Append(rootNode.OuterXml.ToString());

                    c.Append(b).Append(a).Append(d);
                    doc1 = new XmlDocument();
                    doc1.LoadXml(c.ToString());
                    doc1.Save(Server.MapPath("..\\XMLFiles\\HL7\\" + patientid.ToString() + "HLData.xml"));



                    //theRepDS.WriteXml(Server.MapPath("..\\XMLFiles\\HL7\\" + patientid.ToString() + "HLData.xml"));
                    Excel.SpreadsheetClass theApp = new Microsoft.Office.Interop.Owc11.SpreadsheetClass();
                    string theFilePath            = Server.MapPath("..\\ExcelFiles\\Templates\\Bluecard.xml");
                    theApp.XMLURL = theFilePath;
                    fillMohRegSheet(theApp);
                    fillMohVisitsheet(theApp);

                    // theApp.Export(Server.MapPath("..\\ExcelFiles\\TZNACPMonthlyReport.xls"), Microsoft.Office.Interop.Owc11.SheetExportActionEnum.ssExportActionOpenInExcel, Microsoft.Office.Interop.Owc11.SheetExportFormat.ssExportAsAppropriate);
                    theApp.Export(Server.MapPath("..\\ExcelFiles\\Bluecard.xls"), Excel.SheetExportActionEnum.ssExportActionNone, Excel.SheetExportFormat.ssExportXMLSpreadsheet);
                    //theUtils.OpenExcelFile(Server.MapPath("..\\ExcelFiles\\TZNACPMonthlyReport.xls"), Response);
                    IQWebUtils theUtl = new IQWebUtils();
                    theUtl.ShowExcelFile(Server.MapPath("..\\ExcelFiles\\Bluecard.xls"), Response);
                    releaseObject(theApp);
                }
                catch (System.IO.DirectoryNotFoundException exd)
                {
                    MsgBuilder theBuilder = new MsgBuilder();
                    theBuilder.DataElements["MessageText"] = exd.Message.ToString();
                    IQCareMsgBox.Show("#C1", theBuilder, this);
                }
                catch (COMException cex)
                {
                    throw cex;
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
    }
示例#30
0
    private Boolean FieldValidation()
    {
        if (txtlastname.Text.Trim() == "")
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["Control"] = "Last Name";
            IQCareMsgBox.Show("BlankTextBox", theBuilder, this);
            txtfirstname.Focus();
            return(false);
        }
        if (txtfirstname.Text.Trim() == "")
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["Control"] = "First Name";
            IQCareMsgBox.Show("BlankTextBox", theBuilder, this);
            txtfirstname.Focus();
            return(false);
        }
        if (txtusername.Text.Trim() == "")
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["Control"] = "User Name";
            IQCareMsgBox.Show("BlankTextBox", theBuilder, this);
            txtusername.Focus();
            return(false);
        }
        if (txtPassword.Text.Trim() == "")
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["Control"] = "Password";
            IQCareMsgBox.Show("BlankTextBox", theBuilder, this);
            txtPassword.Focus();
            return(false);
        }
        if (txtPassword.Text.Trim() != txtConfirmpassword.Text.Trim())
        {
            IQCareMsgBox.Show("PasswordNotMatch", this);
            txtPassword.Text        = "";
            txtConfirmpassword.Text = "";
            txtPassword.Focus();
            return(false);
        }

        if (htGroups.Count < 1)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["Control"] = "User Group";
            IQCareMsgBox.Show("BlankList", theBuilder, this);
            lstUsergroup.Focus();
            return(false);
        }
        DataSet theXMLDS = new DataSet();

        theXMLDS.ReadXml(Server.MapPath("..\\XMLFiles\\AllMasters.con"));
        DataView theDV = new DataView(theXMLDS.Tables["Mst_Facility"]);

        theDV.RowFilter = "FacilityId=" + Convert.ToInt32(Session["AppLocationId"]);
        if (theDV[0]["StrongPassFlag"] != DBNull.Value)
        {
            if (Convert.ToInt32(theDV[0]["StrongPassFlag"]) == 1)
            {
                if (!IsStrongPassword(txtPassword.Text.Trim(), txtfirstname.Text, txtlastname.Text, txtusername.Text))
                {
                    IQCareMsgBox.Show("StrongPassword", this);
                    return(false);
                }
            }
        }
        return(true);
    }