Esempio n. 1
0
        protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
        {
            if ((e.CommandName == "PerformInsert") || (e.CommandName == "Update"))
            {
                GridEditFormItem item = (GridEditFormItem)e.Item;
                int pathkey           = 0;
                if (e.CommandName == "Update")
                {
                    pathkey = Convert.ToInt32(item.GetDataKeyValue("path_key"));
                }
                int order = Convert.ToInt32((item["page_order"].Controls[0] as TextBox).Text);

                Bitcoin_Notify_DB.SPs.UpdatePath(pathkey, order).Execute();

                RadGrid1.MasterTableView.ClearEditItems();
            }
            else if (e.CommandName == "Route")
            {
                GridDataItem item     = (GridDataItem)e.Item;
                int          pathkey  = Convert.ToInt32(item["path_key"].Text);
                string       pathname = item["path_name"].Text;
                hdpathkey.Value = pathkey.ToString();
                lblpath.Text    = pathkey.ToString() + " - " + pathname;
                RadGrid2.Rebind();
            }
            else if (e.CommandName == "Delete")
            {
                GridDataItem item    = (GridDataItem)e.Item;
                int          pathkey = Convert.ToInt32(item.GetDataKeyValue("path_key"));

                Bitcoin_Notify_DB.SPs.DeletePath(pathkey).Execute();
                RadGrid1.MasterTableView.ClearEditItems();
            }
        }
    protected void cbSpecVal_CheckedChanged(object sender, EventArgs e)
    {
        CheckBox         cbSpecVal  = sender as CheckBox;
        GridEditFormItem editForm   = cbSpecVal.NamingContainer as GridEditFormItem;
        Label            lblfromval = (editForm.FindControl("lblfromval") as Label);
        Label            lbltoval   = (editForm.FindControl("lbltoval") as Label);

        RadNumericTextBox      txtfromval    = (editForm.FindControl("txtfromval") as RadNumericTextBox);
        RadNumericTextBox      txttoval      = (editForm.FindControl("txttoval") as RadNumericTextBox);
        RequiredFieldValidator RFVtxtfromval = (editForm.FindControl("RFVtxtfromval") as RequiredFieldValidator);
        RequiredFieldValidator RFVtxttoval   = (editForm.FindControl("RFVtxttoval") as RequiredFieldValidator);

        if (cbSpecVal.Checked)
        {
            lblfromval.Visible    = true;
            lbltoval.Visible      = true;
            txtfromval.Visible    = true;
            txttoval.Visible      = true;
            RFVtxtfromval.Enabled = true;
            RFVtxttoval.Enabled   = true;
        }
        else
        {
            lblfromval.Visible    = false;
            lbltoval.Visible      = false;
            txtfromval.Visible    = false;
            txttoval.Visible      = false;
            RFVtxtfromval.Enabled = false;
            RFVtxttoval.Enabled   = false;
        }
    }
