예제 #1
1
 ASPxCallbackPanel CreateSplitterDetailPane(ASPxSplitter splitter) {
     SplitterPane detailPane = splitter.Panes.Add();
     detailPane.ScrollBars = ScrollBars.Auto;
     var updatePanel = new ASPxCallbackPanel { ID = "DetailUpdatePanel", ClientIDMode = ClientIDMode.Static };
     updatePanel.ClientSideEvents.Init = "function (s,e) {s.GetMainElement().ClientControl = s;}";
     detailPane.Controls.Add(updatePanel);
     return updatePanel;
 }
예제 #2
0
        protected void spinItemTax_Load(object sender, EventArgs e)
        {
            ASPxSpinEdit      spin  = sender as ASPxSpinEdit;
            ASPxCallbackPanel panel = spin.NamingContainer as ASPxCallbackPanel;

            //Set data when in edit mode
            if (gridviewBillItem.IsEditing && !gridviewBillItem.IsNewRowEditing && !panel.IsCallback)
            {
                var billItemId = (panel.NamingContainer
                                  as DevExpress.Web.ASPxGridView.GridViewDataItemTemplateContainer).KeyValue;
                object itemId = gridviewBillItem.GetRowValuesByKeyValue(billItemId, "ItemId!Key");
                if (itemId == DBNull.Value)
                {
                    return;
                }
                ItemBO  itemBO  = new ItemBO();
                ItemTax itemTax = itemBO.GetCurrentVATOfItem(session, (Guid)itemId);
                if (itemTax != null)
                {
                    spin.Number = (decimal)itemTax.TaxId.Percentage;
                }
                else
                {
                    spin.Number = 0;
                }
            }
        }
예제 #3
0
    protected void PanelDetails_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
    {
        sqlProductDetails.SelectParameters["ProductID"].DefaultValue = ASPxComboBox2.Value.ToString();
        DataTable dataTable = ((DataView)sqlProductDetails.Select(new DataSourceSelectArguments())).Table;
        HtmlTable table     = new HtmlTable {
            ID = "detailTable", ClientIDMode = System.Web.UI.ClientIDMode.Static
        };

        if (dataTable.Rows.Count != 0)
        {
            DataRow           details = dataTable.Rows[0];
            ASPxCallbackPanel panel   = sender as ASPxCallbackPanel;
            for (int i = 0; i < details.ItemArray.Length; i++)
            {
                HtmlTableRow  row       = new HtmlTableRow();
                HtmlTableCell cellField = new HtmlTableCell()
                {
                    InnerText = string.Format("{0}: ", dataTable.Columns[i].Caption), Width = ASPxComboBox1.Width.ToString()
                };
                HtmlTableCell cellValue = new HtmlTableCell()
                {
                    InnerText = details[i].ToString()
                };
                row.Cells.Add(cellField); row.Cells.Add(cellValue);
                table.Rows.Add(row);
            }
            table.Style.Add("text-align", "right");
            panel.Controls.Add(table);
        }
    }
        protected void BUCallBackPanel_Callback(object sender, CallbackEventArgsBase e)
        {
            ASPxPageControl pageControl = BUDeptListGrid.FindEditFormTemplateControl("BUHeadPageControl") as ASPxPageControl;
            ASPxComboBox    entCode     = pageControl.FindControl("EntityCode") as ASPxComboBox;

            ASPxCallbackPanel callBackPanel = pageControl.FindControl("BUCallBackPanel") as ASPxCallbackPanel;
            ASPxComboBox      buCode        = callBackPanel.FindControl("BUCode") as ASPxComboBox;

            buCode.Value = "";
            buCode.Text  = "";

            DataTable dtRecord = GlobalClass.EntBUSSUTable(entCode.Value.ToString());

            buCode.DataSource = dtRecord;

            //ListBoxColumn l_value = new ListBoxColumn();
            //l_value.FieldName = "ID";
            //l_value.Caption = "ID";
            //buCode.Columns.Add(l_value);

            //ListBoxColumn l_text = new ListBoxColumn();
            //l_text.FieldName = "NAME";
            //l_text.Caption = "Name";
            //buCode.Columns.Add(l_text);

            buCode.TextField        = "NAME";
            buCode.ValueField       = "ID";
            buCode.TextFormatString = "{1}";
            buCode.DataBind();
        }
