コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            string language   = CurrentEnvironment.Language;
            int    languageId = int.Parse(language);
            Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["LogIn-dictionary" + language];
            if (wtList == null)
            {
                List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "LogIn");
                wtList = new Dictionary <string, string>();
                foreach (WordTranslate vwt in wordTranslateList)
                {
                    wtList.Add(vwt.Code, vwt.Name);
                }
                HttpContext.Current.Cache.Insert("LogIn-dictionary" + language, wtList);
            }

            this.btnLogIn.Text         = wtList["LogInButton"];
            this.lblWrongPassword.Text = wtList["LogInWrongCredentials"];
            //this.rfvUsername.ErrorMessage = wtList["LogInUsernameRequired"];
            //this.rfvPassword.ErrorMessage = wtList["LogInPasswordRequired"];

            //if (CurrentEnvironment.LoggedUser != null)
            //{
            //    pnlLogin.Visible = false;
            //   FormsAuthentication.RedirectFromLoginPage("/Pages/Default.aspx", false);
            //}
            //else
            //    pnlLogin.Visible = true;
            ddlLanguage.SelectedValue = CurrentEnvironment.Language;
        }
    }
コード例 #2
0
    protected void gvWordTranslate_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        int         index   = gvWordTranslate.EditIndex;
        GridViewRow row     = gvWordTranslate.Rows[index];
        Label       txtId   = (Label)gvWordTranslate.Rows[e.RowIndex].FindControl("txtId");
        TextBox     txtName = (TextBox)gvWordTranslate.Rows[e.RowIndex].FindControl("txtName");

        WordTranslate o = WordTranslate.GetWordTranslateById(int.Parse(txtId.Text));

        o.Name = txtName.Text;
        int i = WordTranslate.Update(o);

        if (i > 0)
        {
            lblSuccess.Visible = true;
            lblError.Visible   = false;
        }
        else
        {
            lblSuccess.Visible = false;
            lblError.Visible   = true;
        }

        gvWordTranslate.EditIndex = -1;
        BindWordTranslate();
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            List <string> actionList        = null;
            string        sessionNameAction = "";
            if (CurrentEnvironment.LoggedUser != null)
            {
                sessionNameAction = "__GIS_actionList_" + CurrentEnvironment.LoggedUser.Id;
                actionList        = (List <string>)Session[sessionNameAction];
            }

            if ((actionList != null) && actionList.Contains("ViewImmunizationCard") && (CurrentEnvironment.LoggedUser != null))
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);
                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["ImmunizationCard-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "ImmunizationCard");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("ImmunizationCard-dictionary" + language, wtList);
                }
                //Page Title
                this.lblTitle.Text = wtList["ViewImmunizationCardPageTitle"];
                this.btnPrint.Text = wtList["ViewImmunizationCardPrintButton"];
            }
        }
    }
コード例 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            string language   = CurrentEnvironment.Language;
            int    languageId = int.Parse(language);
            Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["ResetPassword-dictionary" + language];
            if (wtList == null)
            {
                List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "ResetPassword");
                wtList = new Dictionary <string, string>();
                foreach (WordTranslate vwt in wordTranslateList)
                {
                    wtList.Add(vwt.Code, vwt.Name);
                }
                HttpContext.Current.Cache.Insert("ResetPassword-dictionary" + language, wtList);
            }

            ////controls
            //this.lblUsernameNotFound.Text = wtList["ResetPasswordUsernameNotFound"];
            //this.lblSuccess.Text = wtList["ResetPasswordSuccess"];
            //this.lblWarning.Text = wtList["ResetPasswordWarning"];
            //this.lblError.Text = wtList["ResetPasswordError"];

            ////actions
            //this.btnResetPassword.Text = wtList["ResetPasswordButton"];

            ////validators
            //cvRequiredFields.ErrorMessage = wtList["ResetPasswordMandatoryFields"];
            //revNewPassword.ErrorMessage = wtList["ResetPasswordPasswordValidator"];
            //cvPasswordMatch.ErrorMessage = wtList["ResetPasswordPasswordMatch"];
        }
    }
コード例 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        List <string> actionList        = null;
        string        sessionNameAction = "";

        if (CurrentEnvironment.LoggedUser != null)
        {
            sessionNameAction = "__GIS_actionList_" + CurrentEnvironment.LoggedUser.Id;
            actionList        = (List <string>)Session[sessionNameAction];
        }

        if (CurrentEnvironment.LoggedUser != null)
        {
            int    userId     = CurrentEnvironment.LoggedUser.Id;
            string language   = CurrentEnvironment.Language;
            int    languageId = int.Parse(language);
            Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["Reports-dictionary" + language];
            if (wtList == null)
            {
                List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "Reports");
                wtList = new Dictionary <string, string>();
                foreach (WordTranslate vwt in wordTranslateList)
                {
                    wtList.Add(vwt.Code, vwt.Name);
                }
                HttpContext.Current.Cache.Insert("Reports-dictionary" + language, wtList);
            }

            this.SetReportLayout(Decimal.Parse(Request.QueryString["reportId"]), Request.QueryString["format"], actionList);
        }
        else
        {
            Response.Redirect("Default.aspx");
        }
    }
コード例 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            if ((CurrentEnvironment.LoggedUser != null))
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);
                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["ImmunizationCard-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "ImmunizationCard");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("ImmunizationCard-dictionary" + language, wtList);
                }

                this.lblTitle.Text = wtList["PrintImmunizationCardTitle"];
            }
            else
            {
                Response.Redirect("Default.aspx", false);
            }
        }
    }
コード例 #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string language   = CurrentEnvironment.Language;
        int    languageId = int.Parse(language);
        Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["LoggedUser-dictionary" + language];

        if (wtList == null)
        {
            List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "LoggedUser");
            wtList = new Dictionary <string, string>();
            foreach (WordTranslate vwt in wordTranslateList)
            {
                wtList.Add(vwt.Code, vwt.Name);
            }
            HttpContext.Current.Cache.Insert("LoggedUser-dictionary" + language, wtList);
        }
        this.lblUser.Text           = wtList["LoggedUserUser"];
        this.lblHealthFacility.Text = wtList["LoggedUserHealthFacility"];
        this.lnkUserProfile.Text    = wtList["LoggedUserChangePassword"];
        this.lnkLogout.Text         = wtList["LoggedUserLogOut"];

        if (CurrentEnvironment.LoggedUser != null)
        {
            this.lblLoggedUser.Text       = CurrentEnvironment.LoggedUser.Username;
            lblCurrentHealthFacility.Text = CurrentEnvironment.LoggedUser.HealthFacility.Name;
        }
        else
        {
            this.pnlLoggedId.Visible = false;
        }
    }
コード例 #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            List <string> actionList        = null;
            string        sessionNameAction = "";
            if (CurrentEnvironment.LoggedUser != null)
            {
                sessionNameAction = "__GIS_actionList_" + CurrentEnvironment.LoggedUser.Id;
                actionList        = (List <string>)Session[sessionNameAction];
            }

            if ((actionList != null) && actionList.Contains("ViewActions") && (CurrentEnvironment.LoggedUser != null))
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);
                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["Actions-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "Actions");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("Actions-dictionary" + language, wtList);
                }

                //controls
                this.lblName.Text  = wtList["ActionsName"];
                this.lblNotes.Text = wtList["ActionsNotes"];

                //grid header text
                gvActions.Columns[1].HeaderText = wtList["ActionsName"];
                gvActions.Columns[2].HeaderText = wtList["ActionsNotes"];

                //actions
                this.btnAdd.Visible  = actionList.Contains("AddActions");
                this.btnEdit.Visible = actionList.Contains("EditActions");

                //buttons
                this.btnAdd.Text  = wtList["ActionsAddButton"];
                this.btnEdit.Text = wtList["ActionsEditButton"];

                //message
                this.lblSuccess.Text = wtList["ActionsSuccessText"];
                this.lblWarning.Text = wtList["ActionsWarningText"];
                this.lblError.Text   = wtList["ActionsErrorText"];

                //page title
                this.lblTitle.Text = wtList["ActionsPageTitle"];
            }
            else
            {
                Response.Redirect("Default.aspx");
            }
        }
    }
コード例 #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            List <string> actionList        = null;
            string        sessionNameAction = "";
            if (CurrentEnvironment.LoggedUser != null)
            {
                sessionNameAction = "__GIS_actionList_" + CurrentEnvironment.LoggedUser.Id;
                actionList        = (List <string>)Session[sessionNameAction];
            }

            if ((actionList != null) && actionList.Contains("ViewRoleAction") && (CurrentEnvironment.LoggedUser != null))
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language); //Language.GetLanguageByName(language).Id;
                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["RoleAction-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "RoleAction");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("RoleAction-dictionary" + language, wtList);
                }

                // controls
                this.lblRole.Text   = wtList["RoleActionRole"];
                this.lblAction.Text = wtList["RoleActionAction"];

                //actions
                this.btnAdd.Visible       = actionList.Contains("AddRoleAction");
                this.btnRemove.Visible    = actionList.Contains("RemoveRoleAction");
                this.btnAddAll.Visible    = actionList.Contains("AddAllRoleAction");
                this.btnRemoveAll.Visible = actionList.Contains("RemoveAllRoleAction");

                //Page Title
                this.lblTitle.Text = wtList["RoleActionPageTitle"];

                //validators
                BindRoles(Role.GetRoleByStatus(true));

                _actions = Actions.GetLeftActionsOfRole(int.Parse(ddlRole.SelectedValue.ToString()));
                BindLeftActionsOfRole(_actions);

                _roleActions = Actions.GetActionsOfRole(int.Parse(ddlRole.SelectedValue.ToString()));
                BindActionsOfRole(_roleActions);
            }
            else
            {
                Response.Redirect("Default.aspx");
            }
        }
    }