Esempio n. 3
0
 protected void radgrid_ItemDataBound(object sender, GridItemEventArgs e)
 {
     if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode))
     {
         GridEditFormItem editItem = (GridEditFormItem)e.Item;
         RadComboBox      rc       = (RadComboBox)editItem["ep"].Controls[0];
         rc.Width  = Unit.Pixel(400);
         rc.Filter = RadComboBoxFilter.Contains;
         //EditCommandColumn ecc = (EditCommandColumn) editItem["EditCommandColumn"].Controls[0];
     }
     if (e.Item is GridDataItem)
     {
         GridDataItem item = (GridDataItem)e.Item;
         //TextBox param_data = (TextBox) item["param_data"].Controls[0];
         //if (param_data.Text == "0" || param_data.Text == null)
         //{
         //    TableCell tc = (TableCell) item["param_data"];
         //    tc.BackColor = Color.Red;
         //}
         //GridNumericColumn param_data = (GridNumericColumn) item["param_data"].Controls[0];
         //TextBox param_data = (TextBox) item["param_data"].Controls[0];
         //TextBox ratio = (TextBox) item["ratio"].Controls[0];
         //param_data.Text = Convert.ToDouble(param_data.Text/ratio.Text);
     }
 }
        protected void grdTipoEquipamento_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            try
            {
                GridEditFormItem editedItem = (GridEditFormItem)e.Item;
                using (UnitOfWork oUnitOfWork = new UnitOfWork())
                {
                    EquipamentoTipo _equipamentoTipo = oUnitOfWork.EquipamentoTipoREP.BuscarPorID(int.Parse(editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["EquipamentoTipoID"].ToString()));
                    _equipamentoTipo.Descricao            = (editedItem["colDescricao"].Controls[0] as TextBox).Text;
                    _equipamentoTipo.Observacao           = (editedItem["colObservacao"].Controls[0] as TextBox).Text;
                    _equipamentoTipo.DataModificacao      = DateTime.Now;
                    _equipamentoTipo.UsuarioModificadorID = int.Parse(Session["ssnLoggedUserID"].ToString());

                    oUnitOfWork.EquipamentoTipoREP.Atualizar(_equipamentoTipo);
                    oUnitOfWork.Save();
                }

                Utils.Notificar(ntfGeral, "Registro de Tipo de Equipamento atualizado.", Enums.TipoNotificacao.Informacao);
            }
            catch (Exception ex)
            {
                e.Canceled = true;
                Log.Trace(ex, true);
                Utils.Notificar(ntfGeral, "Falha ao tentar atualizar registro de Tipo de Equipamento. Contate o administrador.", Enums.TipoNotificacao.Erro);
            }
        }
 protected void gvAdviserAlert_OnItemDataBound(object sender, GridItemEventArgs e)
 {
     if (e.Item is GridEditFormInsertItem && e.Item.OwnerTableView.IsItemInserted)
     {
         GridEditFormInsertItem item = (GridEditFormInsertItem)e.Item;
         GridEditFormItem       gefi = (GridEditFormItem)e.Item;
         DropDownList           ddlSIPDiscription = (DropDownList)gefi.FindControl("ddlSIPDiscription");
         DropDownList           ddlAlert          = (DropDownList)gefi.FindControl("ddlAlert");
         BindSIP(ddlSIPDiscription);
         BindAlert(ddlAlert);
     }
     if (e.Item is GridEditFormItem && e.Item.IsInEditMode && e.Item.ItemIndex != -1)
     {
         int ruleId            = Convert.ToInt32(gvAdviserAlert.MasterTableView.DataKeyValues[e.Item.ItemIndex]["AAECR_RuleId"].ToString());
         GridEditFormItem gefi = (GridEditFormItem)e.Item;
         DropDownList     ddlSIPDiscription = (DropDownList)gefi.FindControl("ddlSIPDiscription");
         DropDownList     ddlAlert          = (DropDownList)gefi.FindControl("ddlAlert");
         TextBox          txtRuleType       = (TextBox)e.Item.FindControl("txtRuleType");
         CheckBox         chkActive         = (CheckBox)e.Item.FindControl("chkActive");
         CheckBox         chkOverrite       = (CheckBox)e.Item.FindControl("chkOverrite");
         FillAdviserrole(ruleId, ddlSIPDiscription, ddlAlert, txtRuleType, chkActive, chkOverrite);
     }
     //if (e.Item is GridDataItem)
     //{
     //    GridDataItem gridItem = e.Item as GridDataItem;
     //    gridItem.ToolTip = "Right click to Add/Edit";
     //}
 }
        protected void rgvOrderSteps_ItemCommand(object source, GridCommandEventArgs e)
        {
            bool bResult = false;

            if (e.CommandName == "Update")
            {
                GridEditableItem edititem = e.Item as GridEditableItem;
                GridEditFormItem editform = (GridEditFormItem)e.Item;

                RadComboBox rcStatus        = edititem.FindControl("ddlCustomerOrderStatus") as RadComboBox;
                RadComboBox rcPendingReason = edititem.FindControl("ddlCustomerOrderStatusReason") as RadComboBox;

                DataTable dt = new DataTable();
                dt = (DataTable)Session["OrderDetails"];

                string orderStepCode = dt.Rows[e.Item.ItemIndex]["WOS_OrderStepCode"].ToString().Trim();
                orderId = int.Parse(dt.Rows[e.Item.ItemIndex]["CO_OrderId"].ToString().Trim());
                string updatedStatus = rcStatus.SelectedValue;
                string updatedReason = rcPendingReason.SelectedValue;

                bResult = orderbo.UpdateOrderStep(updatedStatus, updatedReason, orderId, orderStepCode);
                if (bResult == true)
                {
                    rgvOrderSteps.Controls.Add(new LiteralControl("<strong>Successfully Updated</strong>"));
                }
                else
                {
                    rgvOrderSteps.Controls.Add(new LiteralControl("<strong>Unable to update value</strong>"));
                    e.Canceled = true;
                }
                BindOrderStepsGrid();
            }
        }
Esempio n. 7
0
        protected void RadGrid2_ItemCommand(object source, GridCommandEventArgs e)
        {
            if ((e.CommandName == "PerformInsert") || (e.CommandName == "Update"))
            {
                GridEditFormItem item = (GridEditFormItem)e.Item;
                int pathroutekey      = 0;
                if (e.CommandName == "Update")
                {
                    pathroutekey = Convert.ToInt32(item.GetDataKeyValue("path_route_key"));
                }
                int pathkey   = Convert.ToInt32(hdpathkey.Value);
                int marketkey = Convert.ToInt32((item["market_key2"].FindControl("ddlmarket") as RadComboBox).SelectedValue);

                Bitcoin_Notify_DB.SPs.UpdatePathRoute(pathroutekey, pathkey, marketkey).Execute();

                RadGrid2.MasterTableView.ClearEditItems();
                //string firstname = (item["first_name"].Controls[0] as TextBox).Text;
            }
            else if (e.CommandName == "Delete")
            {
                GridDataItem item         = (GridDataItem)e.Item;
                int          pathroutekey = Convert.ToInt32(item.GetDataKeyValue("path_route_key"));

                Bitcoin_Notify_DB.SPs.DeletePathRoute(pathroutekey).Execute();

                RadGrid2.Rebind();
                //int userkey = Convert.ToInt32(item["user_key"].Text);
            }
        }
Esempio n. 8
0
 protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e)
 {
     if ((e.Item is GridEditFormItem) && e.Item.IsInEditMode)
     {
         GridEditFormItem gridEditFormItem = (GridEditFormItem)e.Item;
         DropDownList     dropDownList     = (DropDownList)gridEditFormItem.FindControl("ddlPickSIPScheme");
         HtmlTableRow     trSchemeDDL      = (HtmlTableRow)gridEditFormItem.FindControl("trSchemeNameDDL");
         HtmlTableRow     trSchemeTextBox  = (HtmlTableRow)gridEditFormItem.FindControl("trSchemeNameText");
         //TextBox txt = (TextBox)gridEditFormItem.FindControl("txtUnits");
         //txt.Visible = false;
         if (e.Item.RowIndex == -1)
         {
             trSchemeDDL.Visible     = true;
             trSchemeTextBox.Visible = false;
             BindDDLSIPSchemeAllocated(dropDownList);
         }
         else
         {
             trSchemeDDL.Visible     = false;
             trSchemeTextBox.Visible = true;
         }
     }
     //if (e.Item is GridCommandItem)
     //{
     //    LinkButton refreshButton = e.Item.Controls[0].Controls[0].Controls[0].Controls[1].Controls[0] as LinkButton;
     //    refreshButton.Visible = false;
     //}
 }
