예제 #1
0
        protected void ctlBankFormView_ItemUpdating(object sender, FormViewUpdateEventArgs e)
        {
            short  bankId = UIHelper.ParseShort(ctlBankFormView.DataKey.Value.ToString());
            DbBank dbBank = DbBankService.FindByIdentity(bankId);

            TextBox  txtBankNo  = ctlBankFormView.FindControl("ctlTxtBankNo") as TextBox;
            TextBox  txtComment = ctlBankFormView.FindControl("ctlTxtComment") as TextBox;
            CheckBox chkActive  = ctlBankFormView.FindControl("chkActive") as CheckBox;

            dbBank.BankNo  = txtBankNo.Text;
            dbBank.Comment = txtComment.Text;
            dbBank.Active  = chkActive.Checked;

            dbBank.UpdPgm  = ProgramCode;
            dbBank.UpdDate = DateTime.Now.Date;
            dbBank.UpdBy   = UserAccount.UserID;

            try
            {
                DbBankService.SaveOrUpdate(dbBank);

                // Cancel insert with DataSource.
                e.Cancel = true;
                ctlGridBank.DataCountAndBind();
                ctlBankModalPopupExtender.Hide();
                UpdatePanelGridView.Update();
            }
            catch
            { }
            //catch ( ServiceValidationException ex)
            //{
            //    ValidationErrors.MergeErrors(ex.ValidationErrors);
            //}
        }
예제 #2
0
        protected void ctlProvinceFormView_ItemUpdating(object sender, FormViewUpdateEventArgs e)
        {
            short      provinceId = UIHelper.ParseShort(ctlProvinceFormView.DataKey.Value.ToString());
            DbProvince dbProvince = DbProvinceService.FindByIdentity(provinceId);

            TextBox      ctlTxtProvinceName = ctlProvinceFormView.FindControl("ctlTxtProvinceName") as TextBox;
            DropDownList ctlCmbRegionId     = ctlProvinceFormView.FindControl("ctlCmbRegionId") as DropDownList;
            TextBox      ctlTxtComment      = ctlProvinceFormView.FindControl("ctlTxtComment") as TextBox;
            CheckBox     chkActive          = ctlProvinceFormView.FindControl("chkActive") as CheckBox;


            //Master
            dbProvince.Region  = DbRegionService.FindByIdentity(UIHelper.ParseShort(ctlCmbRegionId.SelectedValue));
            dbProvince.Comment = ctlTxtComment.Text;
            dbProvince.Active  = chkActive.Checked;

            dbProvince.UpdPgm  = ProgramCode;
            dbProvince.UpdDate = DateTime.Now.Date;
            dbProvince.UpdBy   = UserAccount.UserID;

            try
            {
                DbProvinceService.Save(dbProvince);
                e.Cancel = true;
                ctlGridProvince.DataCountAndBind();
                ctlProvinceModalPopupExtender.Hide();
                UpdatePanelGridView.Update();
            }
            catch (ServiceValidationException ex)
            {
                ValidationErrors.MergeErrors(ex.ValidationErrors);
            }
        }
예제 #3
0
        protected void ctlBankFormView_ItemInserting(object sender, FormViewInsertEventArgs e)
        {
            DbBank dbBank = new DbBank();

            TextBox  txtBankNo  = ctlBankFormView.FindControl("ctlTxtBankNo") as TextBox;
            TextBox  txtComment = ctlBankFormView.FindControl("ctlTxtComment") as TextBox;
            CheckBox chkActive  = ctlBankFormView.FindControl("chkActive") as CheckBox;

            dbBank.BankNo  = txtBankNo.Text;
            dbBank.Comment = txtComment.Text;
            dbBank.Active  = chkActive.Checked;

            dbBank.UpdPgm  = ProgramCode;
            dbBank.CreDate = DateTime.Now.Date;
            dbBank.UpdDate = DateTime.Now.Date;
            dbBank.CreBy   = UserAccount.UserID;
            dbBank.UpdBy   = UserAccount.UserID;

            try
            {
                DbBankService.Save(dbBank);
                e.Cancel = true;
                ctlGridBank.DataCountAndBind();
                ctlBankModalPopupExtender.Hide();
                UpdatePanelGridView.Update();
            }
            catch
            { }
            //catch (ServiceValidationException ex)
            //{
            //    ValidationErrors.MergeErrors(ex.ValidationErrors);
            //}
        }