예제 #5
0
    protected void cbpnEmployee_Init(object sender, EventArgs e)
    {
        ASPxCallbackPanel callbackPanel             = sender as ASPxCallbackPanel;
        GridViewDataItemTemplateContainer container = callbackPanel.NamingContainer as GridViewDataItemTemplateContainer;

        callbackPanel.ClientInstanceName = String.Format("callbackPanel_{0}", container.KeyValue);
    }
예제 #6
0
 protected void ASPxCallbackPanelcont_Callback(object sender, CallbackEventArgsBase e)
 {
     ASPxCallbackPanel cbPanel = (ASPxCallbackPanel)sender;
     int         upId          = Convert.ToInt32(e.Parameter.ToString());
     clsUserInfo obj           = clsUserInfo.getData(upId);
     ASPxMemo    ASPxMemoCont  = (ASPxMemo)cbPanel.FindControl("ASPxMemoCont"); ASPxMemoCont.Text = obj.Address;
 }
예제 #7
0
        protected void cpnFirma_Callback(object sender, CallbackEventArgsBase e)
        {
            ASPxCallbackPanel panel  = (ASPxCallbackPanel)sender;
            ASPxBinaryImage   bImage = (ASPxBinaryImage)panel.FindControl("bimFirma");

            bImage.ContentBytes = (byte[])Session[Constantes.SesionFirmaEmpleado];
            bImage.Visible      = true;
        }
예제 #8
0
    protected void hlCancel_Init(object sender, EventArgs e)
    {
        ASPxHyperLink     link          = sender as ASPxHyperLink;
        ASPxCallbackPanel callbackPanel = link.NamingContainer.NamingContainer.NamingContainer as ASPxCallbackPanel;

        link.Visible = GetEditMode(callbackPanel);
        link.ClientSideEvents.Click = String.Format("function(s, e) {{ {0}.PerformCallback('CANCEL'); }}", callbackPanel.ClientInstanceName);
    }
예제 #9
0
        protected void gvUser_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxGridView      gridView    = sender as ASPxGridView;
            ASPxCallbackPanel cbPanel     = gridView.FindEditFormTemplateControl("ASPxCallbackOffice") as ASPxCallbackPanel;
            ASPxTextBox       txtofficeid = (ASPxTextBox)cbPanel.FindControl("txtofficeid");

            e.NewValues["OfficeLocID"] = txtofficeid.Value;
        }
        protected void BUDeptListGrid_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxGridView      grid          = sender as ASPxGridView;
            ASPxPageControl   pageControl   = grid.FindEditFormTemplateControl("BUHeadPageControl") as ASPxPageControl;
            ASPxDateEdit      effectDate    = pageControl.FindControl("EffectDate") as ASPxDateEdit;
            ASPxComboBox      entCode       = pageControl.FindControl("EntityCode") as ASPxComboBox;
            ASPxCallbackPanel callBackPanel = pageControl.FindControl("BUCallBackPanel") as ASPxCallbackPanel;
            ASPxComboBox      buCode        = callBackPanel.FindControl("BUCode") as ASPxComboBox;
            ASPxComboBox      buHead        = pageControl.FindControl("BUHead") as ASPxComboBox;
            ASPxComboBox      buHeadStatus  = pageControl.FindControl("BUHeadStatus") as ASPxComboBox;

            SqlConnection conn = new SqlConnection(GlobalClass.SQLConnString());

            conn.Open();

            string sCtrlNum      = GlobalClass.GetControl_DocNum("BU_Dept_Head", Convert.ToDateTime(effectDate.Value.ToString()));
            string sLastModified = DateTime.Now.ToString();

            string sbuCode = "";

            if (buCode.Value != null)
            {
                sbuCode = buCode.Value.ToString();
            }

            string insert = "INSERT INTO tbl_System_BUDeptHead ([Ctrl], [EffectDate], [EntityCode], [BUDeptCode], [UserKey], [StatusKey], [LastModified]) VALUES (@Ctrl, @EffectDate, @EntityCode, @BUDeptCode, @UserKey, @StatusKey, @LastModified)";

            SqlCommand cmd = new SqlCommand(insert, conn);

            cmd.Parameters.AddWithValue("@Ctrl", sCtrlNum);
            cmd.Parameters.AddWithValue("@EffectDate", effectDate.Value.ToString());
            cmd.Parameters.AddWithValue("@EntityCode", entCode.Value.ToString());
            cmd.Parameters.AddWithValue("@BUDeptCode", sbuCode.ToString());
            cmd.Parameters.AddWithValue("@UserKey", buHead.Value.ToString());
            cmd.Parameters.AddWithValue("@StatusKey", buHeadStatus.Value.ToString());
            cmd.Parameters.AddWithValue("@LastModified", sLastModified);
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();

            e.Cancel = true;
            grid.CancelEdit();
            BindUserList();

            int           pk_latest = 0;
            string        query_pk  = "SELECT TOP 1 [PK] FROM tbl_System_BUDeptHead ORDER BY [PK] DESC";
            SqlCommand    comm      = new SqlCommand(query_pk, conn);
            SqlDataReader r         = comm.ExecuteReader();

            while (r.Read())
            {
                pk_latest = Convert.ToInt32(r[0].ToString());
            }
            conn.Close();
            if (pk_latest > 0)
            {
                FocusThisRowGrid(grid, pk_latest);
            }
        }
