Esempio n. 1
0
 protected void DetailsViewLifeDealItems_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         e.KeepInInsertMode = true;
         ValidationUtility.ShowValidationErrors(this, e.Exception);
     }
     else
     {
         if (GXGridView1.SelectedDataKey != null)
         {
             int GXgvSelectedValue = Convert.ToInt32(GXGridView1.SelectedValue);
             odsGridViewLifeDealItems.SelectParameters.Clear();
             odsGridViewLifeDealItems.SelectParameters.Add("lifeDealID", GXgvSelectedValue.ToString());
             GridViewLifeDealItems.DataBind();
         }
         else
         {
             int GXgvSelectedValue = GXGridView1SelectedValue;
             odsGridViewLifeDealItems.SelectParameters.Clear();
             odsGridViewLifeDealItems.SelectParameters.Add("lifeDealID", GXgvSelectedValue.ToString());
             GridViewLifeDealItems.DataBind();
         }
         mvMain.SetActiveView(viewBrokerages);
         mvLifeDealItems.SetActiveView(viewLifeDealItemsGrid);
     }
 }
Esempio n. 2
0
    protected void DetailsView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
    {
        if (e.Exception != null)
        {
            e.ExceptionHandled = true;
            e.KeepInInsertMode = true;
            ValidationUtility.ShowValidationErrors(this, e.Exception);
        }
        else
        {
            GXGridView1.TotalRecords = ViewOffer.SelectCountCached();
            GXGridView1.DataBind();

            string offerNumber = e.Values["OfferNumber"] as string;
            Offer  o           = Offer.GetByNumber(offerNumber);

            string DataKeyValue = o.ID.ToString();

            int intSelectedIndex = 0;
            int intPageIndex     = 0;
            int intGridViewPages = GXGridView1.PageCount;

            // Loop thru each page in the GridView
            for (int intPage = 0; intPage < intGridViewPages; intPage++)
            {
                // Set the current GridView page
                GXGridView1.PageIndex = intPage;
                // Bind the GridView to the current page
                GXGridView1.DataBind();
                // Loop thru each DataKey in the GridView
                for (int i = 0; i < GXGridView1.DataKeys.Count; i++)
                {
                    if (Convert.ToString(GXGridView1.DataKeys[i].Value) == DataKeyValue)
                    {
                        // If it is a match set the variables and exit
                        intSelectedIndex = i;
                        intPageIndex     = intPage;
                        break;
                    }
                }
            }

            // Set the GridView to the values found
            GXGridView1.PageIndex     = intPageIndex;
            GXGridView1.SelectedIndex = intSelectedIndex;
            GXGridView1.DataBind();

            int GXgvSelectedValue = o.ID;
            GXGridView1SelectedValue = GXgvSelectedValue;
            odsOfferPreview.SelectParameters.Clear();
            odsOfferPreview.SelectParameters.Add("id", GXgvSelectedValue.ToString());
            dvOfferPreview.DataBind();
            odsGridViewOfferItems.SelectParameters.Clear();
            odsGridViewOfferItems.SelectParameters.Add("offerID", GXgvSelectedValue.ToString());
            GridViewOfferItems.DataBind();

            mvMain.SetActiveView(viewOfferItems);
            mvOfferItems.SetActiveView(viewOfferItemsGrid);
        }
    }
Esempio n. 3
0
    /// <summary>
    /// metod za vnesuvanje na osnovni podatoci za korisnikot.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnNext_Click1(object sender, EventArgs e)
    {
        string username = UsernameTextBox.Text;
        string EMBG     = EMBGTextBox.Text;

        //prverka dali e validene UserName na korisnikot.
        try {
            EmployeeController.ValidateUserInfo(username);
        } catch (Exception ex) {
            ValidationUtility.ShowValidationErrors(this, ex);
            return;
        }
        //proverka dali e validen EMBG.
        try {
            EmployeeController.ValidateUserEMBG(EMBG);
        } catch (Exception ex) {
            ValidationUtility.ShowValidationErrors(this, ex);
            return;
        }
        //prverka za selektirana uloga na korisnikot na sistemot.
        try {
            string selectedRole = RolesList.SelectedItem.Text;
            MultiView1.SetActiveView(View2);
        } catch (Exception ex) {
            lblError.Visible = true;
            lblError.Text    = "Изберете улога на новиот корисник на системот!";
        }
    }