예제 #4
0
        /// <summary>
        /// Insert assertions
        /// </summary>
        private void InsertAssertion()
        {
            if (CheckValue()) // se supero i controlli sui valori immessi nel pannello asserzione, preparo l'oggetto asserzione da inserire
            {
                Assertion newAssertion = new Assertion();
                newAssertion.ID_TYPE_EVENT   = Convert.ToInt64(ddlTypeEvent.SelectedItem.Value);
                newAssertion.DESC_TYPE_EVENT = ddlTypeEvent.SelectedItem.Text;
                newAssertion.TYPE_AUR        = ddlAur.SelectedItem.Value;
                if (newAssertion.TYPE_AUR.Equals(TYPE_AUR_ADMINISTRATION))
                {
                    newAssertion.ID_AUR   = Convert.ToInt64(ID_ADMINISTRATION);
                    newAssertion.DESC_AUR = CODE_ADMINISTRATION;
                }
                else
                {
                    newAssertion.ID_AUR   = Convert.ToInt64((GrdAssertionResult.SelectedRow.FindControl("lblSystemIdAggregator") as Label).Text);
                    newAssertion.DESC_AUR = (GrdAssertionResult.SelectedRow.FindControl("lblCode") as Label).Text + "(" +
                                            (GrdAssertionResult.SelectedRow.FindControl("lblDescription") as Label).Text + ")";
                }

                newAssertion.TYPE_NOTIFY = Convert.ToChar(rbTipologiaNotifica.SelectedItem.Value);
                newAssertion.IS_EXERCISE = cbInEsercizio.Checked;
                newAssertion.ID_AMM      = Convert.ToInt64(ID_ADMINISTRATION);
                //chiamo il servizio di insert
                //0 - inserimento riuscito con successo
                //1 - l'asserzione è già presente
                //-1 - si è verificato un errore durante l'inserimento dell'asserzione.
                int valRet = ws.InsertAssertionEvent(newAssertion);
                if (valRet == 0)
                {
                    //recupero le asserzioni dal backend
                    Assertions = ws.GetListAssertion(ID_ADMINISTRATION).ToList();
                    //aggiorno la griglia delle asserzioni
                    this.grid_rowindex.Value = "0";
                    BuildGrdAssertions();
                    MODE = "Modify";
                    BuildPanelAssertion();
                    GrdAssertionResult.DataSource = null;
                    GrdAssertionResult.DataBind();
                    this.grdAssertionResult_rowindex.Value = "0";
                    pnlAssertion.Update();
                    UpdatePanelGridView.Update();
                }
                else if (valRet == -1)
                {
                    string s = "<script language='javascript'>alert('Si è verificato un errore durante l\\'inserimento dell\\'asserzione.');</script>";
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "errorInsertAssertion", s, false);
                }
                else if (valRet == 1)
                {
                    string s = "<script language='javascript'>alert('l\\'asserzione è già presente.');</script>";
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "duplicateAssertion", s, false);
                }
            }
        }
예제 #5
0
        protected void ctlCancel_Click(object sender, ImageClickEventArgs e)
        {
            ctlProgramRoleGrid.DataSource = null;
            ctlProgramRoleGrid.DataBind();
            ctlUpdatePanelProgramRoleGridView.Update();
            ctlFieldSetDetailGridView.Visible = false;

            ctlRoleGrid.SelectedIndex = -1;
            ctlRoleGrid.DataCountAndBind();
            UpdatePanelGridView.Update();
        }