コード例 #10
0
    private void BindWordTranslate()
    {
        string where = string.Format(@" ""LANGUAGE_ID"" = '{0}' AND ""PAGE_NAME"" = '{1}' ", ddlLanguages.SelectedValue, ddlPage.SelectedValue);
        //if (!string.IsNullOrEmpty(txtCode.Text))
        //    where += string.Format(@" AND UPPER(""CODE"") LIKE '%{0}%' ", txtCode.Text.ToUpper().Replace("'", @"''"));
        where += string.Format(@" ORDER BY ""CODE"" ");
        List <WordTranslate> wtList = WordTranslate.GetWordTranslateList(where);

        gvWordTranslate.DataSource = wtList;
        gvWordTranslate.DataBind();
    }
コード例 #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            List <string> actionList        = null;
            string        sessionNameAction = "";
            if (CurrentEnvironment.LoggedUser != null)
            {
                sessionNameAction = "__GIS_actionList_" + CurrentEnvironment.LoggedUser.Id;
                actionList        = (List <string>)Session[sessionNameAction];
            }

            if ((actionList != null) && actionList.Contains("ViewItemBalanceInHealthFacilities") && (CurrentEnvironment.LoggedUser != null))
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);
                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["HealthFacilityBalance-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "HealthFacilityBalance");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("HealthFacilityBalance-dictionary" + language, wtList);
                }

                lblItemCategoryId.Text = wtList["HealthFacilityBalanceItemCategory"];
                lblItemId.Text         = wtList["HealthFacilityBalanceItem"];

                //grid header text
                gvHealthFacilityBalance.Columns[1].HeaderText = wtList["HealthFacilityBalanceHealthFacility"];
                gvHealthFacilityBalance.Columns[2].HeaderText = wtList["HealthFacilityBalanceReceived"];
                gvHealthFacilityBalance.Columns[3].HeaderText = wtList["HealthFacilityBalanceDistributed"];
                gvHealthFacilityBalance.Columns[4].HeaderText = wtList["HealthFacilityBalanceUsed"];
                gvHealthFacilityBalance.Columns[5].HeaderText = wtList["HealthFacilityBalanceWasted"];
                gvHealthFacilityBalance.Columns[6].HeaderText = wtList["HealthFacilityBalanceBalance"];

                //buttons
                this.btnSearch.Text = wtList["HealthFacilityBalanceSearchButton"];
                this.btnExcel.Text  = wtList["HealthFacilityBalanceExcelButton"];
                this.btnPrint.Text  = wtList["HealthFacilityBalancePrintButton"];

                //Page Title
                this.lblTitle.Text = wtList["ItemBalanceInHealthFacilitiesPageTitle"];
            }
            else
            {
                Response.Redirect("Default.aspx");
            }
        }
    }
コード例 #12
0
 public void Save(WordTranslate wordTranslate)
 {
     lock (locker)
     {
         if (wordTranslate.Id != 0)
         {
             database.Update(wordTranslate);
         }
         database.Insert(wordTranslate);
     }
 }
コード例 #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            List <string> actionList        = null;
            string        sessionNameAction = "";
            if (CurrentEnvironment.LoggedUser != null)
            {
                sessionNameAction = "__GIS_actionList_" + CurrentEnvironment.LoggedUser.Id;
                actionList        = (List <string>)Session[sessionNameAction];
            }

            if ((actionList != null) && actionList.Contains("ViewWordTranslate") && (CurrentEnvironment.LoggedUser != null))
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);
                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["WordTranslate-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "WordTranslate");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("WordTranslate-dictionary" + language, wtList);
                }

                // controls
                this.lblLanguageId.Text = wtList["WordTranslateLanguage"];
                //this.lblCode.Text = wtList["WordTranslateCode"];
                this.lblPageName.Text = wtList["WordTranslatePageName"];

                //grid header text
                gvWordTranslate.Columns[1].HeaderText = wtList["WordTranslateCode"];
                gvWordTranslate.Columns[2].HeaderText = wtList["WordTranslateWord"];
                gvWordTranslate.Columns[3].HeaderText = wtList["WordTranslateName"];


                // message
                this.lblSuccess.Text = wtList["WordTranslateSuccessText"];
                this.lblError.Text   = wtList["WordTranslateErrorText"];

                //Page Title
                this.lblTitle.Text = wtList["WordTranslatePageTitle"];
            }
            else
            {
                Response.Redirect("Default.aspx");
            }
        }
    }
コード例 #14
0
    protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        string language   = CurrentEnvironment.Language;
        int    languageId = int.Parse(language);
        Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["ChildData-dictionary" + language];

        if (wtList == null)
        {
            List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "ChildData");
            wtList = new Dictionary <string, string>();
            foreach (WordTranslate vwt in wordTranslateList)
            {
                wtList.Add(vwt.Code, vwt.Name);
            }
            HttpContext.Current.Cache.Insert("ChildData-dictionary" + language, wtList);
        }

        string id1 = Configuration.GetConfigurationByName("IdentificationNo1").Value;

        if (e.Item.ItemType == ListItemType.Item)
        {
            Label lbSystemID = (Label)e.Item.FindControl("lbSystemID");
            lbSystemID.Text = wtList["ChildDataSystem"];
            Label lbIdentificationNo1 = (Label)e.Item.FindControl("lbIdentificationNo1");
            lbIdentificationNo1.Text = id1;
            Label lbFirstName = (Label)e.Item.FindControl("lbFirstName");
            lbFirstName.Text = wtList["ChildDataFirstname1"];
            Label lbLastName = (Label)e.Item.FindControl("lbLastName");
            lbLastName.Text = wtList["ChildDataLastname1"];
            Label lbBirthdate = (Label)e.Item.FindControl("lbBirthdate");
            lbBirthdate.Text = wtList["ChildDataBirthdate"];
            Label lbBirthplace = (Label)e.Item.FindControl("lbBirthplace");
            lbBirthplace.Text = wtList["ChildDataBirthplace"];
            Label lbGender = (Label)e.Item.FindControl("lbGender");
            lbGender.Text = wtList["ChildDataGender"];
            Label lbHealthFacility = (Label)e.Item.FindControl("lbHealthFacility");
            lbHealthFacility.Text = wtList["ChildDataHealthFacility"];
            Label lbMother = (Label)e.Item.FindControl("lbMotherName");
            lbMother.Text = wtList["ChildDataMother"];
            //Label lbFather = (Label)e.Item.FindControl("lbFatherName");
            //lbFather.Text = wtList["ChildDataFather"];
            //Label lbAddress = (Label)e.Item.FindControl("lbAddress");
            //lbAddress.Text = wtList["ChildDataAddress"];
        }
    }
コード例 #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    userId     = CurrentEnvironment.LoggedUser.Id;
        string language   = CurrentEnvironment.Language;
        int    languageId = int.Parse(language);
        Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["ErrorPage-dictionary" + language];

        if (wtList == null)
        {
            List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "ErrorPage");
            wtList = new Dictionary <string, string>();
            foreach (WordTranslate vwt in wordTranslateList)
            {
                wtList.Add(vwt.Code, vwt.Name);
            }
            HttpContext.Current.Cache.Insert("ErrorPage-dictionary" + language, wtList);
        }

        //controls
        this.lbl1.Text = wtList["ErrorPageLabel1"];
        this.lbl2.Text = wtList["ErrorPageLabel2"];
        this.lbl3.Text = wtList["ErrorPageLabel3"];
    }
コード例 #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            if (CurrentEnvironment.LoggedUser != null)
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);
                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["ChildVaccinationData-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "ChildVaccinationData");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("ChildVaccinationData-dictionary" + language, wtList);
                }


                //grid header text
                gvVaccinationEvent.Columns[1].HeaderText = wtList["ChildVaccinationDataDose"];
                gvVaccinationEvent.Columns[2].HeaderText = wtList["ChildVaccinationDataLot"];
                gvVaccinationEvent.Columns[3].HeaderText = wtList["ChildVaccinationDataHealthCenter"];
                gvVaccinationEvent.Columns[4].HeaderText = wtList["ChildVaccinationDataDate"];
                gvVaccinationEvent.Columns[5].HeaderText = wtList["ChildVaccinationDataDone"];
                gvVaccinationEvent.Columns[6].HeaderText = wtList["ChildVaccinationDataReason"];
            }
            else
            {
                Response.Redirect("Default.aspx");
            }
        }
    }
