Example #1
0
        /// <summary>
        /// 编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btnEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var detail = gvReturn.GetFocusedRow() as CarriageReturn;

            if (detail == null)
            {
                return;
            }
            FormEditCarriageReturn form = new FormEditCarriageReturn();

            form.curData   = detail;
            form.FormState = DS.MSClient.FormState.Modify;
            if (form.ShowDialog(this) == DialogResult.OK)
            {
                btnSearch.PerformClick();
            }
        }
Example #2
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btnAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FormSelectDispath form = new FormSelectDispath();

            form.state       = 3;
            form.ShowUpdate += form_ShowUpdate;
            if (form.ShowDialog(this) == DialogResult.OK)
            {
                FormEditCarriageReturn formout = new FormEditCarriageReturn();
                formout.FormState = DS.MSClient.FormState.New;
                formout.curData   = new CarriageReturn()
                {
                    DispatchID = selectModel.DispatchID,
                    CarID      = selectModel.CarID
                };
                if (formout.ShowDialog(this) == DialogResult.OK)
                {
                    btnSearch.PerformClick();
                }
            }
        }