예제 #11
0
    protected void hlAdd_Init(object sender, EventArgs e)
    {
        ASPxHyperLink     link          = sender as ASPxHyperLink;
        ASPxCallbackPanel callbackPanel = link.NamingContainer.NamingContainer.NamingContainer as ASPxCallbackPanel;
        GridViewDataItemTemplateContainer gridContainer = callbackPanel.NamingContainer as GridViewDataItemTemplateContainer;

        link.Visible = GetEditMode(callbackPanel);
        link.ClientSideEvents.Click = String.Format("function(s, e) {{ var value = cbNewEmployee_{0}.GetValue(); if (value != null) {1}.PerformCallback('ADD|' + value); }}", gridContainer.KeyValue, callbackPanel.ClientInstanceName);
    }
예제 #12
0
 ASPxCallbackPanel CreateSplitterDetailPane(ASPxSplitter splitter) {
     SplitterPane detailPane = splitter.Panes.Add();
     detailPane.ScrollBars = ScrollBars.Auto;
     var updatePanel = new ASPxCallbackPanel { ID = "DetailUpdatePanel", ClientInstanceName = "DetailUpdatePanel" };
     updatePanel.ClientSideEvents.Init = GetAdjustSizeScript();
     updatePanel.ClientSideEvents.EndCallback = "function(s,e) {ProcessMarkup(s, true);}";
     updatePanel.CustomJSProperties += updatePanel_CustomJSProperties;
     detailPane.Controls.Add(updatePanel);
     return updatePanel;
 }
예제 #13
0
    protected void ASPxCallbackPanel1_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
    {
        Session["CategoryID"] = e.Parameter;

        ASPxCallbackPanel panel = (ASPxCallbackPanel)sender;

        ASPxDataView dataView = (ASPxDataView)panel.FindControl("ASPxDataView1");

        dataView.DataBind();
    }
예제 #14
0
        protected void ASPxCallbackcon_Callback(object sender, CallbackEventArgsBase e)
        {
            ASPxCallbackPanel cbPanel = (ASPxCallbackPanel)sender;
            int         upId          = Convert.ToInt32(e.Parameter.ToString());
            clsUserInfo obj2          = clsUserInfo.getData(upId);
            ASPxTextBox txtPhone      = (ASPxTextBox)cbPanel.FindControl("txtPhone");
            ASPxMemo    ASPxMemoPres  = (ASPxMemo)cbPanel.FindControl("ASPxMemoPres");

            txtPhone.Text = obj2.PhoneNo; ASPxMemoPres.Text = obj2.Address;
        }
예제 #15
0
    protected void repEmployee_Init(object sender, EventArgs e)
    {
        Repeater          rep           = sender as Repeater;
        ASPxCallbackPanel callbackPanel = rep.NamingContainer as ASPxCallbackPanel;
        GridViewDataItemTemplateContainer gridContainer = callbackPanel.NamingContainer as GridViewDataItemTemplateContainer;

        string cellData = DataBinder.Eval(gridContainer.DataItem, gridContainer.Column.FieldName).ToString();

        rep.DataSource = GetEmployeeData(cellData);
    }