コード例 #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            List <string> actionList        = null;
            string        sessionNameAction = "";
            if (CurrentEnvironment.LoggedUser != null)
            {
                sessionNameAction = "__GIS_actionList_" + CurrentEnvironment.LoggedUser.Id;
                actionList        = (List <string>)Session[sessionNameAction];
            }

            if ((actionList != null) && actionList.Contains("ViewChildSupplements") && (CurrentEnvironment.LoggedUser != null))
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);
                List <WordTranslate>        wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "ChildSupplements");
                Dictionary <string, string> wtList            = new Dictionary <string, string>();
                foreach (WordTranslate vwt in wordTranslateList)
                {
                    wtList.Add(vwt.Code, vwt.Name);
                }

                //controls
                //this.lblChildId.Text = wtList["ChildSupplementsChild"];
                this.lblVitA.Text       = wtList["ChildSupplementsVita"];
                this.lblMebendezol.Text = wtList["ChildSupplementsMebendezol"];
                this.lblDate.Text       = wtList["ChildSupplementsDate"];

                //grid header text
                //gvChildSupplements.Columns[1].HeaderText = wtList["ChildSupplementsChild"];
                gvChildSupplements.Columns[3].HeaderText = wtList["ChildSupplementsVita"];
                gvChildSupplements.Columns[4].HeaderText = wtList["ChildSupplementsMebendezol"];
                gvChildSupplements.Columns[2].HeaderText = wtList["ChildSupplementsDate"];

                //actions
                this.btnAdd.Visible = actionList.Contains("AddChildSupplements");
                //this.btnEdit.Visible = actionList.Contains("EditChildSupplements");

                //validators
                //rfvChildId.ErrorMessage = wtList["ChildSupplementsMandatory"];
                //ceDate.Format = ConfigurationDate.GetConfigurationDateById(int.Parse(Configuration.GetConfigurationByName("DateFormat").Value)).DateFormat;
                //revDate.ErrorMessage = ConfigurationDate.GetConfigurationDateById(int.Parse(Configuration.GetConfigurationByName("DateFormat").Value)).DateFormat;
                //revDate.ValidationExpression = ConfigurationDate.GetConfigurationDateById(int.Parse(Configuration.GetConfigurationByName("DateFormat").Value)).DateExpresion;

                int    id  = -1;
                string _id = Request.QueryString["id"];
                if (!String.IsNullOrEmpty(_id))
                {
                    int.TryParse(_id, out id);
                    HttpContext.Current.Session["_childId"] = id;

                    lblVitADate.Text       = DateTime.Today.Date.ToString("dd-MMM-yyyy");
                    lblMebendezolDate.Text = DateTime.Today.Date.ToString("dd-MMM-yyyy");

                    ChildSupplements su = ChildSupplements.GetChildSupplementsByChild(id);
                    if (su != null)
                    {
                        chkVitA.Checked       = su.Vita;
                        chkMebendezol.Checked = su.Mebendezol;
                    }
                    else
                    {
                        chkVitA.Checked       = false;
                        chkMebendezol.Checked = false;
                    }
                }
            }
            else
            {
                Response.Redirect("Default.aspx");
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            if (CurrentEnvironment.LoggedUser != null)
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);

                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["VaccinationActivityReport-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "VaccinationActivityReport");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("VaccinationActivityReport-dictionary" + language, wtList);
                }

                this.lblTitle.Text = wtList["PrintVaccinationActivityReportPageTitle"];
                this.lbItem.Text   = wtList["VaccinationActivityReportItem"];
                this.lbYear.Text   = wtList["VaccinationActivityReportYear"];

                string jan = wtList["Jan"];
                string feb = wtList["Feb"];
                string mar = wtList["Mar"];
                string apr = wtList["Apr"];
                string may = wtList["May"];
                string jun = wtList["Jun"];
                string jul = wtList["Jul"];
                string aug = wtList["Aug"];
                string sep = wtList["Sep"];
                string oct = wtList["Oct"];
                string nov = wtList["Nov"];
                string dec = wtList["Dec"];

                string vaccine = wtList["Vaccine"];
                string total   = wtList["Total"];
                string planned = wtList["Planned"];

                string months = string.Format(@" ""{12}"" text, ""{0}"" int, ""{1}"" int, ""{2}"" int, ""{3}"" int, ""{4}"" int, ""{5}"" int, ""{6}"" int, ""{7}"" int, ""{8}"" int, ""{9}"" int, ""{10}"" int, ""{11}"" int ", jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec, vaccine);

                Session["__Months"]  = months;
                Session["__Total"]   = total;
                Session["__Planned"] = planned;
                string where         = "";
                string tmp = "";
                if (HttpContext.Current.Session["Year"].ToString() != String.Empty)
                {
                    lblYear.Text = HttpContext.Current.Session["Year"].ToString();
                }
                else
                {
                    lblYear.Text = DateTime.Today.Date.Year.ToString();
                }

                if (HttpContext.Current.Session["VaccinationActivityReport-Item"] != String.Empty)
                {
                    lblItem.Text = HttpContext.Current.Session["VaccinationActivityReport-Item"].ToString();
                }

                if (HttpContext.Current.Session["VaccinationActivityReport-Where"].ToString() != String.Empty)
                {
                    where = HttpContext.Current.Session["VaccinationActivityReport-Where"].ToString();
                }
                if (HttpContext.Current.Session["VaccinationActivityReport-TempWhere"].ToString() != String.Empty)
                {
                    tmp = HttpContext.Current.Session["VaccinationActivityReport-TempWhere"].ToString();
                }

                DataTable dt     = VaccinationActivity.GetVaccinationActivity(languageId, where, Session["__Months"].ToString());
                DataTable source = GetDataTable(dt, tmp, languageId);

                gvReport.DataSource = source;
                gvReport.DataBind();

                string url = VaccinationActivityReportGraphHelper.GetUrl(source, this.lblTitle.Text);

                iActivityReport.Text = String.Format("<img src='{0}' alt='' />", url.Replace(" ", ""));
            }
            else
            {
                Response.Redirect("Default.aspx", false);
            }
        }
    }
コード例 #19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            List <string> actionList        = null;
            string        sessionNameAction = "";
            if (CurrentEnvironment.LoggedUser != null)
            {
                sessionNameAction = "__GIS_actionList_" + CurrentEnvironment.LoggedUser.Id;
                actionList        = (List <string>)Session[sessionNameAction];
            }

            if ((actionList != null) && actionList.Contains("ViewItemLot") && (CurrentEnvironment.LoggedUser != null))
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);
                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["ItemLot-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "ItemLot");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("ItemLot-dictionary" + language, wtList);
                }

                //controls
                lblItemCategory.Text = wtList["ItemLotItemCategory"];
                lblItem.Text         = wtList["ItemLotItem"];
                lblGTIN.Text         = wtList["ItemLotGTIN"];
                lblLotNumber.Text    = wtList["ItemLotLotNumber"];
                lblExpireDate.Text   = wtList["ItemLotExpireDate"];
                lblNotes.Text        = wtList["ItemLotNotes"];

                //grid header text
                gvItemLotNew.Columns[0].HeaderText = wtList["ItemLotGTIN"];
                gvItemLotNew.Columns[1].HeaderText = wtList["ItemLotLotNumber"];
                gvItemLotNew.Columns[2].HeaderText = wtList["ItemLotItem"];
                gvItemLotNew.Columns[3].HeaderText = wtList["ItemLotExpireDate"];
                gvItemLotNew.Columns[4].HeaderText = wtList["ItemLotNotes"];

                //validators
                string format    = ConfigurationDate.GetConfigurationDateById(int.Parse(Configuration.GetConfigurationByName("DateFormat").Value)).DateFormat;
                string expresion = ConfigurationDate.GetConfigurationDateById(int.Parse(Configuration.GetConfigurationByName("DateFormat").Value)).DateExpresion;
                ceExpireDate.Format                = format;
                revExpireDate.ErrorMessage         = format;
                revExpireDate.ValidationExpression = expresion;

                //actions
                btnEdit.Visible = actionList.Contains("EditItemLot");
                //btnRemove.Visible = actionList.Contains("RemoveItemLot");

                //buttons
                btnEdit.Text = wtList["ItemLotEditButton"];
                //btnRemove.Text = wtList["ItemLotRemoveButton"];

                ////message
                lblSuccess.Text              = wtList["ItemLotSuccessText"];
                lblWarning.Text              = wtList["ItemLotWarningText"];
                lblError.Text                = wtList["ItemLotErrorText"];
                cvItemLotNew.ErrorMessage    = wtList["ItemLotMandatory"];
                cvDate.ErrorMessage          = wtList["ItemLotDateValidator"];
                cvGtinLotNumber.ErrorMessage = wtList["ItemLotDuplicateCheck"];

                //Page Title
                lblTitle.Text = wtList["ItemLotPageTitle"];

                //selected object
                string _gtin  = Request.QueryString["gtin"];
                string _lotNo = Request.QueryString["lotno"];

                if (!String.IsNullOrEmpty(_gtin) && !String.IsNullOrEmpty(_lotNo))
                {
                    ItemLot o = ItemLot.GetItemLotByGtinAndLotNo(_gtin, _lotNo);

                    if (o != null)
                    {
                        ddlItemCategory.DataBind();
                        ddlItemCategory.SelectedValue = o.ItemObject.ItemCategoryId.ToString();
                        ddlItem.DataBind();
                        ddlItem.SelectedValue = o.ItemId.ToString();
                        ddlGtin.DataBind();
                        ddlGtin.SelectedValue     = o.Gtin;
                        txtLotNumber.Text         = o.LotNumber;
                        txtExpireDate.Text        = o.ExpireDate.ToString(ConfigurationDate.GetConfigurationDateById(int.Parse(Configuration.GetConfigurationByName("DateFormat").Value)).DateFormat);
                        txtNotes.Text             = o.Notes;
                        rblIsActive.SelectedValue = o.IsActive.ToString();

                        gvItemLotNew.Visible = true;
                        odsItemLotNew.SelectParameters.Clear();
                        odsItemLotNew.SelectParameters.Add("gtin", _gtin);
                        odsItemLotNew.SelectParameters.Add("lotNumber", _lotNo);
                        odsItemLotNew.DataBind();
                        gvItemLotNew.DataBind();

                        btnEdit.Visible = true;
                    }
                }
                else
                {
                    gvItemLotNew.Visible = false;
                    //btnRemove.Visible = false;
                }
            }
            else
            {
                Response.Redirect("Default.aspx");
            }
        }
    }