예제 #6
0
 public void Show(bool setIsMultiple)
 {
     IsMultiple = setIsMultiple;
     if (IsMultiple)
     {
         ctlUserGroupGrid.Columns[0].Visible = true;
         ctlUserGroupGrid.Columns[1].Visible = false;
         ctlSubmit.Visible = true;
     }
     else
     {
         ctlUserGroupGrid.Columns[0].Visible = false;
         ctlUserGroupGrid.Columns[1].Visible = true;
         ctlSubmit.Visible = false;
     }
     //this.ModalPopupExtender1.Show();
     UpdatePanelGridView.Update();
 }
예제 #7
0
 public void Show()
 {
     if (IsMultiple)
     {
         ctlCompanyGrid.Columns[0].Visible = true;
         ctlCompanyGrid.Columns[1].Visible = false;
         ctlSubmit.Visible = true;
     }
     else
     {
         ctlCompanyGrid.Columns[0].Visible = false;
         ctlCompanyGrid.Columns[1].Visible = true;
         ctlSubmit.Visible = false;
     }
     //CallOnObjectLookUpCalling();
     ctlCompanyGrid.DataCountAndBind();
     //this.ModalPopupExtender1.Show();
     UpdatePanelGridView.Update();
 }
예제 #8
0
        protected void ctlSubmit_Click(object sender, EventArgs e)
        {
            IList <DbBankLang> bankLangList = new List <DbBankLang>();
            DbBank             bank         = new DbBank(UIHelper.ParseShort(ctlGridBank.SelectedValue.ToString()));

            foreach (GridViewRow row in ctlBankLangGrid.Rows)
            {
                TextBox  ctlBankName = (TextBox)ctlBankLangGrid.Rows[row.RowIndex].FindControl("ctlBankName");
                TextBox  ctlABBRName = (TextBox)ctlBankLangGrid.Rows[row.RowIndex].FindControl("ctlABBRName");
                TextBox  ctlComment  = (TextBox)ctlBankLangGrid.Rows[row.RowIndex].FindControl("ctlComment");
                CheckBox ctlActive   = (CheckBox)ctlBankLangGrid.Rows[row.RowIndex].FindControl("ctlActive");

                if (!string.IsNullOrEmpty(ctlBankName.Text) || !string.IsNullOrEmpty(ctlABBRName.Text) || !string.IsNullOrEmpty(ctlComment.Text))
                {
                    //modify by tom 28/01/2009
                    //SS.DB.DTO.DbLanguage lang = new SS.DB.DTO.DbLanguage(UIHelper.ParseShort(ctlBankLangGrid.DataKeys[row.RowIndex].Value.ToString()));
                    DbLanguage lang = new DbLanguage(UIHelper.ParseShort(ctlBankLangGrid.DataKeys[row.RowIndex].Value.ToString()));

                    DbBankLang bankLang = new DbBankLang();

                    bankLang.Language = lang;
                    bankLang.Bank     = bank;
                    bankLang.BankName = ctlBankName.Text;
                    bankLang.AbbrName = ctlABBRName.Text;
                    bankLang.Comment  = ctlComment.Text;
                    bankLang.Active   = ctlActive.Checked;

                    bankLang.CreBy   = UserAccount.UserID;
                    bankLang.CreDate = DateTime.Now;
                    bankLang.UpdBy   = UserAccount.UserID;;
                    bankLang.UpdDate = DateTime.Now;
                    bankLang.UpdPgm  = ProgramCode;

                    bankLangList.Add(bankLang);
                }
            }
            DbBankLangService.UpdateBankLang(bankLangList);

            ctlGridBank.DataCountAndBind();
            UpdatePanelGridView.Update();

            BankLangGridViewFinish();
        }