예제 #16
0
        public override void BreakLinksToControls()
        {
            if (_table != null)
            {
                _table.PreRender -= control_PreRender;
            }
            if (_callbackPanel != null)
            {
                _callbackPanel.Callback -= callbackPanel_Callback;
            }
            foreach (ASPxEdit item in _controls)
            {
                var box = item as ASPxComboBox;
                if (box != null)
                {
                    box.SelectedIndexChanged -= DetailItemControlValueChanged;
                    box.Load -= c_Load;
                }
                else
                {
                    var checkBox = item as ASPxCheckBox;
                    if (checkBox != null)
                    {
                        checkBox.CheckedChanged -= DetailItemControlValueChanged;
                    }
                    else
                    {
                        var textBox = item as ASPxTextBox;
                        if (textBox != null)
                        {
                            textBox.TextChanged -= DetailItemControlValueChanged;
                        }
                        else if (item is ASPxSpinEdit)
                        {
                            item.ValueChanged -= DetailItemControlValueChanged;
                        }
                        else
                        {
                            var edit = item as ASPxDateEdit;
                            if (edit != null)
                            {
                                edit.DateChanged -= DetailItemControlValueChanged;
                            }
                        }
                    }
                }
            }

            ClearAllCollectionsOfControls();

            _table         = null;
            _callbackPanel = null;

            base.BreakLinksToControls();
        }
예제 #17
0
    protected void hlRemove_Init(object sender, EventArgs e)
    {
        ASPxHyperLink     link          = sender as ASPxHyperLink;
        RepeaterItem      item          = link.NamingContainer as RepeaterItem;
        Repeater          rep           = item.NamingContainer as Repeater;
        ASPxCallbackPanel callbackPanel = rep.NamingContainer as ASPxCallbackPanel;

        object employeeID = DataBinder.Eval(item.DataItem, "EmployeeID");

        link.ClientSideEvents.Click = String.Format("function(s, e) {{ if (confirm('Are you sure?')) {0}.PerformCallback('DELETE|{1}'); }}", callbackPanel.ClientInstanceName, employeeID);
    }
예제 #18
0
    protected void cbpnEmployee_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
    {
        ASPxCallbackPanel callbackPanel             = sender as ASPxCallbackPanel;
        GridViewDataItemTemplateContainer container = callbackPanel.NamingContainer as GridViewDataItemTemplateContainer;
        Repeater repEmployee = callbackPanel.FindControl("repEmployee") as Repeater;

        string[] parameters = e.Parameter.Split('|');
        string   operation  = parameters[0];

        string        cellData      = DataBinder.Eval(container.DataItem, container.Column.FieldName).ToString();
        List <string> employees     = cellData.Split(',').ToList <string>();
        bool          isDataUpdated = false;

        switch (operation)
        {
        case "DELETE":
            if (employees.Count > 1)
            {
                string id = parameters[1];
                employees.Remove(id);
            }

            isDataUpdated = true;
            break;

        case "ADD":
            string newEmployee = parameters[1];
            employees.Add(newEmployee);

            isDataUpdated = true;
            SetEditMode(callbackPanel, false);
            break;

        case "ADDNEW":
            SetEditMode(callbackPanel, true);
            break;

        case "CANCEL":
            SetEditMode(callbackPanel, false);
            break;
        }


        string employeesList = String.Join(",", employees.ToArray());

        if (isDataUpdated)
        {
            //Update grid's data
            UpdateEmployeeCell(container.KeyValue, employeesList);
        }

        repEmployee.DataSource = GetEmployeeData(employeesList);
        repEmployee.DataBind();
    }
        private void RefreshMasterAccountActorComboBox(object sender)
        {
            //Clear selection
            ASPxCallbackPanel    panel = sender as ASPxCallbackPanel;
            AccountActorComboBox accountActorComboBox =
                (AccountActorComboBox)panel.FindControl("accountActorComboBox");

            accountActorComboBox.ComboBox.SelectedIndex = -1;

            UpdateMasterAccountActorComboBox(sender);
        }