Esempio n. 9
0
    protected void rcbCarriers_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        RadComboBox      combobox = (RadComboBox)sender;
        GridEditFormItem edititem = (GridEditFormItem)combobox.NamingContainer;

        RadTextBox rtb = (RadTextBox)edititem.FindControl("txtCageType");

        RadListBox rlbFrom = (RadListBox)edititem.FindControl("RadListBoxFrom");
        RadListBox rlbTo   = (RadListBox)edititem.FindControl("RadListBoxTo");

        Label      lblCageType = (Label)edititem.FindControl("lblCageType");
        RadTextBox txtCageType = (RadTextBox)edititem.FindControl("txtCageType");

        rlbFrom.Items.Clear();
        if (combobox.SelectedValue == "-1")
        {
            rlbFrom.Items.Clear();
        }
        else
        {
            CagetypeServiceDAO cts        = new CagetypeServiceDAO();
            DataTable          dtServices = cts.GetCarrierServices(combobox.SelectedValue).Tables[0];

            foreach (DataRow dr in dtServices.Rows)
            {
                rlbFrom.Items.Add(new RadListBoxItem(dr["carrier_service_descr"] as string, dr["carrier_service_id"] as string));
            }
        }
    }
Esempio n. 10
0
        protected void rcbCriteriaType_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            RadComboBox      combobox = (RadComboBox)sender;
            GridEditFormItem edititem = (GridEditFormItem)combobox.NamingContainer;

            RadListBox rlbFrom = (RadListBox)edititem.FindControl("RadListBoxFrom");
            RadListBox rlbTo   = (RadListBox)edititem.FindControl("RadListBoxTo");

            Label lblStoreDeliveryGroup = (Label)edititem.FindControl("lblStoreDeliveryGroup");

            rlbFrom.Items.Clear();
            rlbTo.Items.Clear();
            StoreDelivCriteriaDAO storeDelivCriteria  = new StoreDelivCriteriaDAO();
            DataTable             dtAvailableCriteria = storeDelivCriteria.GetAvailableStoreDelivCriteriaByType(lblStoreDeliveryGroup.Text, combobox.Text).Tables[0];
            DataTable             dtCriteria          = storeDelivCriteria.GetStoreDelivCriteriaByType(lblStoreDeliveryGroup.Text, combobox.Text).Tables[0];

            foreach (DataRow dr in dtAvailableCriteria.Rows)
            {
                rlbFrom.Items.Add(new RadListBoxItem(dr["crit_value"] as string, dr["crit_code"] as string));
            }

            foreach (DataRow dr in dtCriteria.Rows)
            {
                rlbTo.Items.Add(new RadListBoxItem(dr["crit_value"] as string, dr["crit_code"] as string));
            }
        }
Esempio n. 11
0
        protected void trolleyclass_type_RadComboBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            RadComboBox      combobox = (RadComboBox)sender;
            GridEditFormItem edititem = (GridEditFormItem)combobox.NamingContainer;


            if (combobox.SelectedValue == "3")
            {
                // trolley type drop down
                TrolleyDAO trolleydao   = new TrolleyDAO();
                DataSet    trolleyCodes = new DataSet();
                trolleyCodes = trolleydao.GetCodesByType();
                RadComboBox trolleytype = (RadComboBox)edititem
                                          .FindControl("trolleytype_RadComboBox");

                trolleytype.DataSource     = trolleyCodes.Tables["TT"];
                trolleytype.DataTextField  = "type_short_name";
                trolleytype.DataValueField = "type_id";
                trolleytype.DataBind();
                trolleytype.Items.Insert(0, new RadComboBoxItem("", "0"));
                trolleytype.Visible = true;

                RequiredFieldValidator RequiredFieldValidator2 = (RequiredFieldValidator)edititem
                                                                 .FindControl("RequiredFieldValidator2");

                RequiredFieldValidator2.Enabled = true;
            }
            else
            {
                RadComboBox trolleytype = (RadComboBox)edititem
                                          .FindControl("trolleytype_RadComboBox");

                trolleytype.Visible = false;
            }
        }
Esempio n. 12
0
 protected void rgMaping_ItemDataBound(object sender, GridItemEventArgs e)
 {
     try
     {
         if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode))
         {
             GridEditFormItem editform = (GridEditFormItem)e.Item;
             DropDownList     ddlWerp  = (DropDownList)editform.FindControl("ddlWerp");
             BindWerpValues(Convert.ToInt32(ddlCategory.SelectedValue), ddlWerp);
         }
     }
     catch (BaseApplicationException Ex)
     {
         throw Ex;
     }
     catch (Exception Ex)
     {
         BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
         NameValueCollection      FunctionInfo = new NameValueCollection();
         FunctionInfo.Add("Method", "ManageLookups.ascx.cs:rgMaping_ItemDataBound()");
         object[] objects = new object[2];
         objects[1]   = sender;
         objects[2]   = e;
         FunctionInfo = exBase.AddObject(FunctionInfo, objects);
         exBase.AdditionalInformation = FunctionInfo;
         ExceptionManager.Publish(exBase);
         throw exBase;
     }
 }