コード例 #20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            List <string> actionList        = null;
            string        sessionNameAction = "";
            if (CurrentEnvironment.LoggedUser != null)
            {
                sessionNameAction = "__GIS_actionList_" + CurrentEnvironment.LoggedUser.Id;
                actionList        = (List <string>)Session[sessionNameAction];
            }

            if ((actionList != null) && actionList.Contains("ViewHealthFacility") && (CurrentEnvironment.LoggedUser != null))
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);
                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["HealthFacility-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "HealthFacility");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("HealthFacility-dictionary" + language, wtList);
                }

                //controls
                this.lblName.Text                  = wtList["HealthFacilityName"];
                this.lblCode.Text                  = wtList["HealthFacilityCode"];
                this.lblParentId.Text              = wtList["HealthFacilityParent"];
                this.lblTopLevel.Text              = wtList["HealthFacilityTopLevel"];
                this.lblLeaf.Text                  = wtList["HealthFacilityLeaf"];
                this.lblNotes.Text                 = wtList["HealthFacilityNotes"];
                this.lblIsActive.Text              = wtList["HealthFacilityIsActive"];
                this.lblVaccinationPoint.Text      = wtList["HealthFacilityVaccinationPoint"];
                this.lblAddress.Text               = wtList["HealthFacilityAddress"];
                this.lblContact.Text               = wtList["HealthFacilityContact"];
                this.lblType.Text                  = wtList["HealthFacilityType"];
                this.lblOwnership.Text             = wtList["HealthFacilityOwnership"];
                this.lblColdStorageCapacity.Text   = wtList["HealthFacilityColdStorageCap"];
                this.rblIsActive.Items[0].Text     = wtList["HealthFacilityYes"];
                this.rblIsActive.Items[1].Text     = wtList["HealthFacilityNo"];
                this.rblLeaf.Items[0].Text         = wtList["HealthFacilityYes"];
                this.rblLeaf.Items[1].Text         = wtList["HealthFacilityNo"];
                this.rblTopLevel.Items[0].Text     = wtList["HealthFacilityYes"];
                this.rblTopLevel.Items[1].Text     = wtList["HealthFacilityNo"];
                this.lblVaccineStore.Text          = wtList["HealthFacilityVaccineStore"];
                this.rblVaccineStore.Items[0].Text = wtList["HealthFacilityYes"];
                this.rblVaccineStore.Items[1].Text = wtList["HealthFacilityNo"];

                //grid header text
                gvHealthFacility.Columns[1].HeaderText  = wtList["HealthFacilityName"];
                gvHealthFacility.Columns[2].HeaderText  = wtList["HealthFacilityCode"];
                gvHealthFacility.Columns[3].HeaderText  = wtList["HealthFacilityParent"];
                gvHealthFacility.Columns[4].HeaderText  = wtList["HealthFacilityTopLevel"];
                gvHealthFacility.Columns[5].HeaderText  = wtList["HealthFacilityLeaf"];
                gvHealthFacility.Columns[6].HeaderText  = wtList["HealthFacilityVaccinationPoint"];
                gvHealthFacility.Columns[7].HeaderText  = wtList["HealthFacilityVaccineStore"];
                gvHealthFacility.Columns[9].HeaderText  = wtList["HealthFacilityIsActive"];
                gvHealthFacility.Columns[14].HeaderText = wtList["HealthFacilityAddUserButton"];

                //actions
                this.btnAdd.Visible    = actionList.Contains("AddHealthFacility");
                this.btnEdit.Visible   = actionList.Contains("EditHealthFacility");
                this.btnRemove.Visible = actionList.Contains("RemoveHealthFacility");
                //this.btnAddUser.Visible = actionList.Contains("HealthFacilityAddUser");

                //buttons
                this.btnAdd.Text    = wtList["HealthFacilityAddButton"];
                this.btnEdit.Text   = wtList["HealthFacilityEditButton"];
                this.btnRemove.Text = wtList["HealthFacilityRemoveButton"];
                //this.btnAddUser.Text = wtList["HealthFacilityAddUserButton"];

                //Page Title
                this.lblTitle.Text = wtList["HealthFacilityPageTitle"];

                //message
                this.lblSuccess.Text = wtList["HealthFacilitySuccessText"];
                this.lblWarning.Text = wtList["HealthFacilityWarningText"];
                this.lblError.Text   = wtList["HealthFacilityErrorText"];
                if ((String)HttpContext.Current.Session["_successHealthfacility"] == "1")
                {
                    lblSuccess.Visible = true;
                }
                else
                {
                    lblSuccess.Visible = false;
                }

                HttpContext.Current.Session["_successHealthfacility"] = "0";

                //validators
                cvHealthFacility.ErrorMessage = wtList["HealthFacilityMandatory"];
                revHealthFacility.Text        = wtList["HealthFacilityParentValidator"];
                revName.ErrorMessage          = wtList["HealthFacilityNameValidator"];
                // revCode.ErrorMessage = wtList["HealthFacilityCodeValidator"];
                revCapacity.ErrorMessage = wtList["HealthFacilityCapacityValidator"];
                revPhone.ErrorMessage    = wtList["HealthFacilityContactValidator"];
                cvLevels.ErrorMessage    = wtList["HealthFacilityLevelValidator"];

                //Selected object
                int    id  = -1;
                string _id = Request.QueryString["id"];
                if (!String.IsNullOrEmpty(_id))
                {
                    int.TryParse(_id, out id);
                    HealthFacility o = HealthFacility.GetHealthFacilityById(id);
                    txtName.Text = o.Name;
                    txtCode.Text = o.Code;
                    if (o.Parent != null)
                    {
                        txtParentId.SelectedItemText = o.Parent.Name.ToString();
                    }
                    txtNotes.Text                     = o.Notes;
                    rblTopLevel.SelectedValue         = o.TopLevel.ToString();
                    rblLeaf.SelectedValue             = o.Leaf.ToString();
                    rblVaccinationPoint.SelectedValue = o.VaccinationPoint.ToString();
                    rblVaccineStore.SelectedValue     = o.VaccineStore.ToString();
                    rblIsActive.SelectedValue         = o.IsActive.ToString();
                    txtAddress.Text                   = o.Address;
                    txtContact.Text                   = o.Contact;
                    txtColdStorageCapacity.Text       = o.ColdStorageCapacity.ToString();
                    if (o.TypeId != null)
                    {
                        ddlType.SelectedValue = o.TypeId.ToString();
                    }
                    ddlOwnership.SelectedValue = o.Ownership.ToString();

                    gridview_Databind(id);
                    healthCenterId = o.ParentId.ToString();
                    btnAdd.Visible = false;
                    // btnAddUser.Visible = false;
                    //HttpContext.Current.Session["_lastHealthfacility"] = id;
                }
                else
                {
                    if (HttpContext.Current.Session["_lastHealthfacility"] != null)
                    {
                        int i = (int)HttpContext.Current.Session["_lastHealthfacility"];
                        gridview_Databind(i);
                        // btnAddUser.Visible = true;
                        btnEdit.Visible   = false;
                        btnRemove.Visible = false;
                        HttpContext.Current.Session["_lastHealthfacility"] = null;
                        //  int max = HealthFacility.GetHealthFacilityMaxId();
                        //  int lcode = int.Parse(HealthFacility.GetHealthFacilityById(max).Code);
                        //  lcode += 1;
                        //string code = lcode.ToString();
                        //  switch (code.ToString().Length)
                        //  {
                        //      case 1:
                        //          code = "0000" + code;
                        //          break;
                        //      case 2:
                        //          code = "000" + code;
                        //          break;
                        //      case 3:
                        //          code = "00" + code;
                        //          break;
                        //      case 4:
                        //          code = "0" + code;
                        //          break;
                        //  }
                        //txtCode.Text = code;
                    }
                    else
                    {
                        btnEdit.Visible   = false;
                        btnRemove.Visible = false;
                        // btnAddUser.Visible = false;

                        //new code

                        //int max = HealthFacility.GetHealthFacilityMaxId();
                        //int lcode = int.Parse(HealthFacility.GetHealthFacilityById(max).Code);
                        //lcode += 1;
                        //string code = lcode.ToString();
                        //switch (code.ToString().Length)
                        //{
                        //    case 1:
                        //        code = "0000" + code;
                        //        break;
                        //    case 2:
                        //        code = "000" + code;
                        //        break;
                        //    case 3:
                        //        code = "00" + code;
                        //        break;
                        //    case 4:
                        //        code = "0" + code;
                        //        break;
                        //}
                        //txtCode.Text = code;
                    }
                }

                if (HealthFacility.ExistsTopLevel() > 0)
                {
                    rblTopLevel.Enabled = false;
                }
            }
            else
            {
                Response.Redirect("Default.aspx", false);
            }
        }
    }
コード例 #21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            List <string> actionList        = null;
            string        sessionNameAction = "";
            if (CurrentEnvironment.LoggedUser != null)
            {
                sessionNameAction = "__GIS_actionList_" + CurrentEnvironment.LoggedUser.Id;
                actionList        = (List <string>)Session[sessionNameAction];
            }

            if ((actionList != null) && actionList.Contains("ViewHelp") && (CurrentEnvironment.LoggedUser != null))
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);
                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["Help-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "Help");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("Help-dictionary" + language, wtList);
                }

                lblLanguageId.Text = wtList["HelpLanguage"];
                lblPageName.Text   = wtList["HelpPage"];
                //grid header text
                gvHelp.Columns[1].HeaderText = wtList["HelpPage"];
                gvHelp.Columns[3].HeaderText = wtList["HelpHelpText"];
                gvHelp.Columns[2].HeaderText = wtList["HelpLanguage"];

                //actions
                this.btnAdd.Visible = actionList.Contains("AddHelp");
                //this.btnEdit.Visible = actionList.Contains("EditHelp");

                //buttons
                this.btnAdd.Text = wtList["HelpAddButton"];
                //this.btnEdit.Text = wtList["HelpEditButton"];

                //message
                this.lblSuccess.Text = wtList["HelpSuccessText"];
                this.lblWarning.Text = wtList["HelpWarningText"];
                this.lblError.Text   = wtList["HelpErrorText"];

                //Page Title
                this.lblTitle.Text = wtList["HelpPageTitle"];

                if (Session["__languageid"] != null)
                {
                    ddlLanguage.SelectedValue = Session["__languageid"].ToString();
                }

                odsLanguages.DataBind();
                ddlLanguage.DataSourceID = "odsLanguages";
                ddlLanguage.DataBind();

                ddlLanguage.SelectedValue = languageId.ToString();

                //gvHelp.DataSource = Help.GetHelpByLanguage(languageId);
                //gvHelp.DataBind();

                if (Page.Request.QueryString["menuid"] != null)
                {
                    string menuid = Page.Request.QueryString["menuid"].ToString();
                    Help   help   = Help.GetHelpByPageAndLanguage(menuid, int.Parse(ddlLanguage.SelectedValue));
                    if (Page.Request.QueryString["text"] != null)
                    {
                        lblPage.Text = Page.Request.QueryString["text"].ToString();
                    }
                    if (help != null)
                    {
                        txtHelpText.Text = help.HelpText;
                    }
                }
                else
                {
                    btnAdd.Visible = false;
                }
            }
            else
            {
                Response.Redirect("Default.aspx");
            }
        }
    }