예제 #20
0
        protected void ASPxCallbackOffice_Callback(object sender, CallbackEventArgsBase e)
        {
            ASPxCallbackPanel cbPanel = (ASPxCallbackPanel)sender;
            int          upId         = Convert.ToInt32(e.Parameter.ToString());
            ASPxTextBox  lbOffice     = (ASPxTextBox)cbPanel.FindControl("txtOffice");
            ASPxTextBox  txtofficeid  = (ASPxTextBox)cbPanel.FindControl("txtofficeid");
            ASPxComboBox cboZilla     = (ASPxComboBox)gvUser.FindEditFormTemplateControl("cboZilla");

            //sdsUser.InsertParameters["OfficeLocID"].DefaultValue
            txtofficeid.Text = DataAccess.RunSqlString("select OfficeLocID from OfficeLocations where ZillaID=" + cboZilla.Value + " and UpazilaID= " + upId);
            /// sdsUser.UpdateParameters["OfficeLocID"].DefultValue = DataAccess.RunSqlString("select OfficeLocID from OfficeLocations where ZillaID=" + cboZilla.Value + " and UpazilaID= " + upId);
            lbOffice.Text = DataAccess.RunSqlString("select DetailsAddress from OfficeLocations where ZillaID=" + cboZilla.Value + " and UpazilaID= " + upId);
        }
예제 #21
0
 void SetEditMode(ASPxCallbackPanel callbackPanel, bool inEditMode)
 {
     if (inEditMode != GetEditMode(callbackPanel))
     {
         if (inEditMode)
         {
             callbackPanel.JSProperties.Add("cpIsEditing", true);
         }
         else
         {
             callbackPanel.JSProperties.Remove("cpIsEditing");
         }
     }
 }
        protected void ASPxCallbackPanel1_Callback(object sender, DevExpress.Web.CallbackEventArgsBase e)
        {
            ASPxCallbackPanel callbackPanel = (ASPxCallbackPanel)sender;
            Dashboard         dashboard     = new Dashboard();

            IEditableDashboardStorage storage = DashboardConfigurator.Default.DashboardStorage as IEditableDashboardStorage;

            if (storage != null)
            {
                string newID = storage.AddDashboard(dashboard.SaveToXDocument(), Guid.NewGuid().ToString());
                BindListBox();
                callbackPanel.JSProperties["cpNew"] = newID;
            }
        }
    protected void cbpAccountName_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
    {
        ASPxCallbackPanel cbp = (ASPxCallbackPanel)sender;

        if (MLSControlExistAccountName == null)
        {
            ctrlMLSAccountName.Value = null;
            return;
        }
        else
        {
            ctrlMLSAccountName.Value = MLSControlExistAccountName.Value;
        }
    }
        protected void BUDeptListGrid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            ASPxGridView      grid          = sender as ASPxGridView;
            ASPxPageControl   pageControl   = grid.FindEditFormTemplateControl("BUHeadPageControl") as ASPxPageControl;
            ASPxDateEdit      effectDate    = pageControl.FindControl("EffectDate") as ASPxDateEdit;
            ASPxComboBox      entCode       = pageControl.FindControl("EntityCode") as ASPxComboBox;
            ASPxCallbackPanel callBackPanel = pageControl.FindControl("BUCallBackPanel") as ASPxCallbackPanel;
            ASPxComboBox      buCode        = callBackPanel.FindControl("BUCode") as ASPxComboBox;
            ASPxComboBox      buHead        = pageControl.FindControl("BUHead") as ASPxComboBox;
            ASPxComboBox      buHeadStatus  = pageControl.FindControl("BUHeadStatus") as ASPxComboBox;

            SqlConnection conn = new SqlConnection(GlobalClass.SQLConnString());

            conn.Open();

            string PK            = e.Keys[0].ToString();
            string sLastModified = DateTime.Now.ToString();
            string sbuCode       = "";

            if (buCode.Value != null)
            {
                sbuCode = buCode.Value.ToString();
            }
            string update_MRP = "UPDATE tbl_System_BUDeptHead " +
                                " SET [EffectDate] = @EffectDate, " +
                                " [EntityCode] = @EntCode, " +
                                " [BUDeptCode] = @BUCode, " +
                                " [UserKey]= @BUHead, " +
                                " [StatusKey] = @StatusKey, " +
                                " [LastModified] = @LastModified " +
                                " WHERE [PK] = @PK";

            SqlCommand cmd = new SqlCommand(update_MRP, conn);

            cmd.Parameters.AddWithValue("@PK", PK);
            cmd.Parameters.AddWithValue("@EffectDate", effectDate.Value.ToString());
            cmd.Parameters.AddWithValue("@EntCode", entCode.Value.ToString());
            cmd.Parameters.AddWithValue("@BUCode", sbuCode.ToString());
            cmd.Parameters.AddWithValue("@BUHead", buHead.Value.ToString());
            cmd.Parameters.AddWithValue("@StatusKey", buHeadStatus.Value.ToString());
            cmd.Parameters.AddWithValue("@LastModified", sLastModified);
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();

            conn.Close();

            BindUserList();
            e.Cancel = true;
            grid.CancelEdit();
        }
    private void RecreateComments(object sender)
    {
        List <ASPxLabel> comments;

        if ((comments = (List <ASPxLabel>)Session["comments"]) != null)
        {
            CountLabel.Text = "Comments Count : " + comments.Count;
            ASPxCallbackPanel panel = (ASPxCallbackPanel)sender;
            NoCommentsLabel.Visible = false;
            foreach (ASPxLabel comment in comments)
            {
                panel.Controls.Add(comment);
            }
        }
    }