Esempio n. 13
0
        private void SetEditForm(object sender, GridItemEventArgs e)
        {
            GridItem griditem = e.Item as GridItem;

            if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode))
            {
                GridEditFormItem editform = (GridEditFormItem)e.Item;
                RadEditor        _radEditorQualDescription = editform.FindControl(RADEDITQUALDESCR) as RadEditor;
                RadComboBox      _radComboQualID           = (RadComboBox)editform.FindControl(RADCOMBOQUALID);
                Button           _btnUpdate = (Button)editform.FindControl("btnUpdate");


                if (griditem.DataItem is PositionCompetencyKSA)
                {
                    PositionCompetencyKSA PDCompetencyKSA = griditem.DataItem as PositionCompetencyKSA;

                    _radEditorQualDescription.Content = PDCompetencyKSA.CompetencyKSA;
                    _radComboQualID.SelectedValue     = PDCompetencyKSA.QualificationID.ToString();
                }
                if (e.Item is GridEditFormInsertItem)
                {
                    //if (_tdsearch != null) _tdsearch.Visible = true;
                    ////BindKSACombo(_radComboKSA);
                    if (_btnUpdate != null)
                    {
                        _btnUpdate.CommandName = RadGrid.PerformInsertCommandName;
                        _btnUpdate.Text        = "Add KSA";
                    }
                    rgJADuty.ShowFooter = false;

                    if (rgQual.Items.Count <= 0)
                    {
                        this.rgQual.MasterTableView.NoMasterRecordsText     = "";
                        this.rgQual.MasterTableView.EnableNoRecordsTemplate = false;
                    }
                }
                else
                {
                    ////if (_tdsearch != null) _tdsearch.Visible = false;
                    //if (_trksadd != null) _trksadd.Visible = false;
                    if (_btnUpdate != null)
                    {
                        _btnUpdate.CommandName = RadGrid.UpdateCommandName;
                        _btnUpdate.Text        = "Save KSA";
                    }
                    if (IsInView)
                    {
                        _radComboQualID.Enabled = false;
                        _radcomboQualificationTypeID.Enabled = false;
                        if (_btnUpdate != null)
                        {
                            _btnUpdate.Enabled = false;
                        }
                    }
                    rgJADuty.ShowFooter = true;
                }
            }
        }