예제 #9
0
        protected void ctlBtnDeleteProvince_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow row in ctlGridProvince.Rows)
            {
                if ((row.RowType == DataControlRowType.DataRow) && ((CheckBox)row.FindControl("ctlSelect")).Checked)
                {
                    short provinceId = UIHelper.ParseShort(ctlGridProvince.DataKeys[row.RowIndex].Value.ToString());

                    if (!((CheckBox)row.FindControl("ctlChkActive")).Checked)//ไม่ Active
                    {
                        try
                        {
                            DbProvince province = DbProvinceService.FindProxyByIdentity(provinceId);

                            SsDbDaoProvider.DbProvinceLangDao.DeleteAllProvinceLang(provinceId);

                            DbProvinceService.Delete(province);
                            UpdatePanelGridView.Update();
                            ProvinceLangGridViewFinish();
                        }
                        catch (Exception ex)
                        {
                            if (((System.Data.SqlClient.SqlException)(ex.GetBaseException())).Number == 547)
                            {
                                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AlertInUseData",
                                                                        "alert('Account ID : " + provinceId.ToString() + " is Active. Can't Delete It');", true);
                            }
                        }
                    }
                    else//Active
                    {
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AlertActiveData",
                                                                "alert('Account ID :" + provinceId.ToString() + " is Active. Can't Delete It');", true);
                    }
                }
            }

            ctlGridProvince.DataCountAndBind();
        }
예제 #10
0
        protected void ctlSubmit_Click(object sender, EventArgs e)
        {
            IList <DbProvinceLang> provinceLangList = new List <DbProvinceLang>();
            DbProvince             province         = new DbProvince(UIHelper.ParseShort(ctlGridProvince.SelectedValue.ToString()));

            foreach (GridViewRow row in ctlProvinceLangGrid.Rows)
            {
                TextBox  ctlProvinceName = (TextBox)ctlProvinceLangGrid.Rows[row.RowIndex].FindControl("ctlProvinceName");
                TextBox  ctlComment      = (TextBox)ctlProvinceLangGrid.Rows[row.RowIndex].FindControl("ctlComment");
                CheckBox ctlActive       = (CheckBox)ctlProvinceLangGrid.Rows[row.RowIndex].FindControl("ctlActive");

                if (!string.IsNullOrEmpty(ctlProvinceName.Text) || !string.IsNullOrEmpty(ctlComment.Text))
                {
                    DbLanguage lang = new DbLanguage(UIHelper.ParseShort(ctlProvinceLangGrid.DataKeys[row.RowIndex].Value.ToString()));

                    DbProvinceLang provinceLang = new DbProvinceLang();
                    provinceLang.Language     = lang;
                    provinceLang.Province     = province;
                    provinceLang.ProvinceName = ctlProvinceName.Text;
                    provinceLang.Comment      = ctlComment.Text;
                    provinceLang.Active       = ctlActive.Checked;

                    provinceLang.CreBy   = UserAccount.UserID;
                    provinceLang.CreDate = DateTime.Now;
                    provinceLang.UpdBy   = UserAccount.UserID;;
                    provinceLang.UpdDate = DateTime.Now;
                    provinceLang.UpdPgm  = ProgramCode;
                    provinceLangList.Add(provinceLang);
                }
            }

            DbProvinceLangService.UpdateProvinceLang(provinceLangList);

            ctlGridProvince.DataCountAndBind();
            UpdatePanelGridView.Update();
            ProvinceLangGridViewFinish();
        }
예제 #11
0
 protected void ctlSearch_Click(object sender, ImageClickEventArgs e)
 {
     ctlLocationGridView.DataCountAndBind();
     UpdatePanelGridView.Update();
 }
 protected void ctlSearch_Click(object sender, ImageClickEventArgs e)
 {
     LoadData();
     UpdatePanelGridView.Update();
 }