Esempio n. 4
0
    /// <summary>
    /// metod za vnesuvanje na nov korisnik vo sistemot.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnInsert_Click(object sender, EventArgs e)
    {
        ////setiranje na osnovnite podatoci za korisnikot.
        string roleName = RolesList.SelectedItem.Text;
        string username = UsernameTextBox.Text.Trim();
        string fullname = FullNameTextBox.Text.Trim();
        string EMBG     = EMBGTextBox.Text.Trim();
        string password = passwordTextBox.Text.Trim();
        string Address  = AddressTextBox.Text.Trim();
        string Email    = EmailTextBox.Text.Trim();
        string phone    = PhoneNmberTextBox.Text.Trim();

        string role     = RolesList.SelectedItem.Text;
        int    roleId   = Convert.ToInt32(RolesList.SelectedValue);
        int    branchID = Convert.ToInt32(BranchesList.SelectedValue);

        string cert = null;

        ////setiranje na ulogata na korisnikot na sisitemot.
        if (roleName == RolesInfo.Broker)
        {
            try {
                cert = EmployeeController.InsertBroker(roleId, username, fullname, branchID, password, Address, EMBG, phone, Email);
            } catch (Exception ex) {
                SetVisibleComponents();
                ValidationUtility.ShowValidationErrors(this, ex);
                return;
            }
        }

        if (roleName == RolesInfo.BROKERAdmin)
        {
            try {
                cert = EmployeeController.InsertBROKERAdmin(roleId, username, fullname, branchID, password, Address, EMBG, phone, Email);
            } catch (Exception ex) {
                SetVisibleComponents();
                ValidationUtility.ShowValidationErrors(this, ex);
                return;
            }
        }


        if (roleName == RolesInfo.SEAdmin)
        {
            try {
                cert = EmployeeController.InsertSEAdmin(roleId, username, fullname, branchID, password, Address, EMBG, phone, Email);
            } catch (Exception ex) {
                SetVisibleComponents();
                ValidationUtility.ShowValidationErrors(this, ex);
                return;
            }
        }



        //EmployeeController.SendCertificate(cert);
        lblOK.Visible = true;
        lblOK.Text    = "Успешно е внесен новиот корисник во системот";
    }
Esempio n. 5
0
 protected void OwnerDetailsView_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         e.KeepInEditMode   = true;
         ValidationUtility.ShowValidationErrors(this, e.Exception);
     }
 }
Esempio n. 6
0
 protected void PolicyDetailesView_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         e.KeepInInsertMode = true;
         ValidationUtility.ShowValidationErrors(this, e.Exception);
     }
     else
     {
     }
 }
Esempio n. 7
0
 protected void DetailsView1_ItemDeleted(object sender, DetailsViewDeletedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         ValidationUtility.ShowValidationErrors(this, e.Exception);
     }
     else
     {
         GXGridView1.TotalRecords = ViewBankslip.SelectCountCached();
         GXGridView1.DataBind();
         mvMain.SetActiveView(viewGrid);
     }
 }
Esempio n. 8
0
 protected void OwnerDetailsView_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         e.KeepInEditMode   = true;
         ValidationUtility.ShowValidationErrors(this, e.Exception);
     }
     else
     {
         GXGridView1.TotalRecords = Broker.DataAccess.Client.SelectCountCached();
         GXGridView1.DataBind();
         mvMain.SetActiveView(viewGrid);
     }
 }
Esempio n. 9
0
 protected void DetailsViewSubTypes_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         e.KeepInInsertMode = true;
         ValidationUtility.ShowValidationErrors(this, e.Exception);
     }
     else
     {
         GXGridView1.TotalRecords = Broker.DataAccess.DocumentType.SelectCountCached();
         GXGridView1.DataBind();
         mvMain.SetActiveView(viewGrid);
     }
 }
Esempio n. 10
0
 protected void DetailsView1_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         e.KeepInEditMode   = true;
         ValidationUtility.ShowValidationErrors(this, e.Exception);
     }
     else
     {
         GXGridView1.TotalRecords = ViewCashReport.SelectByFKCountCached("BranchID", this.PageUser.BranchID);
         GXGridView1.DataBind();
         mvMain.SetActiveView(viewGrid);
     }
 }