コード例 #22
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            List <string> actionList        = null;
            string        sessionNameAction = "";
            if (CurrentEnvironment.LoggedUser != null)
            {
                sessionNameAction = "__GIS_actionList_" + CurrentEnvironment.LoggedUser.Id;
                actionList        = (List <string>)Session[sessionNameAction];
            }

            if ((actionList != null) && actionList.Contains("ViewVaccinationActivityReport") && (CurrentEnvironment.LoggedUser != null))
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);

                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["VaccinationActivityReport-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "VaccinationActivityReport");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("VaccinationActivityReport-dictionary" + language, wtList);
                }

                this.lblTitle.Text  = wtList["VaccinationActivityReportPageTitle"];
                this.btnSearch.Text = wtList["VaccinationActivityReportSearchButton"];
                this.btnExcel.Text  = wtList["VaccinationActivityReportExcelButton"];
                this.btnPrint.Text  = wtList["VaccinationActivityReportPrintButton"];
                this.lblItem.Text   = wtList["VaccinationActivityReportItem"];
                this.lblYear.Text   = wtList["VaccinationActivityReportYear"];

                string jan = wtList["Jan"];
                string feb = wtList["Feb"];
                string mar = wtList["Mar"];
                string apr = wtList["Apr"];
                string may = wtList["May"];
                string jun = wtList["Jun"];
                string jul = wtList["Jul"];
                string aug = wtList["Aug"];
                string sep = wtList["Sep"];
                string oct = wtList["Oct"];
                string nov = wtList["Nov"];
                string dec = wtList["Dec"];

                string vaccine = wtList["Vaccine"];
                string total   = wtList["Total"];
                string planned = wtList["Planned"];

                string months = string.Format(@" ""{12}"" text, ""{0}"" int, ""{1}"" int, ""{2}"" int, ""{3}"" int, ""{4}"" int, ""{5}"" int, ""{6}"" int, ""{7}"" int, ""{8}"" int, ""{9}"" int, ""{10}"" int, ""{11}"" int ", jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec, vaccine);

                Session["__Months"]   = months;
                Session["__Total"]    = total;
                Session["__Planned"]  = planned;
                ddlYear.SelectedValue = DateTime.Today.Date.Year.ToString();
            }
        }
    }
コード例 #23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            if (CurrentEnvironment.LoggedUser != null)
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);
                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["Child-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "Child");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("Child-dictionary" + language, wtList);
                }
                #region Person Configuration

                List <PersonConfiguration> pcList = PersonConfiguration.GetPersonConfigurationList();

                foreach (PersonConfiguration pc in pcList)
                {
                    if (pc.IsVisible == false)
                    {
                        Control lbl = FindMyControl(this, "lbl" + pc.ColumnName);
                        Control txt = FindMyControl(this, "txt" + pc.ColumnName);
                        Control tr  = FindMyControl(this, "tr" + pc.ColumnName);

                        if (lbl != null)
                        {
                            lbl.Visible = false;
                        }

                        if (txt != null)
                        {
                            txt.Visible = false;
                        }



                        if (tr != null)
                        {
                            tr.Visible = false;
                        }

                        for (int i = 1; i < gvChild.Columns.Count; i++)
                        {
                            if (gvChild.Columns[i].HeaderText == pc.ColumnName)
                            {
                                gvChild.Columns[i].Visible = false;
                                break;
                            }
                        }
                    }
                }
                string id1 = Configuration.GetConfigurationByName("IdentificationNo1").Value;
                string id2 = Configuration.GetConfigurationByName("IdentificationNo2").Value;
                string id3 = Configuration.GetConfigurationByName("IdentificationNo3").Value;
                #endregion

                this.lbHealthFacility.Text = wtList["ImmunizedChildrenByLotHealthFacility"];
                this.lbLotId.Text          = wtList["ImmunizedChildrenByLotItemLot"];
                this.lbChildNo.Text        = wtList["ImmunizedChildrenByLotChildrenNo"];

                this.lblTitle.Text = wtList["PrintImmunizedChildrenByLotPageTitle"];

                //grid header text
                #region Grid Columns
                gvChild.Columns[1].HeaderText  = wtList["ChildSystem"];
                gvChild.Columns[2].HeaderText  = wtList["ChildFirstname1"];
                gvChild.Columns[3].HeaderText  = wtList["ChildFirstname2"];
                gvChild.Columns[4].HeaderText  = wtList["ChildLastname1"];
                gvChild.Columns[5].HeaderText  = wtList["ChildLastname2"];
                gvChild.Columns[6].HeaderText  = wtList["ChildBirthdate"];
                gvChild.Columns[7].HeaderText  = wtList["ChildGender"];
                gvChild.Columns[8].HeaderText  = wtList["ChildHealthcenter"];
                gvChild.Columns[9].HeaderText  = wtList["ChildBirthplace"];
                gvChild.Columns[10].HeaderText = wtList["ChildCommunity"];
                gvChild.Columns[11].HeaderText = wtList["ChildDomicile"];
                gvChild.Columns[12].HeaderText = wtList["ChildStatus"];
                gvChild.Columns[13].HeaderText = wtList["ChildAddress"];
                gvChild.Columns[14].HeaderText = wtList["ChildPhone"];
                gvChild.Columns[15].HeaderText = wtList["ChildMobile"];
                gvChild.Columns[16].HeaderText = wtList["ChildEmail"];
                gvChild.Columns[17].HeaderText = wtList["ChildMother"];
                gvChild.Columns[18].HeaderText = wtList["ChildMotherFirstname"];
                gvChild.Columns[19].HeaderText = wtList["ChildMotherLastname"];
                gvChild.Columns[20].HeaderText = wtList["ChildFather"];
                gvChild.Columns[21].HeaderText = wtList["ChildFatherFirstname"];
                gvChild.Columns[22].HeaderText = wtList["ChildFatherLastname"];
                gvChild.Columns[23].HeaderText = wtList["ChildCaretaker"];
                gvChild.Columns[24].HeaderText = wtList["ChildCaretakerFirstname"];
                gvChild.Columns[25].HeaderText = wtList["ChildCaretakerLastname"];
                gvChild.Columns[26].HeaderText = wtList["ChildNotes"];
                gvChild.Columns[27].HeaderText = wtList["ChildIsActive"];
                gvChild.Columns[30].HeaderText = id1;
                gvChild.Columns[31].HeaderText = id2;
                gvChild.Columns[32].HeaderText = id3;

                #endregion

                int    hfId  = CurrentEnvironment.LoggedUser.HealthFacilityId;
                string _hfId = (string)Request.QueryString["hfId"];
                if (!String.IsNullOrEmpty(_hfId))
                {
                    int.TryParse(_hfId, out hfId);
                }

                int lotId = 0;
                lotId = Helper.ConvertToInt(HttpContext.Current.Session["ImmunizedChildrenByLot-lotID"].ToString());

                lblHealthFacility.Text = HealthFacility.GetHealthFacilityById(hfId).Name;
                if (lotId != 0)
                {
                    lblLotId.Text = ItemLot.GetItemLotById(lotId).LotNumber;
                }
                lblChildNo.Text = Child.GetCountImmunizedChildrenByLot(hfId, lotId).ToString();
                int maximumRows   = int.MaxValue;
                int startRowIndex = 0;

                List <Child> list = Child.GetImmunizedChildrenByLot(ref maximumRows, ref startRowIndex, hfId, lotId);
                gvChild.DataSource = list;
                gvChild.DataBind();
            }
            else
            {
                Response.Redirect("Default.aspx", false);
            }
        }
    }
コード例 #24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            List <string> actionList        = null;
            string        sessionNameAction = "";
            if (CurrentEnvironment.LoggedUser != null)
            {
                sessionNameAction = "__GIS_actionList_" + CurrentEnvironment.LoggedUser.Id;
                actionList        = (List <string>)Session[sessionNameAction];
            }

            if ((actionList != null) && actionList.Contains("ViewItemLotsCloseToExpiry") && (CurrentEnvironment.LoggedUser != null))
            {
                int userId = CurrentEnvironment.LoggedUser.Id;

                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);
                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["ItemLotsCloseToExpiry-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "ItemLotsCloseToExpiry");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("ItemLotsCloseToExpiry-dictionary" + language, wtList);
                }

                this.lblEntryDateFrom.Text = wtList["ItemLotsCloseToExpiryExpireDate"];
                this.lblItem.Text          = wtList["ItemLotsCloseToExpiryItem"];

                //grid header text
                gvItemLot.Columns[1].HeaderText = wtList["ItemLotsCloseToExpiryLotNumber"];
                gvItemLot.Columns[2].HeaderText = wtList["ItemLotsCloseToExpiryItem"];
                gvItemLot.Columns[3].HeaderText = wtList["ItemLotsCloseToExpiryEntryDate"];
                gvItemLot.Columns[4].HeaderText = wtList["ItemLotsCloseToExpiryExpireDate"];
                gvItemLot.Columns[5].HeaderText = wtList["ItemLotsCloseToExpiryReceived"];
                gvItemLot.Columns[6].HeaderText = wtList["ItemLotsCloseToExpiryDistributed"];
                gvItemLot.Columns[7].HeaderText = wtList["ItemLotsCloseToExpiryUsed"];
                gvItemLot.Columns[8].HeaderText = wtList["ItemLotsCloseToExpiryWasted"];
                gvItemLot.Columns[9].HeaderText = wtList["ItemLotsCloseToExpiryBalance"];

                this.btnSearch.Text = wtList["ItemLotsCloseToExpirySearchButton"];
                this.btnExcel.Text  = wtList["ItemLotsCloseToExpiryExcelButton"];
                this.btnPrint.Text  = wtList["ItemLotsCloseToExpiryPrintButton"];

                //validators
                string format    = ConfigurationDate.GetConfigurationDateById(int.Parse(Configuration.GetConfigurationByName("DateFormat").Value)).DateFormat;
                string expresion = ConfigurationDate.GetConfigurationDateById(int.Parse(Configuration.GetConfigurationByName("DateFormat").Value)).DateExpresion;

                ceExpireDate.Format                = format;
                revExpireDate.ErrorMessage         = format;
                revExpireDate.ValidationExpression = expresion;
                //txtExpireDate.Text = DateTime.Today.AddMonths(1).ToString(format);

                //message
                this.lblWarning.Text = wtList["ItemLotsCloseToExpirySearchWarningText"];

                //Page Title
                this.lblTitle.Text = wtList["ItemLotsCloseToExpiryListPageTitle"];

                //gridview databind
                string where = string.Format(@" AND ""EXPIRE_DATE"" <= '{0}' ", DateTime.Today.AddMonths(1).ToString("yyyy-MM-dd"));

                odsItemLot.SelectParameters.Clear();
                odsItemLot.SelectParameters.Add("hfId", CurrentEnvironment.LoggedUser.HealthFacilityId.ToString());
                odsItemLot.SelectParameters.Add("where", where);
                HttpContext.Current.Session["where"] = where;
            }
            else
            {
                Response.Redirect("Default.aspx", false);
                Context.ApplicationInstance.CompleteRequest();
            }
        }
    }