Esempio n. 14
0
        protected void gvCashSavingTransaction_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridEditFormInsertItem && e.Item.OwnerTableView.IsItemInserted)
            {
                GridEditFormInsertItem item     = (GridEditFormInsertItem)e.Item;
                DataTable        dtCFCCategory  = new DataTable();
                GridEditFormItem gefi           = (GridEditFormItem)e.Item;
                DropDownList     ddlCFCCategory = (DropDownList)gefi.FindControl("ddlCFCCategory");
                dtCFCCategory                 = customerAccountBo.GetCashFlowCategory();
                ddlCFCCategory.DataSource     = dtCFCCategory;
                ddlCFCCategory.DataValueField = dtCFCCategory.Columns["WERP_CFCCode"].ToString();
                ddlCFCCategory.DataTextField  = dtCFCCategory.Columns["WERP_CFCName"].ToString();
                ddlCFCCategory.DataBind();
                ddlCFCCategory.Items.Insert(0, new ListItem("Select", "Select"));
            }
            string strCasflowcategory;

            if (e.Item is GridEditFormItem && e.Item.IsInEditMode && e.Item.ItemIndex != -1)
            {
                int accountId = int.Parse(gvCashSavingTransaction.MasterTableView.DataKeyValues[e.Item.ItemIndex]["CCST_TransactionId"].ToString());
                strCasflowcategory = gvCashSavingTransaction.MasterTableView.DataKeyValues[e.Item.ItemIndex]["WERP_CFCCode"].ToString();
                string           rdbType        = gvCashSavingTransaction.MasterTableView.DataKeyValues[e.Item.ItemIndex]["CCST_IsWithdrwal"].ToString();
                GridEditFormItem editedItem     = (GridEditFormItem)e.Item;
                DataTable        dtCFCCategory  = new DataTable();
                DropDownList     ddlCFCCategory = (DropDownList)editedItem.FindControl("ddlCFCCategory");
                RadioButton      rbtnY          = (RadioButton)e.Item.FindControl("rbtnYes");
                RadioButton      rbtnN          = (RadioButton)e.Item.FindControl("rbtnNo");
                dtCFCCategory                 = customerAccountBo.GetCashFlowCategory();
                ddlCFCCategory.DataSource     = dtCFCCategory;
                ddlCFCCategory.DataValueField = dtCFCCategory.Columns["WERP_CFCCode"].ToString();
                ddlCFCCategory.DataTextField  = dtCFCCategory.Columns["WERP_CFCName"].ToString();
                ddlCFCCategory.DataBind();
                ddlCFCCategory.SelectedValue = strCasflowcategory;

                if (rdbType == "CR")
                {
                    rbtnY.Checked = false;
                    rbtnN.Checked = true;
                }
                else
                {
                    rbtnY.Checked = true;
                    rbtnN.Checked = false;
                }

                rbtnN.Enabled = false;
                rbtnY.Enabled = false;
                RadDatePicker dpTransactionDate = (RadDatePicker)e.Item.FindControl("dpTransactionDate");
                dpTransactionDate.SelectedDate = customeraccountVo.Transactiondate;
            }
            else
            {
                rbtnN.Enabled = true;
                rbtnY.Enabled = true;
            }
        }
    protected void rcbstate_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        RadComboBox      rdState    = (RadComboBox)o;
        GridEditFormItem editItem   = (GridEditFormItem)rdState.NamingContainer;
        RadComboBox      rdCity     = (RadComboBox)editItem.FindControl("rcbCity");
        RadComboBox      rcbCountry = (RadComboBox)editItem.FindControl("rcbCountry");

        if (rcbCountry.SelectedValue == "--Select--")
        {
            ShowPopUpMsg("Please Select Country");
        }
        else if (rdState.SelectedValue == "--Select--")
        {
            ShowPopUpMsg("Please Select State");
        }
        else
        {
            if (Request.QueryString["cid"] != null)
            {
                if (Request.QueryString["cid"].ToString() != string.Empty)
                {
                    _clientid = Convert.ToInt32(Request.QueryString["cid"].ToString());
                }
            }
            _countryid = Convert.ToInt32(rcbCountry.SelectedValue);
            if (rdState.SelectedValue.ToString().Contains("-"))
            {
                _stateid = Convert.ToInt32(rdState.SelectedValue.ToString().Substring(0, rdState.SelectedValue.ToString().IndexOf("-")));
            }
            else
            {
                _stateid = Convert.ToInt32(rdState.SelectedValue);
            }
            //_stateid = Convert.ToInt32(rdState.SelectedValue.ToString().Substring(0, rdState.SelectedValue.ToString().IndexOf("-")));
            //_stateid = Convert.ToInt32(rdState.SelectedValue);
            rdCity.Items.Clear();
            DataSet dscity = objJobsBAL.CitySelectByClientIDCountryStateIDVisibleByAdmin(_clientid, _countryid, _stateid);
            if (dscity.Tables.Count > 0 && dscity.Tables[0].Rows.Count > 0)
            {
                rdCity.DataSource     = dscity;
                rdCity.DataTextField  = "CityName";
                rdCity.DataValueField = "Lid";
                rdCity.DataBind();
                RadComboBoxItem ascityListItem = new RadComboBoxItem("--Select--", "--Select--");
                rdCity.Items.Insert(0, ascityListItem);
            }
            else
            {
                rdCity.DataSource = null;
                rdCity.DataBind();
                RadComboBoxItem ascityListItem = new RadComboBoxItem("--Select--", "--Select--");
                rdCity.Items.Insert(0, ascityListItem);
                editItem["city"].Parent.Visible = false;
            }
        }
    }
        protected void gvSchemeDetails_ItemDataBound(object sender, GridItemEventArgs e)
        {
            customerBo = new CustomerBo();
            if (e.Item is GridEditFormInsertItem && e.Item.OwnerTableView.IsItemInserted)
            {
                GridEditFormInsertItem item = (GridEditFormInsertItem)e.Item;
                TextBox txtBox       = (TextBox)item.FindControl("txtSchemePlanCodeForEditForm");
                TextBox txtBoxScName = (TextBox)item.FindControl("txtSchemePlanNameForEditForm");
                //txtBox.Text = txtSchemePlanCode.Value;
                //txtBoxScName.Text = txtSchemeName.Text;
                txtBox.Enabled       = false;
                txtBoxScName.Enabled = false;
                Button btn = (Button)item.FindControl("btnUpdate");
                btn.Text = "add";
            }
            if (e.Item is GridDataItem)
            {
                GridDataItem dataItem     = e.Item as GridDataItem;
                string       schemeName   = dataItem["PASC_AMC_ExternalType"].Text;
                LinkButton   buttonEdit   = dataItem["editColumn"].Controls[0] as LinkButton;
                LinkButton   buttonDelete = dataItem["deleteColumn"].Controls[0] as LinkButton;
                Label        lbl          = new Label();
                lbl = (Label)e.Item.FindControl("lblFiletypeId");
                if (schemeName == "AMFI" || schemeName == "ValueResearch" || schemeName == "AF")
                {
                    buttonEdit.Enabled   = false;
                    buttonDelete.Enabled = false;
                    buttonDelete.Attributes["onclick"] = "return alert('You cannot delete this scheme')";
                    buttonEdit.Attributes["onclick"]   = "return alert('You cannot Edit this scheme')";
                }
            }

            if (e.Item is GridEditFormItem && e.Item.IsInEditMode && e.Item.ItemIndex != -1)
            {
                string strExtType = gvSchemeDetails.MasterTableView.DataKeyValues[e.Item.ItemIndex]["PASC_AMC_ExternalType"].ToString();
                strExternalCodeToBeEdited = gvSchemeDetails.MasterTableView.DataKeyValues[e.Item.ItemIndex]["PASC_AMC_ExternalCode"].ToString();
                string IsOnline = gvSchemeDetails.MasterTableView.DataKeyValues[e.Item.ItemIndex]["PASC_IsOnline"].ToString();
                if (Session["extCodeTobeEdited"] != null)
                {
                    Session["extCodeTobeEdited"] = null;
                }
                Session["extCodeTobeEdited"] = strExternalCodeToBeEdited;
                GridEditFormItem editedItem   = (GridEditFormItem)e.Item;
                DropDownList     dropDownList = (DropDownList)editedItem.FindControl("ddlExternalType");
                dropDownList.SelectedValue = strExtType;
                DropDownList ddlONline = (DropDownList)editedItem.FindControl("ddlONline");
                if (IsOnline == "NO")
                {
                    ddlONline.SelectedValue = 0.ToString();
                }
                else
                {
                    ddlONline.SelectedValue = 1.ToString();
                }
            }
        }