예제 #26
0
        protected void panelItemVAT_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
        {
            ASPxCallbackPanel panel   = sender as ASPxCallbackPanel;
            ASPxSpinEdit      spin    = panel.FindControl("spinItemTax") as ASPxSpinEdit;
            ItemBO            itemBO  = new ItemBO();
            ItemTax           itemTax = itemBO.GetCurrentVATOfItem(session, Guid.Parse(e.Parameter));

            if (itemTax != null)
            {
                spin.Number = (decimal)itemTax.TaxId.Percentage;
            }
            else
            {
                spin.Number = 0;
            }
        }
예제 #27
0
    protected void cbNewEmployee_Init(object sender, EventArgs e)
    {
        ASPxComboBox      comboBox      = sender as ASPxComboBox;
        ASPxCallbackPanel callbackPanel = comboBox.NamingContainer.NamingContainer.NamingContainer as ASPxCallbackPanel;
        GridViewDataItemTemplateContainer gridContainer = callbackPanel.NamingContainer as GridViewDataItemTemplateContainer;

        comboBox.Visible            = GetEditMode(callbackPanel);
        comboBox.ClientInstanceName = String.Format("cbNewEmployee_{0}", gridContainer.KeyValue);

        string employeeData = DataBinder.Eval(gridContainer.DataItem, gridContainer.Column.FieldName).ToString();

        string[] employee      = employeeData.Split(',');
        string   selectCommand = String.Format("SELECT [EmployeeID], [FirstName], [LastName] FROM [Employees] WHERE (NOT [EmployeeID] IN ({0}))", String.Join(",", employee));

        comboBox.DataSource = DataHelper.ProcessSelectCommand(selectCommand);
        comboBox.DataBind();
    }