コード例 #25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            List <string> actionList        = null;
            string        sessionNameAction = "";
            if (CurrentEnvironment.LoggedUser != null)
            {
                sessionNameAction = "__GIS_actionList_" + CurrentEnvironment.LoggedUser.Id;
                actionList        = (List <string>)Session[sessionNameAction];
            }

            if (CurrentEnvironment.LoggedUser != null)
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);
                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["Reports-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "Reports");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("Reports-dictionary" + language, wtList);
                }

                //controls
                //this.lblTitle.Text = wtList["ReportsPageTitle"];

                //this.lblImmunizationReports.Text = wtList["ReportsImmunization"];
                //this.mCohortCoverageReport.InnerText = wtList["ReportsCohortCoverage"];
                //this.mActivityReport.InnerText = wtList["ReportsActivityReport"];

                //this.lblStockReports.Text = wtList["ReportsStock"];

                //this.mRunningBalance.InnerText = wtList["ReportsRunningBalance"];
                //this.mItemInHealthFacility.InnerText = wtList["ReportsItemInHealthFacilities"];
                //this.mItemLotInHealthFacility.InnerText = wtList["ReportsItemLotInHealthFacilities"];
                //this.mStockCountList.InnerText = wtList["ReportsViewStockCounts"];
                //this.mAdjustmentsList.InnerText = wtList["ReportsViewAdjustments"];

                //this.mClosedVialWastage.InnerText = wtList["ReportsClosedVialWastage"];
                //this.mItemLotsCloseToExpiry.InnerText = wtList["ReportsItemLotsCloseToExpiry"];
                //this.mLotTracking.InnerText = wtList["ReportsLotTracking"];
                //this.mConsumption.InnerText = wtList["ReportsConsumption"];


                //visible
                //this.lblImmunizationReports.Visible = actionList.Contains("ViewMenuImmunizationReports");
                //this.aCohortCoverageReport.Visible = actionList.Contains("ViewMenuCohortCoverageReport");
                //this.aActivityReport.Visible = actionList.Contains("ViewMenuActivityReport");

                //this.lblStockReports.Visible = actionList.Contains("ViewMenuStockReports");

                //this.aRunningBalance.Visible = actionList.Contains("ViewMenuRunningBalance");
                //this.aItemInHealthFacility.Visible = actionList.Contains("ViewMenuItemInHealthFacilities");
                //this.aItemLotInHealthFacility.Visible = actionList.Contains("ViewMenuItemLotInHealthFacilities");
                //this.aStockCountList.Visible = actionList.Contains("ViewMenuViewStockCounts");
                //this.aAdjustmentsList.Visible = actionList.Contains("ViewMenuViewAdjustments");

                //this.aClosedVialWastage.Visible = actionList.Contains("ViewMenuClosedVialWastage");
                //this.aItemLotsCloseToExpiry.Visible = actionList.Contains("ViewMenuItemLotsCloseToExpiry");
                //this.aLotTracking.Visible = actionList.Contains("ViewMenuLotTracking");
                //this.aConsumption.Visible = actionList.Contains("ViewMenuConsumption");


                // Populate
                // HACK: Should be done with DAL but under time crunches
                StringBuilder myRoles = new StringBuilder();
                actionList.ForEach(a => myRoles.AppendFormat("'{0}',", a));
                myRoles.Remove(myRoles.Length - 1, 1);
                string reportQuery = "SELECT \"REPORT\".*, \"GROUP_NAME\" FROM \"REPORT\" INNER JOIN \"REPORT_GROUP\" ON (\"REPORT\".\"GROUP_ID\" = \"REPORT_GROUP\".\"ID\") WHERE \"ACTION_ID\" IN (SELECT \"ID\" FROM \"ACTIONS\" WHERE \"NAME\" IN (" + myRoles.ToString() + ")) AND \"REPORT_TYPE\" = 'F' ORDER BY \"REPORT_GROUP\".\"GROUP_NAME\", \"REPORT\".\"REPORT_NAME\"";
                using (var dt = DBManager.ExecuteReaderCommand(reportQuery, System.Data.CommandType.Text, null))
                {
                    using (var rdr = dt.CreateDataReader())
                    {
                        string             grpHeader    = string.Empty;
                        HtmlGenericControl currentGroup = null;

                        while (rdr.Read())
                        {
                            // Group header
                            if (rdr["GROUP_NAME"].ToString() != grpHeader)
                            {
                                grpHeader = rdr["GROUP_NAME"].ToString();
                                var liGroup = new HtmlGenericControl("li");
                                liGroup.Controls.Add(new HtmlGenericControl("h4")
                                {
                                    InnerText = grpHeader
                                });
                                currentGroup = new HtmlGenericControl("ul");
                                liGroup.Controls.Add(currentGroup);
                                ulReports.Controls.Add(liGroup);
                            }

                            // Link to the report
                            var li = new HtmlGenericControl("li");
                            currentGroup.Controls.Add(li);
                            li.Controls.Add(new HyperLink()
                            {
                                Text        = rdr["REPORT_NAME"].ToString(),
                                NavigateUrl = "~/Pages/RunReportv2.aspx?reportId=" + rdr["ID"].ToString()
                            }
                                            );
                        }
                    }
                }
            }
            else
            {
                Response.Redirect("Default.aspx");
            }
        }
    }
コード例 #26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            List <string> actionList        = null;
            string        sessionNameAction = "";
            if (CurrentEnvironment.LoggedUser != null)
            {
                sessionNameAction = "__GIS_actionList_" + CurrentEnvironment.LoggedUser.Id;
                actionList        = (List <string>)Session[sessionNameAction];
            }

            if ((actionList != null) && actionList.Contains("ViewItemLot") && (CurrentEnvironment.LoggedUser != null))
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);
                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["ItemLot-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "ItemLot");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("ItemLot-dictionary" + language, wtList);
                }

                //controls
                lblItem.Text = wtList["ItemLotItem"];
                lblGtin.Text = wtList["ItemLotGTIN"];

                //grid header text
                gvItemLotNew.Columns[0].HeaderText = wtList["ItemLotGTIN"];
                gvItemLotNew.Columns[1].HeaderText = wtList["ItemLotLotNumber"];
                gvItemLotNew.Columns[2].HeaderText = wtList["ItemLotItem"];
                gvItemLotNew.Columns[3].HeaderText = wtList["ItemLotExpireDate"];
                gvItemLotNew.Columns[4].HeaderText = wtList["ItemLotNotes"];

                gvExport.Columns[0].HeaderText = wtList["ItemLotGTIN"];
                gvExport.Columns[1].HeaderText = wtList["ItemLotLotNumber"];
                gvExport.Columns[2].HeaderText = wtList["ItemLotItem"];
                gvExport.Columns[3].HeaderText = wtList["ItemLotExpireDate"];
                gvExport.Columns[4].HeaderText = wtList["ItemLotNotes"];

                //actions
                //btnAddNew.Visible = actionList.Contains("AddNewItemLot");
                //btnSearch.Visible = actionList.Contains("SearchItemLot");

                //Page Title
                this.lblTitle.Text = wtList["ItemLotListTitle"];

                //buttons
                this.btnAddNew.Text = wtList["ItemLotAddNewButton"];
                this.btnSearch.Text = wtList["ItemLotSearchButton"];
                this.btnExcel.Text  = wtList["ItemLotListExcelButton"];

                //message
                this.lblWarning.Text = wtList["ItemLotSearchWarningText"];

                //gridview databind
                int    itemId = -1;
                string gtin   = "";
                odsItemLotNew.SelectParameters.Clear();
                odsItemLotNew.SelectParameters.Add("itemId", itemId.ToString());
                odsItemLotNew.SelectParameters.Add("gtin", gtin);
                gvItemLotNew.DataBind();
            }
            else
            {
                Response.Redirect("Default.aspx");
            }
        }
    }