Esempio n. 17
0
 protected void grdProductOptions_ItemCreated(object sender, GridItemEventArgs e)
 {
     if (e.Item is GridEditableItem && e.Item.IsInEditMode)
     {
         GridEditFormItem item          = e.Item as GridEditFormItem;
         RadComboBox      ddlOptionType = item.FindControl("txtOptionType") as RadComboBox;
         ddlOptionType.DataSource = (from t in entities.OptionTypes
                                     select t).ToList();
     }
 }
Esempio n. 18
0
        protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            DataSet dsRiskClass = new DataSet();

            if (e.Item is GridCommandItem)
            {
                GridCommandItem cmditm = (GridCommandItem)e.Item;
                //to hide AddNewRecord button
                //cmditm.FindControl("InitInsertButton").Visible = false;//hide the text
                //cmditm.FindControl("AddNewRecordButton").Visible = false;//hide the image

                //to hide Refresh button
                cmditm.FindControl("RefreshButton").Visible    = false; //hide the text
                cmditm.FindControl("RebindGridButton").Visible = false; //hide the image
            }
            if (e.Item is GridDataItem)
            {
                GridDataItem dataItem      = e.Item as GridDataItem;
                string       riskClassName = dataItem["XRC_RiskClass"].Text;

                LinkButton button = dataItem["DeleteColumn"].Controls[0] as LinkButton;
                button.Attributes["onclick"] = "return confirm('Are you sure you want to delete " +
                                               riskClassName + "?')";
            }
            if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode))
            {
                GridEditFormItem editform      = (GridEditFormItem)e.Item;
                DropDownList     ddl           = (DropDownList)editform.FindControl("ddlPickRiskClass");
                int          adviserId         = advisorVo.advisorId;
                HtmlTableRow trRiskCodeddl     = (HtmlTableRow)editform.FindControl("trRiskCodeddl");
                HtmlTableRow trRiskGoaltextBox = (HtmlTableRow)editform.FindControl("trRiskGoaltextBox");

                if (e.Item.RowIndex == -1)
                {
                    trRiskCodeddl.Visible     = true;
                    trRiskGoaltextBox.Visible = false;
                    //dsRiskClass = modelPortfolioBo.bindDdlPickRiskClass(adviserId, Convert.ToInt16(ddlClassType.SelectedValue));

                    dsRiskClass = modelPortfolioBo.bindDdlPickRiskClass(adviserId, 1);
                    if (dsRiskClass.Tables[0].Rows.Count > 0)
                    {
                        ddl.DataSource     = dsRiskClass.Tables[0];
                        ddl.DataValueField = dsRiskClass.Tables[0].Columns["XRC_RiskClassCode"].ToString();
                        ddl.DataTextField  = dsRiskClass.Tables[0].Columns["XRC_RiskClass"].ToString();
                        ddl.DataBind();
                        ddl.Items.Insert(0, new System.Web.UI.WebControls.ListItem("Select Risk Class", "Select Risk Class"));
                    }
                }
                else
                {
                    trRiskCodeddl.Visible     = false;
                    trRiskGoaltextBox.Visible = true;
                }
            }
        }
Esempio n. 19
0
        protected void grdConceptoNomina_UpdateCommand(object sender, GridCommandEventArgs e)
        {
            try
            {
                ErrorManager();
                Sesion           sesion     = (Sesion)Session["Sesion" + Session.SessionID];
                GridEditFormItem editedItem = e.Item as GridEditFormItem;

                ConceptosNomina productoPrecio = new ConceptosNomina();
                productoPrecio.Id_Emp          = Convert.ToInt32(editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["Id_Emp"]);
                productoPrecio.Id_Cd           = Convert.ToInt32(editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["Id_Cd"]);
                productoPrecio.Id_Colaborador  = Convert.ToInt32(editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["Id_Colaborador"]);
                productoPrecio.Id_Compensacion = Convert.ToInt32(editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["Id_Compensacion"]);

                //productoPrecio.Compensacion_Estatus = Convert.ToInt32(((Literal)editedItem["Compensacion_Estatus"].Controls[1]).Text);
                productoPrecio.Id_Compensacion_Monto = Convert.ToInt32(((Literal)editedItem["Id_Compensacion_Monto"].Controls[1]).Text);
                productoPrecio.Id_Empleado           = Convert.ToInt32(((Literal)editedItem["Id_empleado"].Controls[1]).Text);
                productoPrecio.Monto = Convert.ToSingle((editedItem["Monto"].FindControl("txtMonto") as RadNumericTextBox).Text);


                List <ConceptosNomina> listaProdPre = new List <ConceptosNomina>();
                for (int i = 0; i < this.listConceptosNomina.Count; i++)
                {
                    listaProdPre.Add((ConceptosNomina)this.ClonarPrecioProducto(this.listConceptosNomina[i]));
                }

                //Agregar precio a la lista actual
                foreach (ConceptosNomina p in this.listConceptosNomina)
                {
                    if (p.Id_Compensacion_Monto == productoPrecio.Id_Compensacion_Monto) // && p.Estatus == productoPrecio.Estatus && p.Estatus == true)
                    {
                        List <ConceptosNomina> listaPP = new List <ConceptosNomina>(this.listConceptosNomina);
                        //int posicionFila = grdConceptoNomina.CurrentPageIndex * grdConceptoNomina.PageSize + e.Item.ItemIndex;
                        //listaPP[posicionFila].Monto = productoPrecio.Monto;
                        //listaPP[posicionFila].Id_Emp = productoPrecio.Id_Emp;
                        //listaPP[posicionFila].Id_Cd = productoPrecio.Id_Cd;
                        //listaPP[posicionFila].Id_Colaborador = productoPrecio.Id_Colaborador;
                        //listaPP[posicionFila].Id_Compensacion = productoPrecio.Id_Compensacion;

                        //listaPP[posicionFila].Compensacion_Estatus = productoPrecio.Compensacion_Estatus;
                        //listaPP[posicionFila].Id_Compensacion_Monto = productoPrecio.Id_Compensacion_Monto;
                        //listaPP[posicionFila].Id_Empleado = productoPrecio.Id_Empleado;
                        //listaPP[posicionFila].Compensacion_Descripcion = productoPrecio.Compensacion_Descripcion;

                        this.listConceptosNomina = listaPP;

                        break;
                    }
                }
            }
            catch (Exception ex)
            {  //ErrorManager(ex, new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name);
                this.DisplayMensajeAlerta(ex.Message);
            }
        }
    protected void rcbclient_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        RadComboBox      rdCountry = (RadComboBox)o;
        GridEditFormItem editItem  = (GridEditFormItem)rdCountry.NamingContainer;

        RadComboBox rcbCountry = (RadComboBox)editItem.FindControl("rcbCountry");

        rcbCountry.ClearSelection();

        //rdCountry.SelectedValue = "--Select--";
    }
