示例#1
0
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            if (!m_orderFormServer.GetAllOrderFormInfo(BasicInfo.ListRoles, BasicInfo.LoginID, out m_findOrderFormInfo, out m_err))
            {
                MessageDialog.ShowErrorMessage(m_err);
                return;
            }

            RefreshOrderFormDataGridView();
            RefreshOrderFormControl();
        }
示例#2
0
        /// <summary>
        /// 获取订单信息对话框
        /// </summary>
        /// <param name="billType">单据类型</param>
        /// <returns>成功则返回获取到的对话框,失败返回null</returns>
        static public FormQueryInfo GetOrderFormInfoDialog(CE_BillTypeEnum billType)
        {
            DepotManagementDataContext dataContext = CommentParameter.DepotDataContext;

            IOrderFormInfoServer orderFormInfoServer = ServerModuleFactory.GetServerModule <IOrderFormInfoServer>();
            IQueryable <View_B_OrderFormInfo> queryResult;

            if (!orderFormInfoServer.GetAllOrderFormInfo(BasicInfo.ListRoles, BasicInfo.LoginID, billType, out queryResult, out m_err))
            {
                MessageDialog.ShowErrorMessage(m_err);
                return(null);
            }

            System.Data.DataTable dataTable = GlobalObject.GeneralFunction.ConvertToDataTable <View_B_OrderFormInfo>(queryResult);
            FormQueryInfo         form      = new FormQueryInfo(dataTable);

            form.HideColumns = new string[] { "供应商联系人", "供应商联系电话", "供应商传真号", "供应商电子邮件", "权限控制用登录名", "录入人员" };
            return(form);
        }
        private void btnBenchCreate_Click(object sender, EventArgs e)
        {
            try
            {
                if (cmbBillType.Text.Trim().Length > 0)
                {
                    switch (GlobalObject.GeneralFunction.StringConvertToEnum <CE_InPutBusinessType>(cmbBillType.Text))
                    {
                    case CE_InPutBusinessType.生产采购:
                    case CE_InPutBusinessType.普通采购:
                    case CE_InPutBusinessType.委外采购:
                    case CE_InPutBusinessType.样品采购:

                        IQueryable <View_B_OrderFormInfo> findOrderFormInfo;
                        IOrderFormInfoServer orderFormServer = ServerModule.ServerModuleFactory.GetServerModule <IOrderFormInfoServer>();

                        if (!orderFormServer.GetAllOrderFormInfo(BasicInfo.ListRoles, BasicInfo.LoginID, out findOrderFormInfo, out m_strError))
                        {
                            MessageDialog.ShowErrorMessage(m_strError);
                            return;
                        }

                        DataTable          dataSource = GlobalObject.GeneralFunction.ConvertToDataTable <View_B_OrderFormInfo>(findOrderFormInfo);
                        FormDataTableCheck frm        = new FormDataTableCheck(dataSource);

                        frm._BlDateTimeControlShow = false;

                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            List <string> listTemp = DataSetHelper.ColumnsToList_Distinct(frm._DtResult, "订单号");

                            m_listViewDetail = m_serviceRequistion.GetListViewDetail_OrderForm(txtBillNo.Text, listTemp);
                            RefreshDataGridView(m_listViewDetail);
                        }

                        foreach (DataGridViewRow dgvr in customDataGridView1.Rows)
                        {
                            ((DataGridViewTextBoxShowCell)dgvr.Cells["图号型号"]).m_EndSql =
                                " and 序号 in ( select GoodsID from B_OrderFormGoods where OrderFormNumber = '"
                                + dgvr.Cells["关联业务"].Value.ToString() + "')";
                            ((DataGridViewTextBoxShowCell)dgvr.Cells["批次号"]).ReadOnly = true;
                            ((DataGridViewTextBoxShowCell)dgvr.Cells["供应商"]).ReadOnly = true;
                        }

                        break;

                    default:
                        break;
                    }

                    cmbBillType.Enabled = customDataGridView1.Rows.Count > 0 ? false : true;
                }
                else
                {
                    MessageDialog.ShowPromptMessage("请选择【业务类型】");
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageDialog.ShowPromptMessage(ex.Message);
                return;
            }
        }