コード例 #27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            List <string> actionList        = null;
            string        sessionNameAction = "";
            if (CurrentEnvironment.LoggedUser != null)
            {
                sessionNameAction = "__GIS_actionList_" + CurrentEnvironment.LoggedUser.Id;
                actionList        = (List <string>)Session[sessionNameAction];
            }

            if ((actionList != null) && actionList.Contains("ViewCommunityList") && (CurrentEnvironment.LoggedUser != null))
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);
                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["Community-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "Community");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("Community-dictionary" + language, wtList);
                }

                //controls
                this.lblName.Text = wtList["CommunityName"];

                //grid header text
                gvCommunity.Columns[1].HeaderText = wtList["CommunityName"];
                gvCommunity.Columns[3].HeaderText = wtList["CommunityIsActive"];
                gvCommunity.Columns[2].HeaderText = wtList["CommunityNotes"];

                gvExport.Columns[1].HeaderText = wtList["CommunityName"];
                gvExport.Columns[3].HeaderText = wtList["CommunityIsActive"];
                gvExport.Columns[2].HeaderText = wtList["CommunityNotes"];

                //actions
                this.btnAddNew.Visible = actionList.Contains("AddCommunity");
                //this.btnSearch.Visible = actionList.Contains("SearchCommunity");

                //buttons
                this.btnAddNew.Text = wtList["CommunityAddNewButton"];
                this.btnSearch.Text = wtList["CommunitySearchButton"];
                this.btnExcel.Text  = wtList["CommunityExcelButton"];

                //Page Title
                this.lblTitle.Text = wtList["CommunityListPageTitle"];

                //message
                this.lblWarning.Text = wtList["CommunitySearchWarningText"];

                ////gridview databind
                //odsCommunity.SelectParameters.Clear();
                //odsCommunity.SelectParameters.Add("where", "1=1");
                //gvCommunity.DataSource = odsCommunity;
                //gvCommunity.DataBind();
                //lblWarning.Visible = false;
                //Session["CommunityList-Where"] = "1=1";
            }
            else
            {
                Response.Redirect("Default.aspx");
            }
        }
    }
コード例 #28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            List <string> actionList        = null;
            string        sessionNameAction = "";
            if (CurrentEnvironment.LoggedUser != null)
            {
                sessionNameAction = "__GIS_actionList_" + CurrentEnvironment.LoggedUser.Id;
                actionList        = (List <string>)Session[sessionNameAction];
            }

            if ((actionList != null) && actionList.Contains("ViewChildList") && (CurrentEnvironment.LoggedUser != null))
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);
                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["Child-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "Child");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("Child-dictionary" + language, wtList);
                }

                #region Person Configuration

                List <PersonConfiguration> pcList = PersonConfiguration.GetPersonConfigurationList();

                foreach (PersonConfiguration pc in pcList)
                {
                    if (pc.IsVisible == false)
                    {
                        Control lbl = FindMyControl(this, "lbl" + pc.ColumnName);
                        Control txt = FindMyControl(this, "txt" + pc.ColumnName);
                        //Control rbl = FindMyControl(this, "rbl" + pc.ColumnName);
                        Control tr = FindMyControl(this, "tr" + pc.ColumnName);

                        if (lbl != null)
                        {
                            lbl.Visible = false;
                        }

                        if (txt != null)
                        {
                            txt.Visible = false;
                        }

                        //if (rbl != null)
                        //    rbl.Visible = false;

                        if (tr != null)
                        {
                            tr.Visible = false;
                        }

                        for (int i = 1; i < gvChild.Columns.Count; i++)
                        {
                            if (gvChild.Columns[i].HeaderText == pc.ColumnName)
                            {
                                gvChild.Columns[i].Visible = false;
                                break;
                            }
                        }
                    }
                }
                string id1 = Configuration.GetConfigurationByName("IdentificationNo1").Value;
                string id2 = Configuration.GetConfigurationByName("IdentificationNo2").Value;
                string id3 = Configuration.GetConfigurationByName("IdentificationNo3").Value;
                #endregion

                //grid header text
                #region Grid Columns
                gvChild.Columns[1].HeaderText  = wtList["ChildSystem"];
                gvChild.Columns[2].HeaderText  = wtList["ChildFirstname1"];
                gvChild.Columns[3].HeaderText  = wtList["ChildFirstname2"];
                gvChild.Columns[4].HeaderText  = wtList["ChildLastname1"];
                gvChild.Columns[5].HeaderText  = wtList["ChildLastname2"];
                gvChild.Columns[6].HeaderText  = wtList["ChildBirthdate"];
                gvChild.Columns[7].HeaderText  = wtList["ChildGender"];
                gvChild.Columns[8].HeaderText  = wtList["ChildHealthcenter"];
                gvChild.Columns[9].HeaderText  = wtList["ChildBirthplace"];
                gvChild.Columns[10].HeaderText = wtList["ChildCommunity"];
                gvChild.Columns[11].HeaderText = wtList["ChildDomicile"];
                gvChild.Columns[12].HeaderText = wtList["ChildStatus"];
                gvChild.Columns[13].HeaderText = wtList["ChildAddress"];
                gvChild.Columns[14].HeaderText = wtList["ChildPhone"];
                gvChild.Columns[15].HeaderText = wtList["ChildMobile"];
                gvChild.Columns[16].HeaderText = wtList["ChildEmail"];
                gvChild.Columns[17].HeaderText = wtList["ChildMother"];
                gvChild.Columns[18].HeaderText = wtList["ChildMotherFirstname"];
                gvChild.Columns[19].HeaderText = wtList["ChildMotherLastname"];
                gvChild.Columns[20].HeaderText = wtList["ChildFather"];
                gvChild.Columns[21].HeaderText = wtList["ChildFatherFirstname"];
                gvChild.Columns[22].HeaderText = wtList["ChildFatherLastname"];
                gvChild.Columns[23].HeaderText = wtList["ChildCaretaker"];
                gvChild.Columns[24].HeaderText = wtList["ChildCaretakerFirstname"];
                gvChild.Columns[25].HeaderText = wtList["ChildCaretakerLastname"];
                gvChild.Columns[26].HeaderText = wtList["ChildNotes"];
                gvChild.Columns[27].HeaderText = wtList["ChildIsActive"];
                gvChild.Columns[30].HeaderText = id1;
                gvChild.Columns[31].HeaderText = id2;
                gvChild.Columns[32].HeaderText = id3;
                gvChild.Columns[26].Visible    = false;

                gvExel.Columns[1].HeaderText  = wtList["ChildSystem"];
                gvExel.Columns[2].HeaderText  = wtList["ChildFirstname1"];
                gvExel.Columns[3].HeaderText  = wtList["ChildFirstname2"];
                gvExel.Columns[4].HeaderText  = wtList["ChildLastname1"];
                gvExel.Columns[5].HeaderText  = wtList["ChildLastname2"];
                gvExel.Columns[6].HeaderText  = wtList["ChildBirthdate"];
                gvExel.Columns[7].HeaderText  = wtList["ChildGender"];
                gvExel.Columns[8].HeaderText  = wtList["ChildHealthcenter"];
                gvExel.Columns[9].HeaderText  = wtList["ChildBirthplace"];
                gvExel.Columns[10].HeaderText = wtList["ChildCommunity"];
                gvExel.Columns[11].HeaderText = wtList["ChildDomicile"];
                gvExel.Columns[12].HeaderText = wtList["ChildStatus"];
                gvExel.Columns[13].HeaderText = wtList["ChildAddress"];
                gvExel.Columns[14].HeaderText = wtList["ChildPhone"];
                gvExel.Columns[15].HeaderText = wtList["ChildMobile"];
                gvExel.Columns[16].HeaderText = wtList["ChildEmail"];
                gvExel.Columns[17].HeaderText = wtList["ChildMother"];
                gvExel.Columns[18].HeaderText = wtList["ChildMotherFirstname"];
                gvExel.Columns[19].HeaderText = wtList["ChildMotherLastname"];
                gvExel.Columns[20].HeaderText = wtList["ChildFather"];
                gvExel.Columns[21].HeaderText = wtList["ChildFatherFirstname"];
                gvExel.Columns[22].HeaderText = wtList["ChildFatherLastname"];
                gvExel.Columns[23].HeaderText = wtList["ChildCaretaker"];
                gvExel.Columns[24].HeaderText = wtList["ChildCaretakerFirstname"];
                gvExel.Columns[25].HeaderText = wtList["ChildCaretakerLastname"];
                gvExel.Columns[26].HeaderText = wtList["ChildNotes"];
                gvExel.Columns[27].HeaderText = wtList["ChildIsActive"];
                gvExel.Columns[30].HeaderText = id1;
                gvExel.Columns[31].HeaderText = id2;
                gvExel.Columns[32].HeaderText = id3;
                gvExel.Columns[26].Visible    = false;
                #endregion

                //message
                this.lblWarning.Text = wtList["ChildSearchWarningText"];

                //buttons
                //this.btnSearch.Text = wtList["ChildSearchAgainButton"];//Add this entry in DB
                this.btnExcel.Text = wtList["ChildExcelButton"];

                //Page Title
                this.lblTitle.Text = wtList["ChildListNewPageTitle"];

                odsChild.SelectParameters.Clear();

                if (HttpContext.Current.Session["_statusChildListNew"] != null)
                {
                    odsChild.SelectParameters.Add("statusId", HttpContext.Current.Session["_statusChildListNew"].ToString());
                }
                if (HttpContext.Current.Session["_birthdateFromChildListNew"] != null)
                {
                    odsChild.SelectParameters.Add("birthdateFrom", HttpContext.Current.Session["_birthdateFromChildListNew"].ToString());
                }
                if (HttpContext.Current.Session["_birthdateToChildListNew"] != null)
                {
                    odsChild.SelectParameters.Add("birthdateTo", HttpContext.Current.Session["_birthdateToChildListNew"].ToString());
                }
                if (HttpContext.Current.Session["_firstname1ChildListNew"] != null)
                {
                    odsChild.SelectParameters.Add("firstname1", HttpContext.Current.Session["_firstname1ChildListNew"].ToString());
                }
                if (HttpContext.Current.Session["_lastname1ChildListNew"] != null)
                {
                    odsChild.SelectParameters.Add("lastname1", HttpContext.Current.Session["_lastname1ChildListNew"].ToString());
                }
                if (HttpContext.Current.Session["_motherfirstname1ChildListNew"] != null)
                {
                    odsChild.SelectParameters.Add("motherFirstname", HttpContext.Current.Session["_motherfirstname1ChildListNew"].ToString());
                }
                if (HttpContext.Current.Session["_motherlastname1ChildListNew"] != null)
                {
                    odsChild.SelectParameters.Add("motherLastname", HttpContext.Current.Session["_motherlastname1ChildListNew"].ToString());
                }
                if (HttpContext.Current.Session["_idFieldsChildListNew"] != null)
                {
                    odsChild.SelectParameters.Add("idFields", HttpContext.Current.Session["_idFieldsChildListNew"].ToString());
                }
                if (HttpContext.Current.Session["_systemIdChildListNew"] != null)
                {
                    odsChild.SelectParameters.Add("systemId", HttpContext.Current.Session["_systemIdChildListNew"].ToString());
                }
                if (HttpContext.Current.Session["_barcodeIdChildListNew"] != null)
                {
                    odsChild.SelectParameters.Add("barcodeId", HttpContext.Current.Session["_barcodeIdChildListNew"].ToString());
                }
                if (HttpContext.Current.Session["_tempIdChildListNew"] != null)
                {
                    odsChild.SelectParameters.Add("tempId", HttpContext.Current.Session["_tempIdChildListNew"].ToString());
                }
                if (HttpContext.Current.Session["_healthCenterIdChildListNew"] != null)
                {
                    odsChild.SelectParameters.Add("healthFacilityId", HttpContext.Current.Session["_healthCenterIdChildListNew"].ToString());
                }
                if (HttpContext.Current.Session["_birthplace"] != null)
                {
                    odsChild.SelectParameters.Add("birthplaceId", HttpContext.Current.Session["_birthplace"].ToString());
                }
                else
                {
                    odsChild.SelectParameters.Add("birthplaceId", "");
                }
                if (HttpContext.Current.Session["_community"] != null)
                {
                    odsChild.SelectParameters.Add("communityId", HttpContext.Current.Session["_community"].ToString());
                }
                else
                {
                    odsChild.SelectParameters.Add("communityId", "");
                }
                if (HttpContext.Current.Session["_domicile"] != null)
                {
                    odsChild.SelectParameters.Add("domicileId", HttpContext.Current.Session["_domicile"].ToString());
                }
                else
                {
                    odsChild.SelectParameters.Add("domicileId", "");
                }

                //if (odsChild.SelectParameters.Count > 3)  // why
                //{
                gvChild.DataSourceID = "odsChild";
                gvChild.DataBind();
                //}
            }
            else
            {
                Response.Redirect("Default.aspx");
            }
        }
    }
