Ejemplo n.º 1
0
        /// <summary>
        ///     初始化页面数据
        /// </summary>
        private void InitData()
        {
            ViewState["_AppendToEnd"] = true;

            txtCreateBy.Text = CurrentUser.AccountName;

            tbxBankCode.OnClientTriggerClick = Window1.GetSaveStateReference(tbxBankCode.ClientID)
                                               + Window1.GetShowReference("../../Common/WinBank.aspx");

            tbxFCustomer.OnClientTriggerClick = Window2.GetSaveStateReference(txtFCode.ClientID, tbxFCustomer.ClientID)
                                                + Window2.GetShowReference("../../Common/WinCustomer.aspx");

            tbxFSubjectCode.OnClientTriggerClick = Window4.GetSaveStateReference(tbxFSubjectCode.ClientID)
                                                   + Window4.GetShowReference("../../Common/WinSubject.aspx");

            //删除选中单元格的客户端脚本
            string deleteScript  = DeleteScript();
            string deleteSubject = DeleteSubject();

            //新增
            var defaultObj = new JObject
            {
                { "FItemCode", "" },
                { "FItemName", "" },
                { "FSpec", "" },
                { "FUnit", "" },
                { "FPrice", "" },
                { "FQty", "0" },
                { "FBottleQty", "0" },
                { "FBottleOweQty", "0" },
                { "FCateName", "" },
                { "colDelete", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>",//
                                             deleteScript, IconHelper.GetResolvedIconUrl(Icon.Delete)) },
            };

            //报销项目
            var subjectObj = new JObject
            {
                { "FSubjectCode", "" },
                { "FSubjectName", "" },
                { "FAmount", "" },
                { "FMemo", "" },
                { "colDeleteSubject", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>",//
                                                    deleteSubject, IconHelper.GetResolvedIconUrl(Icon.Delete)) },
            };

            // 在第一行新增一条数据
            btnAdd.OnClientClick = Grid1.GetAddNewRecordReference(defaultObj, AppendToEnd);

            btnAddSubject.OnClientClick = Grid2.GetAddNewRecordReference(subjectObj, AppendSubjectToEnd);

            txtFDate.SelectedDate = DateTime.Now;
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     初始化页面数据
        /// </summary>
        private void InitData()
        {
            ViewState["_AppendToEnd"] = true;

            txtCreateBy.Text = CurrentUser.AccountName;

            // 钢瓶
            tbxFBottle.OnClientTriggerClick = Window1.GetSaveStateReference(tbxFBottle.ClientID)
                                              + Window1.GetShowReference("../../Common/WinBottle.aspx");

            // 客户
            tbxFCustomer.OnClientTriggerClick = Window2.GetSaveStateReference(txtFCode.ClientID, tbxFCustomer.ClientID, hfdClass.ClientID)
                                                + Window2.GetShowReference("../../Common/WinUnit.aspx");

            //地址
            txtFAddress.OnClientTriggerClick = Window3.GetSaveStateReference(txtFAddress.ClientID)
                                               + Window3.GetShowReference("../../Common/WinCustomerLink.aspx");

            //发货单号
            tbxFSalesNum.OnClientTriggerClick = Window4.GetSaveStateReference(tbxFSalesNum.ClientID)
                                                + Window4.GetShowReference("../../Common/WinSalesList.aspx");

            GasHelper.DropDownListDriverDataBind(ddlFDriver);

            GasHelper.DropDownListShipperDataBind(ddlFShipper);

            GasHelper.DropDownListSupercargoDataBind(ddlFSupercargo);

            GasHelper.DropDownListVehicleNumDataBind(ddlFVehicleNum);

            GasHelper.DropDownListAreasDataBind(ddlFArea);

            GasHelper.DropDownListSalesmanDataBind(ddlFSalesman);

            GasHelper.DropDownListDeliveryMethodDataBind(ddlDeliveryMethod);

            GasHelper.DropDownListBankSubjectDataBind(ddlSubject);

            //删除选中单元格的客户端脚本
            string deleteScript = DeleteScript();

            //新增
            var defaultObj = new JObject
            {
                { "FItemCode", "" },
                { "FItemName", "" },
                { "FSpec", "" },
                { "FUnit", "" },
                { "FPrice", "" },
                //{"FQty", "0"},
                { "FBottleQty", "0" },
                { "FAmount", "0" },
                //{"FBottleOweQty", "0"},
                { "FCateName", "" },
                { "colDelete", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>",//
                                             deleteScript, IconHelper.GetResolvedIconUrl(Icon.Delete)) },
            };

            // 在第一行新增一条数据
            btnAdd.OnClientClick = Grid1.GetAddNewRecordReference(defaultObj, AppendToEnd);

            //btnClose.OnClientClick = ActiveWindow.GetHidePostBackReference();

            txtFDate.SelectedDate = DateTime.Now;
        }