Esempio n. 11
0
 protected void DetailsView1_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         e.KeepInEditMode   = true;
         ValidationUtility.ShowValidationErrors(this, e.Exception);
     }
     else
     {
         GXGridView1SelectedValue = Convert.ToInt32(e.NewValues["ID"]);
         GXGridView1.TotalRecords = ActiveBank.SelectCountCached();
         GXGridView1.DataBind();
         mvMain.SetActiveView(viewGrid);
     }
 }
Esempio n. 12
0
 protected void DetailsView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         e.KeepInInsertMode = true;
         ValidationUtility.ShowValidationErrors(this, e.Exception);
     }
     else
     {
         GXGridView1.TotalRecords = ViewRateDeal.SelectCountCached();
         GXGridView1.DataBind();
         dvRateDealPreview.DataBind();
         mvRateDealItems.SetActiveView(viewGrid);
         mvMain.SetActiveView(viewRateDealItems);
     }
 }
Esempio n. 13
0
 protected void OwnerDetailsView_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         e.KeepInInsertMode = true;
         ValidationUtility.ShowValidationErrors(this, e.Exception);
     }
     else
     {
         string embg = e.Values["EMBG"].ToString();
         Broker.DataAccess.Client o = Broker.DataAccess.Client.GetByEmbg(embg);
         ViewState["OwnerID"] = o.ID;
         TextBox tbName = PoliciesDetailsView.FindControl("tbOwnerName") as TextBox;
         tbName.Text = o.Name;
         Panel pnl = PoliciesDetailsView.FindControl("pnlOwner") as Panel;
         pnl.Visible = false;
     }
 }
Esempio n. 14
0
 protected void ClientDetailsView_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         e.KeepInInsertMode = true;
         ValidationUtility.ShowValidationErrors(this, e.Exception);
     }
     else
     {
         TextBox tbClientName = DetailsView1.FindControl("ClientDetailsView").FindControl("tbName") as TextBox;
         TextBox tbName       = DetailsView1.FindControl("tbClientName") as TextBox;
         tbName.Text = tbClientName.Text;
         Panel pnl = DetailsView1.FindControl("pnlClient") as Panel;
         pnl.Visible = false;
         string embg = e.Values["EMBG"].ToString();
         Broker.DataAccess.Client c = Broker.DataAccess.Client.GetByEmbg(embg);
         ViewState["ClientID"] = c.ID;
     }
 }
Esempio n. 15
0
 protected void DetailsViewBankslipItem_ItemDeleted(object sender, DetailsViewDeletedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         ValidationUtility.ShowValidationErrors(this, e.Exception);
     }
     else
     {
         int bankslipID = GXGridView1SelectedValue;
         GXGridViewBankslipItems.TotalRecords = ViewBankslipItem.SelectByFKCountCached("BankslipID", bankslipID);
         GXGridViewBankslipItems.DataBind();
         mvBankslipItems.SetActiveView(viewBankslipGrid);
         Bankslip bk          = Bankslip.Get(GXGridView1SelectedValue);
         decimal  debtValue   = Convert.ToDecimal(e.Values["DebtValue"]);
         decimal  demandValue = Convert.ToDecimal(e.Values["DemandValue"]);
         bk.DebtValue   -= debtValue;
         bk.DemandValue -= demandValue;
         Bankslip.Table.Context.SubmitChanges();
         dvBankslipForItem.DataBind();
     }
 }
Esempio n. 16
0
 protected void DetailsViewOfferItems_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         e.KeepInInsertMode = true;
         ValidationUtility.ShowValidationErrors(this, e.Exception);
     }
     else
     {
         int     offerID       = Convert.ToInt32(e.Values["OfferID"]);
         decimal offerItemCost = Convert.ToDecimal(e.Values["Cost"]);
         Offer   o             = Offer.Get(offerID);
         o.Cost += offerItemCost;
         Offer.Table.Context.SubmitChanges();
         odsOfferPreview.SelectParameters.Clear();
         odsOfferPreview.SelectParameters.Add("id", offerID.ToString());
         dvOfferPreview.DataBind();
         odsGridViewOfferItems.SelectParameters.Clear();
         odsGridViewOfferItems.SelectParameters.Add("offerID", offerID.ToString());
         GridViewOfferItems.DataBind();
         mvOfferItems.SetActiveView(viewOfferItemsGrid);
     }
 }