Esempio n. 21
0
        protected void rGridTeam_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            try
            {
                if (e.Item is GridEditFormInsertItem)
                {
                    GridEditFormInsertItem dataItem = e.Item as GridEditFormInsertItem;

                    RadDropDownList rDDUserName = (RadDropDownList)dataItem.FindControl("rDDUserName");
                    rDDUserName.DataSource     = aspUserBLL.ListAspUsers();
                    rDDUserName.DataValueField = "UserId";
                    rDDUserName.DataTextField  = "UserName";
                    rDDUserName.DataBind();
                }
                else if (e.Item is GridEditableItem && e.Item.IsInEditMode)
                {
                    GridEditFormItem dataItem = e.Item as GridEditFormItem;

                    RadDropDownList rDDUserName = (RadDropDownList)dataItem.FindControl("rDDUserName");
                    rDDUserName.DataSource     = aspUserBLL.ListAspUsers();
                    rDDUserName.DataValueField = "UserId";
                    rDDUserName.DataTextField  = "UserName";
                    rDDUserName.DataBind();
                    rDDUserName.SelectedValue = DataBinder.Eval(dataItem.DataItem, "OwnerUserID").ToString();
                }
                else if (e.Item is GridDataItem)
                {
                    GridDataItem dataItem = e.Item as GridDataItem;

                    MembershipUser currentUser = Membership.GetUser();

                    if (!Roles.IsUserInRole(Page.User.Identity.Name, "CSBA_Admin"))
                    {
                        if (DataBinder.Eval(dataItem.DataItem, "OwnerUserID").ToString() != currentUser.ProviderUserKey.ToString())
                        {
                            ImageButton EditButton = (ImageButton)dataItem["EditCommandColumn"].Controls[0];
                            EditButton.Visible = false;
                            ImageButton deleteButton = (ImageButton)dataItem["Delete"].Controls[0];
                            deleteButton.Visible = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                StackTrace st        = new StackTrace();
                StackFrame sf        = st.GetFrame(0);
                string     errMethod = sf.GetMethod().Name.ToString();                                           // Get the current method name
                string     errMsg    = "600";                                                                    // Gotta pass something, we're retro-fitting an existing method
                Session["LastException"] = ex;                                                                   // Throw the exception in the session variable, will be used in error page
                string url = string.Format(ConfigurationManager.AppSettings["ErrorPageURL"], errMethod, errMsg); //Set the URL
                Response.Redirect(url);                                                                          // Go to the error page.
            }
        }
Esempio n. 22
0
        protected void RadGrid2_UpdateCommand(object source, GridCommandEventArgs e)
        {
            GridEditableItem editedItem = e.Item as GridEditableItem;
            GridEditManager  editMan    = editedItem.EditManager;

            string criterion_name = editedItem.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["criterion_name"].ToString();

            Int32  wt_int;
            string wt_str = null;

            wt_str = (editedItem.FindControl("TB1") as TextBox).Text;
            wt_int = Int32.Parse(wt_str);


            GridEditFormItem item          = e.Item as GridEditFormItem;
            string           val_type      = item.ParentItem["value_type"].Text;
            string           val_type_char = val_type;

            string criterion_val = item.ParentItem["criterion_value"].Text;

            string   I_char_val = null;
            Int32    I_num_val  = 0;
            DateTime I_date_val = DateTime.MinValue;

            switch (val_type_char)
            {
            case ("C"):
                I_char_val = criterion_val;
                break;

            case ("N"):
                I_num_val = Int32.Parse(criterion_val);
                break;

            case ("D"):
                I_date_val = DateTime.Parse(criterion_val);
                break;

            default:
                I_char_val = criterion_val;
                break;
            }



            if (wt_int > 0)
            {
                PackPriorityDAO packpriority_dao = new PackPriorityDAO();
                Decimal         status           = packpriority_dao.Update_packpriorityval(criterion_name, val_type_char, wt_int, I_char_val, I_num_val, I_date_val);
            }


            this.Bindgrid(criterion);
        }
Esempio n. 23
0
 protected void rgOrdendes_ItemDataBound(object sender, GridItemEventArgs e)
 {
     if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
     {
         GridEditFormItem item = (GridEditFormItem)e.Item;
         TextBox          txt  = (TextBox)item["Descripcion"].Controls[0];
         txt.TextMode = TextBoxMode.MultiLine;
         txt.Rows     = 6;
         txt.Width    = new Unit(100, UnitType.Percentage);
     }
 }
 protected void gvCustomerAlertSetup_OnItemDataBound(object sender, GridItemEventArgs e)
 {
     if (e.Item is GridEditFormInsertItem && e.Item.OwnerTableView.IsItemInserted)
     {
         GridEditFormInsertItem item = (GridEditFormInsertItem)e.Item;
         GridEditFormItem       gefi = (GridEditFormItem)e.Item;
         DropDownList           ddlSIPDiscription = (DropDownList)gefi.FindControl("ddlSIPDiscription");
         DropDownList           ddlAlert          = (DropDownList)gefi.FindControl("ddlAlert");
         BindCustomerSIP(ddlSIPDiscription);
         BindCustomerSIPRule(ddlAlert);
     }
 }
Esempio n. 25
0
        private void searchKSA_KSASearchCompleted(object sender, EventArgs e)
        {
            GridEditFormItem editform    = rgDutyKSA.MasterTableView.GetItems(GridItemType.EditFormItem)[0] as GridEditFormItem;
            ctrlSearchKSA    searchKSA   = editform.FindControl("SearchKSA") as ctrlSearchKSA;
            RadComboBox      radcomboKSA = editform.FindControl("radcomboKSA") as RadComboBox;

            Literal literalsearchmsg = editform.FindControl("literalSearchmsg") as Literal;

            searchKSA.SetSearchResultMessage(ref literalsearchmsg);
            radcomboKSA.Items.Clear();
            setDefaultKSAOptionSelectedAndBindToControl(radcomboKSA, searchKSA.KSAList);
        }
Esempio n. 26
0
        protected void UpdateDutyKSA(object sender, GridCommandEventArgs e)
        {
            GridEditFormItem editform   = (GridEditFormItem)e.Item;
            long             jQFactorID = (long)editform.GetDataKeyValue("JQFactorID");

            if (jQFactorID > 0)
            {
                JobAnalysisDutyKSAFactor jaDutyKSAFactor = new JobAnalysisDutyKSAFactor(jQFactorID);
                AssignJADutyKSAFactorValues(jaDutyKSAFactor, e);
                jaDutyKSAFactor.Update();
            }
        }
Esempio n. 27
0
 protected void RadGrid1_OnItemDataBound(object sender, GridItemEventArgs e)
 {
     if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
     {
         GridEditFormItem dataItem = e.Item as GridEditFormItem;
         TableCell        cell     = dataItem["Thang"];
         RadDatePicker    rdp      = cell.Controls[0] as RadDatePicker;
         rdp.SharedCalendar.UseColumnHeadersAsSelectors = false;
         rdp.SharedCalendar.UseRowHeadersAsSelectors    = false;
         rdp.SharedCalendar.RangeMaxDate = DateTime.Now;
     }
 }
Esempio n. 28
0
 protected void grdProductAdon_ItemCreated(object sender, GridItemEventArgs e)
 {
     if (e.Item is GridEditableItem && e.Item.IsInEditMode)
     {
         GridEditFormItem item         = e.Item as GridEditFormItem;
         RadComboBox      ddlPAdOnType = item.FindControl("txtAdonType") as RadComboBox;
         ddlPAdOnType.DataSource = _adonTypeManager.GetAllAdonType();
     }
     else if (e.Item is GridGroupHeaderItem)
     {
         GridGroupHeaderItem item = e.Item as GridGroupHeaderItem;
     }
 }
Esempio n. 29
0
        private void searchKSA_KSASearchCancelCompleted(object sender, EventArgs e)
        {
            GridEditFormItem editform    = rgDutyKSA.MasterTableView.GetItems(GridItemType.EditFormItem)[0] as GridEditFormItem;
            RadComboBox      radcomboKSA = editform.FindControl("radcomboKSA") as RadComboBox;

            BindKSACombo(radcomboKSA);
            Literal literalsearchmsg = editform.FindControl("literalSearchmsg") as Literal;

            if (literalsearchmsg != null)
            {
                literalsearchmsg.Text = string.Empty;
            }
        }
Esempio n. 30
0
 protected void rgDutyKSA_ItemCreated(object sender, GridItemEventArgs e)
 {
     if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
     {
         GridEditFormItem editform    = (GridEditFormItem)e.Item;
         ctrlSearchKSA    searchKSA   = editform.FindControl("SearchKSA") as ctrlSearchKSA;
         RadComboBox      radcomboKSA = (RadComboBox)editform.FindControl("radcomboKSA");
         searchKSA.KSASearchCompleted       += new ctrlSearchKSA.KSASearchCompletedHandler(searchKSA_KSASearchCompleted);
         searchKSA.KSASearchCancelCompleted += new ctrlSearchKSA.KSASearchCancelCompleteHandler(searchKSA_KSASearchCancelCompleted);
         searchKSA.KSASearchClearCompleted  += new ctrlSearchKSA.KSASearchClearCompleteHandler(searchKSA_KSASearchClearCompleted);
         radcomboKSA.SelectedIndexChanged   += new RadComboBoxSelectedIndexChangedEventHandler(radcomboKSA_SelectedIndexChanged);
     }
 }