예제 #13
0
        /// <summary>
        /// Modify assertion
        /// </summary>
        private void ModifyAssertion()
        {
            Assertion assertion = new Assertion();

            if (CheckValue())
            {
                assertion.SYSTEM_ID       = Convert.ToInt64((this.GrdAsserzioni.Rows[this.GrdAsserzioni.SelectedIndex].FindControl("lblSystemId") as Label).Text);
                assertion.ID_TYPE_EVENT   = Convert.ToInt64(ddlTypeEvent.SelectedItem.Value);
                assertion.DESC_TYPE_EVENT = ddlTypeEvent.SelectedItem.Text;
                assertion.ID_AMM          = Convert.ToInt64(ID_ADMINISTRATION);
                if (GrdAssertionResult.Rows == null || GrdAssertionResult.Rows.Count < 1)
                {
                    if (ddlAur.SelectedItem.Value.Equals(TYPE_AUR_ADMINISTRATION))
                    {
                        assertion.DESC_AUR = CODE_ADMINISTRATION;
                        assertion.ID_AUR   = Convert.ToInt64(ID_ADMINISTRATION);
                    }
                    else
                    {
                        assertion.DESC_AUR = (this.GrdAsserzioni.Rows[this.GrdAsserzioni.SelectedIndex].FindControl("lblAur") as Label).Text;
                        assertion.ID_AUR   = (from a in Assertions
                                              where a.SYSTEM_ID.ToString().Equals(assertion.SYSTEM_ID.ToString())
                                              select a.ID_AUR).FirstOrDefault();
                    }
                }
                else
                {
                    assertion.DESC_AUR = (this.GrdAssertionResult.Rows[this.GrdAssertionResult.SelectedIndex].FindControl("lblCode") as Label).Text +
                                         "(" + (this.GrdAssertionResult.Rows[this.GrdAssertionResult.SelectedIndex].FindControl("lblDescription") as Label).Text + ")";
                    assertion.ID_AUR = Convert.ToInt64((this.GrdAssertionResult.Rows[this.GrdAssertionResult.SelectedIndex].FindControl("lblSystemIdAggregator") as Label).Text);
                }
                assertion.IS_EXERCISE = cbInEsercizio.Checked;
                assertion.TYPE_AUR    = ddlAur.SelectedValue;
                assertion.TYPE_NOTIFY = Convert.ToChar(rbTipologiaNotifica.SelectedValue);

                bool isPresent = (from a in Assertions
                                  where (a.ID_TYPE_EVENT.Equals(assertion.ID_TYPE_EVENT) &&
                                         a.ID_AUR.Equals(assertion.ID_AUR) &&
                                         a.TYPE_AUR.Equals(assertion.TYPE_AUR) &&
                                         a.ID_AMM.Equals(assertion.ID_AMM) && !a.SYSTEM_ID.ToString().Equals(assertion.SYSTEM_ID.ToString()))
                                  select a).Count() > 0;
                if (isPresent)
                {
                    string s = "<script language='javascript'>alert('L\\'asserzione è già presente.');</script>";
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "duplicateAssertion", s, false);
                    return;
                }
                //service modify
                int res = ws.UpdateAssertionEvent(assertion);
                if (res == 0)
                {
                    //recupero le asserzioni dal backend
                    Assertions = ws.GetListAssertion(ID_ADMINISTRATION).ToList();
                    //aggiorno la griglia delle asserzioni
                    BuildGrdAssertions();
                    MODE = "Modify";
                    BuildPanelAssertion();
                    GrdAssertionResult.DataSource = null;
                    GrdAssertionResult.DataBind();
                    this.grdAssertionResult_rowindex.Value = "0";
                    pnlAssertion.Update();
                    UpdatePanelGridView.Update();
                }
                else if (res == -1)
                {
                    string s = "<script language='javascript'>alert('Si è verificato un problema durante la modifica dell\\'asserzione selezionata');</script>";
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "errorUpdateAssertion", s, false);
                }
                //else if (res == 1)
                //{
                //    string s = "<script language='javascript'>alert('l\\'asserzione è già presente.');</script>";
                //    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "duplicateAssertion", s, false);
                //}
            }
        }
예제 #14
0
 protected void ctlCancel_Click(object sender, ImageClickEventArgs e)
 {
     ModalPopupExtender1.Hide();
     UpdatePanelGridView.Update();
 }
예제 #15
0
 protected void ctlUserForm_ItemCommand(object sender, FormViewCommandEventArgs e)
 {
     ctlUserModalPopupExtender.Hide();
     UpdatePanelGridView.Update();
 }
예제 #16
0
 private void ClosePopUp()
 {
     hdModalPopupState.Value = "hidden";
     ctlLanguageModalPopupExtender.Hide();
     UpdatePanelGridView.Update();
 }
예제 #17
0
 protected void ctlSearch_Click(object sender, EventArgs e)
 {
     UpdatePanelGridView.Update();
     ctlCountryGrid.DataCountAndBind();
 }