コード例 #29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            List <string> actionList        = null;
            string        sessionNameAction = "";
            if (CurrentEnvironment.LoggedUser != null)
            {
                sessionNameAction = "__GIS_actionList_" + CurrentEnvironment.LoggedUser.Id;
                actionList        = (List <string>)Session[sessionNameAction];
            }

            if ((actionList != null) && actionList.Contains("ViewHealthFacilityList") && (CurrentEnvironment.LoggedUser != null))
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);
                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["HealthFacility-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "HealthFacility");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("HealthFacility-dictionary" + language, wtList);
                }

                //controls
                this.lblName.Text = wtList["HealthFacilityName"];
                this.lblCode.Text = wtList["HealthFacilityCode"];

                //grid header text
                gvHealthFacility.Columns[1].HeaderText = wtList["HealthFacilityName"];
                gvHealthFacility.Columns[2].HeaderText = wtList["HealthFacilityCode"];
                gvHealthFacility.Columns[3].HeaderText = wtList["HealthFacilityParent"];
                gvHealthFacility.Columns[4].HeaderText = wtList["HealthFacilityTopLevel"];
                gvHealthFacility.Columns[5].HeaderText = wtList["HealthFacilityLeaf"];
                gvHealthFacility.Columns[6].HeaderText = wtList["HealthFacilityVaccinationPoint"];
                // gvHealthFacility.Columns[7].HeaderText = wtList["HealthFacilityListViewActivityReport"];


                //actions
                // this.btnSearch.Visible = actionList.Contains("SearchHealthFacility");

                //buttons
                this.btnSearch.Text = wtList["HealthFacilitySearchButton"];

                //message
                this.lblWarning.Text = wtList["HealthFacilitySearchWarningText"];

                //Page Title
                // this.lblTitle.Text = wtList["HealthFacilityListPageTitle"];

                //gridview databind
                string sessionvar = "_healthfacility_" + CurrentEnvironment.LoggedUser.HealthFacilityId.ToString();
                string s;
                if (Session[sessionvar] != null)
                {
                    s = Session[sessionvar].ToString();
                }
                else
                {
                    s = HealthFacility.GetAllChildsForOneHealthFacility(CurrentEnvironment.LoggedUser.HealthFacilityId);
                    Session[sessionvar] = s;
                }
                odsHealthFacility.SelectParameters.Clear();
                odsHealthFacility.SelectParameters.Add("name", "");
                odsHealthFacility.SelectParameters.Add("code", "");
                odsHealthFacility.SelectParameters.Add("hfid", s);
                odsHealthFacility.DataBind();
                gvHealthFacility.DataSourceID = "odsHealthFacility";
                gvHealthFacility.DataBind();

                int count = gvHealthFacility.Rows.Count;
                if (count == 1)
                {
                    Response.Redirect("VaccinationActivityReport.aspx?hfId=" + CurrentEnvironment.LoggedUser.HealthFacilityId);
                }
            }
            else
            {
                Response.Redirect("Default.aspx", false);
                Context.ApplicationInstance.CompleteRequest();
            }
        }
    }
コード例 #30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            List <string> actionList        = null;
            string        sessionNameAction = "";
            if (CurrentEnvironment.LoggedUser != null)
            {
                sessionNameAction = "__GIS_actionList_" + CurrentEnvironment.LoggedUser.Id;
                actionList        = (List <string>)Session[sessionNameAction];
            }

            if ((actionList != null) && actionList.Contains("ViewManufacturer") && (CurrentEnvironment.LoggedUser != null))
            {
                int    userId     = CurrentEnvironment.LoggedUser.Id;
                string language   = CurrentEnvironment.Language;
                int    languageId = int.Parse(language);
                Dictionary <string, string> wtList = (Dictionary <string, string>)HttpContext.Current.Cache["Manufacturer-dictionary" + language];
                if (wtList == null)
                {
                    List <WordTranslate> wordTranslateList = WordTranslate.GetWordByLanguage(languageId, "Manufacturer");
                    wtList = new Dictionary <string, string>();
                    foreach (WordTranslate vwt in wordTranslateList)
                    {
                        wtList.Add(vwt.Code, vwt.Name);
                    }
                    HttpContext.Current.Cache.Insert("Manufacturer-dictionary" + language, wtList);
                }

                //controls
                this.lblName.Text = wtList["ManufacturerName"];
                this.lblCode.Text = wtList["ManufacturerCode"];
                this.lblHl7ManufacturerId.Text = wtList["ManufacturerHl7Manufacturer"];
                this.lblIsActive.Text          = wtList["ManufacturerIsActive"];
                this.lblNotes.Text             = wtList["ManufacturerNotes"];

                //grid header text
                gvManufacturer.Columns[1].HeaderText = wtList["ManufacturerName"];
                gvManufacturer.Columns[2].HeaderText = wtList["ManufacturerCode"];
                //gvManufacturer.Columns[3].HeaderText = wtList["ManufacturerHl7Manufacturer"];
                gvManufacturer.Columns[4].HeaderText = wtList["ManufacturerIsActive"];
                gvManufacturer.Columns[3].HeaderText = wtList["ManufacturerNotes"];

                //actions
                this.btnAdd.Visible    = actionList.Contains("AddManufacturer");
                this.btnEdit.Visible   = actionList.Contains("EditManufacturer");
                this.btnRemove.Visible = actionList.Contains("RemoveManufacturer");

                //buttons
                this.btnAdd.Text    = wtList["ManufacturerAddButton"];
                this.btnEdit.Text   = wtList["ManufacturerEditButton"];
                this.btnRemove.Text = wtList["ManufacturerRemoveButton"];

                //message
                this.lblSuccess.Text = wtList["ManufacturerSuccessText"];
                this.lblWarning.Text = wtList["ManufacturerWarningText"];
                this.lblError.Text   = wtList["ManufacturerErrorText"];

                //Page Title
                this.lblTitle.Text = wtList["ManufacturerPageTitle"];

                //validators
                // rfvCode.ErrorMessage = wtList["ManufacturerMandatory"];
                rfvName.ErrorMessage = wtList["ManufacturerMandatory"];
                revCode.ErrorMessage = wtList["ManufacturerCodeValidator"];
                revName.ErrorMessage = wtList["ManufacturerNameValidator"];

                //Selected object
                int    id  = -1;
                string _id = Request.QueryString["id"];
                if (!String.IsNullOrEmpty(_id))
                {
                    int.TryParse(_id, out id);
                    Manufacturer o = Manufacturer.GetManufacturerById(id);
                    if (o.Hl7ManufacturerId != 0)
                    {
                        ddlHl7Manufacturer.SelectedValue = o.Hl7ManufacturerId.ToString();
                    }

                    txtName.Text  = o.Name;
                    txtCode.Text  = o.Code;
                    txtNotes.Text = o.Notes;
                    rblIsActive.Items[0].Selected = o.IsActive;
                    rblIsActive.Items[1].Selected = !o.IsActive;
                    gridview_Databind(id);
                    btnAdd.Visible = false;
                }
                else
                {
                    btnEdit.Visible   = false;
                    btnRemove.Visible = false;
                }
            }
            else
            {
                Response.Redirect("Default.aspx");
            }
        }
    }