예제 #28
0
    protected void cbpTxtMFAccountNo_Callback(object source, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
    {
        ASPxCallbackPanel cbp = (ASPxCallbackPanel)source;

        FindCustomNameOrCustomNo(e.Parameter);
        cboAccountNo.Items.Clear();
        cboAccountNo.Value = null;
        cboAccountNo.Text  = null;

        lblMFCustomerName.Text  = "";
        cboAccountNo.DataSource = Session[this.GetType().ToString() + "GridMFAccount"];
        //cboAccountNo.ValueField = "AccountID";
        //cboAccountNo.TextField = "AccountNo";
        cboAccountNo.DataBind();
        GridCustomer.DataSource = Session[this.GetType().ToString() + "GridMFAccount"];
        GridCustomer.DataBind();
        cbp.JSProperties["cpResult"] = true;
    }
예제 #29
0
        protected override object CreateControlsCore()
        {
            _table = new Table {
                CssClass    = "editablelisteditor",
                Width       = new Unit(100, UnitType.Percentage),
                CellPadding = 3,
                ID          = "EditableTabEnabledListEditor_Table"
            };
            _table.PreRender += control_PreRender;

            _callbackPanel = new ASPxCallbackPanel {
                Width = new Unit(100, UnitType.Percentage),
                ClientInstanceName = "CallbackPanel" + Model.Id
            };
            _callbackPanel.Callback += callbackPanel_Callback;
            _callbackPanel.Controls.Add(_table);
            return(_callbackPanel);
        }
예제 #30
0
    protected void cbpBottom_Init(object sender, EventArgs e)
    {
        ASPxCallbackPanel cbp = sender as ASPxCallbackPanel;

        if ((hf.Contains("all") && Convert.ToBoolean(hf.Get("all"))) ||
            (Page.IsCallback &&
             hf.Contains("cbpBottom") &&
             Convert.ToBoolean(hf.Get("cbpBottom")) &&
             Request.Params["__CALLBACKID"].Contains(cbp.ID)) ||
            (Page.IsPostBack && !Page.IsCallback &&
             hf.Contains("cbpBottom")))
        {
            Control ctrl = LoadControl("~/bottomgrid.ascx");
            ctrl.ID = "bottomgrid";
            cbp.Controls.Clear();
            cbp.Controls.Add(ctrl);
        }
    }
    protected void CallbackPanel_Callback(object sender, CallbackEventArgsBase e)
    {
        ASPxCallbackPanel callbackPanel = sender as ASPxCallbackPanel;
        string            script        = "<script id=\"dxss_myScript\" type=\"javascript\"> window.OnClick = function(s,e){ alert('Click!');} </script>";

        callbackPanel.Controls.Add(new LiteralControl {
            ID = "scriptBlock", Text = script
        });

        ASPxButton button = new ASPxButton {
            ID = "cbpButton"
        };

        callbackPanel.Controls.Add(button);
        button.AutoPostBack           = false;
        button.Text                   = "Click Me (Loaded via Callback)";
        button.ClientSideEvents.Click = "function(s,e){ OnClick(s,e);}";
    }
예제 #32
0
        protected void grdFinanceBudgetDet_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            ASPxGridView      grid          = sender as ASPxGridView;
            ASPxComboBox      entCode       = grdFinanceBudgetDet.FindEditRowCellTemplateControl((GridViewDataColumn)grdFinanceBudgetDet.Columns["EntityCodeDesc"], "Entity") as ASPxComboBox;
            ASPxCallbackPanel callBackPanel = grdFinanceBudgetDet.FindEditRowCellTemplateControl((GridViewDataColumn)grdFinanceBudgetDet.Columns["BUSSUCodeDesc"], "FinBUCallbackPanel") as ASPxCallbackPanel;
            ASPxComboBox      buCode        = callBackPanel.FindControl("BUSSU") as ASPxComboBox;
            //ASPxComboBox buCode = grdFinanceBudgetDet.FindEditRowCellTemplateControl((GridViewDataColumn)grdFinanceBudgetDet.Columns["BUSSUCodeDesc"], "BUSSU") as ASPxComboBox;

            string sLastModified = DateTime.Now.ToString();
            string PK            = e.Keys[0].ToString();

            SqlConnection conn = new SqlConnection(GlobalClass.SQLConnString());

            conn.Open();

            string update = "UPDATE tbl_System_FinanceBudget_Details " +
                            " SET [EntityCode] = @EntityCode, " +
                            " [BUSSUCode] = @BUSSUCode " +
                            " WHERE ([PK] = @PK)";

            SqlCommand cmd = new SqlCommand(update, conn);

            cmd.Parameters.AddWithValue("@PK", PK);
            cmd.Parameters.AddWithValue("@EntityCode", entCode.Value.ToString());
            cmd.Parameters.AddWithValue("@BUSSUCode", entCode.Value.ToString());
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();

            string updateMaster = "UPDATE tbl_System_FinanceBudget " +
                                  " SET [LastModified] = @LastModified " +
                                  " WHERE ([PK] = @PK)";

            SqlCommand cmd1 = new SqlCommand(updateMaster, conn);

            cmd1.Parameters.AddWithValue("@PK", iMasterKey.ToString());
            cmd1.Parameters.AddWithValue("@LastModified", sLastModified.ToString());
            cmd1.CommandType = CommandType.Text;
            cmd1.ExecuteNonQuery();

            conn.Close();
            e.Cancel = true;
            grid.CancelEdit();
            BindFinanceBudgetDet(iMasterKey);
        }
        public override void BreakLinksToControls(){
            if (_table != null)
                _table.PreRender -= control_PreRender;
            if (_callbackPanel != null)
                _callbackPanel.Callback -= callbackPanel_Callback;
            foreach (ASPxEdit item in _controls){
                var box = item as ASPxComboBox;
                if (box != null){
                    box.SelectedIndexChanged -= DetailItemControlValueChanged;
                    box.Load -= c_Load;
                }
                else{
                    var checkBox = item as ASPxCheckBox;
                    if (checkBox != null)
                        checkBox.CheckedChanged -= DetailItemControlValueChanged;
                    else{
                        var textBox = item as ASPxTextBox;
                        if (textBox != null)
                            textBox.TextChanged -= DetailItemControlValueChanged;
                        else if (item is ASPxSpinEdit)
                            item.ValueChanged -= DetailItemControlValueChanged;
                        else{
                            var edit = item as ASPxDateEdit;
                            if (edit != null)
                                edit.DateChanged -= DetailItemControlValueChanged;
                        }
                    }
                }
            }

            ClearAllCollectionsOfControls();

            _table = null;
            _callbackPanel = null;

            base.BreakLinksToControls();
        }
        public override object LayoutControls(DevExpress.ExpressApp.Model.IModelNode layoutInfo, DevExpress.ExpressApp.Layout.ViewItemsCollection detailViewItems)
        {
            IModelSplitLayout splitLayout = layoutInfo as IModelSplitLayout;
            if (splitLayout != null && detailViewItems.Count > 1)
            {
                viewItems = detailViewItems;
                DevExpress.Web.ASPxSplitter.ASPxSplitter splitter = new DevExpress.Web.ASPxSplitter.ASPxSplitter();
                splitter.ID = "MasterDetailSplitter";
                splitter.ClientIDMode = ClientIDMode.Static;
                splitter.Orientation = (splitLayout.Direction == FlowDirection.Horizontal) ? Orientation.Horizontal : Orientation.Vertical;
                var listPane = splitter.Panes.Add();
                listPane.Name = "listPane";
                Control listControl = (Control)detailViewItems[0].Control;
                listControl.ClientIDMode = ClientIDMode.Predictable;
                listPane.Controls.Add(listControl);
                splitter.ClientSideEvents.Init = "function (s,e) {s.AdjustControl(); s.GetMainElement().ClientControl = s; document.getElementById('CP').style.height='0px';AdjustSize();}";

                splitter.ShowCollapseBackwardButton = true;
                splitter.ShowCollapseForwardButton = true;

                ASPxGridView gridView = listControl as ASPxGridView;

                if (gridView != null)
                {
                    if (string.IsNullOrEmpty(gridView.ClientInstanceName))
                        gridView.ClientInstanceName = "gridViewInSplitter";
                    splitter.ClientSideEvents.PaneResized = string.Format(CultureInfo.InvariantCulture,
                        "function (s,e) {{ if (e.pane.name==='listPane') {{ {0}.SetWidth(e.pane.GetClientWidth()); {0}.SetHeight(e.pane.GetClientHeight()); }}}}",
                        gridView.ClientInstanceName);
                }

                var detailPane = splitter.Panes.Add();
                detailPane.ScrollBars = ScrollBars.Auto;
                ASPxCallbackPanel updatePanel = new ASPxCallbackPanel();
                updatePanel.ID = "DetailUpdatePanel";
                updatePanel.ClientIDMode = ClientIDMode.Static;
                updatePanel.ClientSideEvents.Init = "function (s,e) {s.GetMainElement().ClientControl = s;}";
                Control detailControl = (Control)detailViewItems[1].Control;
                detailControl.ClientIDMode = ClientIDMode.Predictable;
                updatePanel.Controls.Add(detailControl);
                detailPane.Controls.Add(updatePanel);
                return splitter;
            }
            else
                return base.LayoutControls(layoutInfo, detailViewItems);
        }
        protected override object CreateControlsCore(){
            _table = new Table{
                CssClass = "editablelisteditor",
                Width = new Unit(100, UnitType.Percentage),
                CellPadding = 3,
                ID = "EditableTabEnabledListEditor_Table"
            };
            _table.PreRender += control_PreRender;

            _callbackPanel = new ASPxCallbackPanel{
                Width = new Unit(100, UnitType.Percentage),
                ClientInstanceName = "CallbackPanel" + Model.Id
            };
            _callbackPanel.Callback += callbackPanel_Callback;
            _callbackPanel.Controls.Add(_table);
            return _callbackPanel;
        }