void SetFormBusinessInfo(DataGridView dgvr, CE_OperatorMode operatorMode,
                                 CE_BillTypeEnum billType, string keyName, ref FormCommonProcess frm)
        {
            List <object> resultList = new List <object>();

            foreach (DataGridViewRow dr in dgvr.Rows)
            {
                Entity_BusinessOperationInfo info = new Entity_BusinessOperationInfo();

                info.BillType     = billType;
                info.BusinessNo   = dr.Cells[keyName].Value.ToString();
                info.OperatorMode = operatorMode;

                info.FlowInfoList = null;
                info.FlowMagicDic = null;

                if (dgvr.CurrentRow == dr)
                {
                    frm.BusinessList_Object = info;
                }

                resultList.Add(info);
            }

            frm.BusinessList = resultList;
        }
 public CustomMainForm(Type detailForm, CE_BillTypeEnum billType, IFlowBusinessService businessService)
 {
     InitializeComponent();
     _Type_DetailForm = detailForm;
     _Enum_BillType   = billType;
     _BusinessService = businessService;
 }
        public static void BusinessDataSelect(CE_BillTypeEnum billType)
        {
            try
            {
                string error = "";
                ServerModule.IReport reportService = ServerModule.ServerModuleFactory.GetServerModule <ServerModule.IReport>();

                List <BASE_IntegrationReport> listReport = reportService.GetBusinessSelect(billType);

                if (listReport != null && listReport.Count > 0)
                {
                    FormDataComboBox frmCombox = new FormDataComboBox((from a in listReport select a.ReportName).ToList(),
                                                                      billType.ToString() + "报表查询");

                    if (frmCombox.ShowDialog() == DialogResult.OK)
                    {
                        string    reportCode = (from a in listReport where a.ReportName == frmCombox.Result select a.ReportCode).Single().ToString();
                        DataTable dtSoucre   = reportService.QueryInfo(reportCode, null, out error);

                        FormConditionDataTableFind frmShow = new FormConditionDataTableFind(dtSoucre);
                        frmShow.ShowDialog();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageDialog.ShowPromptMessage(ex.Message);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获得所有单据信息
        /// </summary>
        /// <param name="billTypeEnum">单据类型</param>
        /// <returns>返回Table</returns>
        public DataTable GetAllBill(CE_BillTypeEnum billTypeEnum)
        {
            string strSql = "select * from View_FM_InstitutionProcess where 流程类型名称 = '" + billTypeEnum.ToString()
                            + "' and " + QueryResultFilter;

            return(GlobalObject.DatabaseServer.QueryInfo(strSql));
        }
Exemplo n.º 5
0
        public List <BASE_IntegrationReport> GetBusinessSelect(CE_BillTypeEnum billType)
        {
            string error = "";
            List <BASE_IntegrationReport> listReport = new List <BASE_IntegrationReport>();

            Hashtable hsTable = new Hashtable();

            hsTable.Add("@BusineesName", billType.ToString());

            DataTable dtTemp = GlobalObject.DatabaseServer.QueryInfoPro("BASE_IntegrationReport_GetBusinessSelect", hsTable, out error);

            if (dtTemp != null || dtTemp.Rows.Count > 0 || dtTemp.Rows[0][0].ToString().Trim().Length > 0)
            {
                foreach (DataRow dr in dtTemp.Rows)
                {
                    BASE_IntegrationReport report = new BASE_IntegrationReport();

                    report.FindType      = dr["FindType"].ToString();
                    report.PrintName     = dr["PrintName"].ToString();
                    report.ProcedureName = dr["ProcedureName"].ToString();
                    report.ReportCode    = dr["ReportCode"].ToString();
                    report.ReportName    = dr["ReportName"].ToString();

                    listReport.Add(report);
                }
            }

            return(listReport);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="billType">单据类型</param>
        /// <param name="billServer">单据服务接口</param>
        public BillNumberControl(string billType, IBasicBillServer billServer)
        {
            Debug.Assert(!GlobalObject.GeneralFunction.IsNullOrEmpty(billType));
            Debug.Assert(billServer != null);

            m_billType   = (CE_BillTypeEnum)Enum.Parse(typeof(CE_BillTypeEnum), billType);
            m_billServer = billServer;
        }
        ///// <summary>
        ///// 获取指定用户计划价格表中的物品信息对话框,用户编码为null时获取所有信息
        ///// </summary>
        ///// <param name="userCode">用户编码</param>
        ///// <returns>成功则返回获取到的对话框,失败返回null</returns>
        //static public FormQueryInfo GetPlanCostGoodsDialog(string userCode)
        //{
        //    return GetPlanCostGoodsDialog(userCode, null);
        //}

        ///// <summary>
        ///// 获取指定用户计划价格表中的物品信息,用户编码为null时获取所有信息
        ///// </summary>
        ///// <param name="userCode">用户编码</param>
        ///// <param name="lstDepotCode">仓库类别列表</param>
        ///// <returns>成功则返回获取到的对话框,失败返回null</returns>
        //static private IQueryable<View_F_GoodsPlanCost> GetPlanCostGoods(string userCode, List<string> lstDepotCode)
        //{
        //    IBasicGoodsServer goodsServer = ServerModuleFactory.GetServerModule<IBasicGoodsServer>();
        //    IQueryable<View_F_GoodsPlanCost> queryResult = goodsServer.GetGoodsInfo(userCode, lstDepotCode);
        //    return queryResult;
        //}

        ///// <summary>
        ///// 获取指定用户计划价格表中的物品信息对话框,用户编码为null时获取所有信息
        ///// </summary>
        ///// <param name="userCode">用户编码</param>
        ///// <param name="lstDepotCode">仓库类别列表</param>
        ///// <returns>成功则返回获取到的对话框,失败返回null</returns>
        //static public FormQueryInfo GetPlanCostGoodsDialog(string userCode, List<string> lstDepotCode)
        //{
        //    IQueryable<View_F_GoodsPlanCost> queryResult = GetPlanCostGoods(userCode, lstDepotCode);

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

        //    form.ShowColumns = new string[] { "图号型号", "物品名称", "规格", "单位", "物品类别", "物品类别名称" };
        //    return form;
        //}

        /// <summary>
        /// 获取单据信息对话框
        /// 登录名如果为null获取所有单据,否则获取指定用户单据
        /// </summary>
        /// <param name="loginID">工号,如果为null则可获取所有单据</param>
        /// <param name="billType">单据类型</param>
        /// <returns>成功则返回获取到的对话框,失败返回null</returns>
        static public FormQueryInfo GetMaterialRequisitionBillDialog(string loginID, CE_BillTypeEnum billType)
        {
            DepotManagementDataContext ctx = CommentParameter.DepotDataContext;
            DataTable dt = new DataTable();

            string name = UniversalFunction.GetPersonnelName(loginID);

            if (billType == CE_BillTypeEnum.领料单)
            {
                // 剔除了已经导入多批次信息表中的领料单
                IQueryable <View_ZPX_MultiBatchPart_LLD> result = null;

                if (!GlobalObject.GeneralFunction.IsNullOrEmpty(loginID))
                {
                    result = from r in ctx.View_ZPX_MultiBatchPart_LLD
                             where (r.编制人 == name || r.部门主管签名 == name) &&
                             r.单据状态 == MaterialRequisitionBillStatus.已出库.ToString()
                             select r;
                }
                else
                {
                    result = from r in ctx.View_ZPX_MultiBatchPart_LLD
                             where r.单据状态 == MaterialRequisitionBillStatus.已出库.ToString()
                             select r;
                }

                dt = GlobalObject.GeneralFunction.ConvertToDataTable <View_ZPX_MultiBatchPart_LLD>(result);
            }
            else if (billType == CE_BillTypeEnum.领料退库单)
            {
                // 剔除了已经导入多批次信息表中的领料单
                IQueryable <View_ZPX_MultiBatchPart_LTD> result = null;

                if (!GlobalObject.GeneralFunction.IsNullOrEmpty(loginID))
                {
                    result = from r in ctx.View_ZPX_MultiBatchPart_LTD
                             where (r.申请人 == name || r.部门主管签名 == name) &&
                             r.单据状态 == MaterialReturnedInTheDepotBillStatus.已完成.ToString()
                             select r;
                }
                else
                {
                    result = from r in ctx.View_ZPX_MultiBatchPart_LTD
                             where r.单据状态 == MaterialReturnedInTheDepotBillStatus.已完成.ToString()
                             select r;
                }

                dt = GlobalObject.GeneralFunction.ConvertToDataTable <View_ZPX_MultiBatchPart_LTD>(result);
            }
            else
            {
                throw new Exception("单据类型不正确");
            }

            FormQueryInfo form = new FormQueryInfo(dt);

            return(form);
        }
Exemplo n.º 8
0
 public 回退单据(CE_BillTypeEnum billType, string billNo, string billStatus)
 {
     InitializeComponent();
     lbDJZT.Text = billStatus;
     m_enumType  = billType;
     txtDJH.Text = billNo;
     m_strBillID = billNo;
     GetBillType();
 }
Exemplo n.º 9
0
        public 回退单据(CE_BillTypeEnum billType, string billNo, string billStatus, List <Flow_FlowInfo> listFlowInfo)
        {
            InitializeComponent();
            lbDJZT.Text = billStatus;
            m_enumType  = billType;
            txtDJH.Text = billNo;
            m_strBillID = billNo;

            cmbDJZT.DataSource = listFlowInfo;

            cmbDJZT.DisplayMember = "BusinessStatus";
            cmbDJZT.ValueMember   = "FlowID";

            cmbDJZT.SelectedIndex = -1;
        }
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="billType">单据类型</param>
        /// <param name="billNo">单据号</param>
        /// <param name="loadPanel">界面对象</param>
        /// <param name="flowInfo">流程信息,仅对自定义</param>
        /// <param name="flowMagic">流程逻辑,仅对自定义</param>
        /// <param name="operationMode">操作类型</param>
        public FormCommonProcess(CE_BillTypeEnum billType, string version, CustomFlowForm form, CE_OperatorMode operationMode)
        {
            InitializeComponent();

            m_customForm          = form;
            m_billType            = billType;
            m_operationMode       = operationMode;
            m_FlowBusinessVersion = version;

            m_customForm.FormBorderStyle = FormBorderStyle.None;
            m_customForm.TopLevel        = false;
            m_customForm.Show();

            m_customForm.Parent     = panel6;
            m_customForm.Dock       = DockStyle.Fill;
            m_customForm.AutoScroll = true;
        }
Exemplo n.º 11
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);
        }
        public override void LoadFormInfo()
        {
            if (BusinessList_Object != null)
            {
                if (BusinessList_Object.GetType() == typeof(Entity_BusinessOperationInfo))
                {
                    Entity_BusinessOperationInfo businessInfo = BusinessList_Object as Entity_BusinessOperationInfo;

                    m_customForm.FlowInfo_BillNo  = businessInfo.BusinessNo;
                    m_customForm.Custom_FlowInfo  = businessInfo.FlowInfoList;
                    m_customForm.Custom_FlowMagic = businessInfo.FlowMagicDic;

                    m_billType      = businessInfo.BillType;
                    m_operationMode = businessInfo.OperatorMode;
                }
            }

            m_flowInfo  = m_customForm.Custom_FlowInfo;
            m_flowMagic = m_customForm.Custom_FlowMagic;

            labelTitle.Text = m_customForm.Text;
            this.Text       = m_customForm.Text;

            if (m_operationMode != CE_OperatorMode.查看)
            {
                bool visible = PanelVisible(m_customForm.FlowInfo_BillNo);

                panel1.Visible = visible;
                panel3.Visible = visible;
            }
            else
            {
                panel1.Visible = false;
                panel3.Visible = false;
            }

            base.LoadFormInfo();
            m_customForm.LoadFormInfo();
        }
Exemplo n.º 13
0
        /// <summary>
        /// 更新流程
        /// </summary>
        /// <param name="billNo">单据号</param>
        /// <param name="advise">意见</param>
        /// <param name="error">错误信息</param>
        /// <returns>成功返回True,失败返回False</returns>
        public bool UpdateInfo(string billNo, string advise, out string error)
        {
            error = null;

            IBillMessagePromulgatorServer serverBill            = BasicServerFactory.GetServerModule <IBillMessagePromulgatorServer>();
            ISystemFileBasicInfo          m_serverFileBasicInfo = Service_Quality_File.ServerModuleFactory.GetServerModule <ISystemFileBasicInfo>();
            FileServiceSocket             m_serverFTP           = new FileServiceSocket(GlobalObject.GlobalParameter.FTPServerIP,
                                                                                        GlobalObject.GlobalParameter.FTPServerAdvancedUser,
                                                                                        GlobalObject.GlobalParameter.FTPServerAdvancedPassword);

            DepotManagementDataContext ctx = CommentParameter.DepotDataContext;

            try
            {
                var varData = from a in ctx.FM_InstitutionProcess
                              where a.BillNo == billNo
                              select a;

                FM_InstitutionProcess lnqProcess = varData.Single();

                serverBill.BillType = serverBill.GetBillTypeEnum(lnqProcess.TypeCode).ToString();
                CE_BillTypeEnum       billType   = GlobalObject.GeneralFunction.StringConvertToEnum <CE_BillTypeEnum>(serverBill.BillType);
                InstitutionBillStatus billStatus = GlobalObject.GeneralFunction.StringConvertToEnum <InstitutionBillStatus>(lnqProcess.BillStatus);

                var varList = from a in ctx.FM_InstitutionProcessPointDept
                              where a.BillNo == billNo
                              select a;

                FM_InstitutionProcessPointDept        lnqPoint = new FM_InstitutionProcessPointDept();
                List <FM_InstitutionProcessPointDept> list     = varList.ToList();
                List <string> listTemp = new List <string>();

                switch (billStatus)
                {
                case InstitutionBillStatus.新建流程:
                    break;

                case InstitutionBillStatus.等待科长审查:

                    lnqProcess.BillStatus  = InstitutionBillStatus.等待负责人审查.ToString();
                    lnqProcess.Chief       = BasicInfo.LoginName;
                    lnqProcess.ChiefAdvise = advise;
                    lnqProcess.ChiefTime   = ServerTime.Time;

                    serverBill.PassFlowMessage(lnqProcess.BillNo, string.Format("【文件编号】:{0} 【文件名】:{1} ※※※ 等待处理", lnqProcess.FileNo, lnqProcess.FileName),
                                               BillFlowMessage_ReceivedUserType.角色, serverBill.GetDeptPrincipalRoleName(UniversalFunction.GetPersonnelInfo(lnqProcess.Propoer).部门编码).ToList());
                    break;

                case InstitutionBillStatus.等待负责人审查:

                    lnqProcess.BillStatus           = InstitutionBillStatus.等待相关负责人审查.ToString();
                    lnqProcess.DepartmentHead       = BasicInfo.LoginName;
                    lnqProcess.DepartmentHeadAdvise = advise;
                    lnqProcess.DepartmentHeadTime   = ServerTime.Time;

                    if (billType == CE_BillTypeEnum.制度销毁申请流程)
                    {
                        lnqProcess.BillStatus = InstitutionBillStatus.等待分管领导审查.ToString();

                        serverBill.PassFlowMessage(lnqProcess.BillNo, string.Format("【文件编号】:{0} 【文件名】:{1} ※※※ 等待处理", lnqProcess.FileNo, lnqProcess.FileName),
                                                   BillFlowMessage_ReceivedUserType.角色, serverBill.GetDeptLeaderRoleName(UniversalFunction.GetPersonnelInfo(lnqProcess.Propoer).部门编码).ToList());
                    }
                    else
                    {
                        listTemp = (from a in list
                                    where a.PersonnelType == RoleStyle.负责人.ToString()
                                    select a.Personnel).ToList();

                        serverBill.PassFlowMessage(lnqProcess.BillNo, string.Format("【文件编号】:{0} 【文件名】:{1} ※※※ 等待处理", lnqProcess.FileNo, lnqProcess.FileName),
                                                   BillFlowMessage_ReceivedUserType.用户, listTemp);
                    }

                    break;

                case InstitutionBillStatus.等待相关负责人审查:

                    lnqPoint = (from a in list
                                where a.Personnel == BasicInfo.LoginID &&
                                a.PersonnelType == RoleStyle.负责人.ToString()
                                select a).Single();

                    lnqPoint.PersonnelTime = ServerTime.Time;
                    lnqPoint.Advise        = advise;

                    var varHead = from a in list
                                  where a.PersonnelType == RoleStyle.负责人.ToString() &&
                                  a.PersonnelTime == null
                                  select a;

                    if (varHead.Count() == 0)
                    {
                        if (IsThreeTripFile(lnqProcess.SortID))
                        {
                            lnqProcess.BillStatus = InstitutionBillStatus.等待分管领导审查.ToString();

                            serverBill.PassFlowMessage(lnqProcess.BillNo, string.Format("【文件编号】:{0} 【文件名】:{1} ※※※ 等待处理", lnqProcess.FileNo, lnqProcess.FileName),
                                                       BillFlowMessage_ReceivedUserType.角色, serverBill.GetDeptLeaderRoleName(UniversalFunction.GetPersonnelInfo(lnqProcess.Propoer).部门编码).ToList());
                        }
                        else
                        {
                            lnqProcess.BillStatus = InstitutionBillStatus.等待相关分管领导审查.ToString();

                            listTemp = (from a in list
                                        where a.PersonnelType == RoleStyle.分管领导.ToString()
                                        select a.Personnel).ToList();

                            serverBill.PassFlowMessage(lnqProcess.BillNo, string.Format("【文件编号】:{0} 【文件名】:{1} ※※※ 等待处理", lnqProcess.FileNo, lnqProcess.FileName),
                                                       BillFlowMessage_ReceivedUserType.用户, listTemp);
                        }
                    }
                    else
                    {
                        listTemp = (from a in varHead
                                    select a.Personnel).ToList();

                        serverBill.PassFlowMessage(lnqProcess.BillNo, string.Format("【文件编号】:{0} 【文件名】:{1} ※※※ 等待处理", lnqProcess.FileNo, lnqProcess.FileName),
                                                   BillFlowMessage_ReceivedUserType.用户, listTemp);
                    }

                    break;

                case InstitutionBillStatus.等待相关分管领导审查:
                    lnqPoint = (from a in list
                                where a.Personnel == BasicInfo.LoginID &&
                                a.PersonnelType == RoleStyle.分管领导.ToString()
                                select a).Single();

                    lnqPoint.PersonnelTime = ServerTime.Time;
                    lnqPoint.Advise        = advise;

                    var varLead = from a in list
                                  where a.PersonnelType == RoleStyle.分管领导.ToString() &&
                                  a.PersonnelTime == null
                                  select a;

                    if (varLead.Count() == 0)
                    {
                        lnqProcess.BillStatus = InstitutionBillStatus.等待总经理审查.ToString();

                        serverBill.PassFlowMessage(lnqProcess.BillNo, string.Format("【文件编号】:{0} 【文件名】:{1} ※※※ 等待处理", lnqProcess.FileNo, lnqProcess.FileName),
                                                   BillFlowMessage_ReceivedUserType.角色, CE_RoleEnum.总经理.ToString());
                    }
                    else
                    {
                        listTemp = (from a in varLead
                                    select a.Personnel).ToList();

                        serverBill.PassFlowMessage(lnqProcess.BillNo, string.Format("【文件编号】:{0} 【文件名】:{1} ※※※ 等待处理", lnqProcess.FileNo, lnqProcess.FileName),
                                                   BillFlowMessage_ReceivedUserType.用户, listTemp);
                    }

                    break;

                case InstitutionBillStatus.等待分管领导审查:
                case InstitutionBillStatus.等待总经理审查:

                    lnqProcess.BillStatus           = InstitutionBillStatus.流程已结束.ToString();
                    lnqProcess.GeneralManager       = BasicInfo.LoginName;
                    lnqProcess.GeneralManagerAdvise = advise;
                    lnqProcess.GeneralManagerTime   = ServerTime.Time;

                    FM_FileList fileInfo = new FM_FileList();

                    if (lnqProcess.FileID != null)
                    {
                        var varFileInfo = from a in ctx.FM_FileList
                                          where a.FileID == lnqProcess.FileID
                                          select a;

                        if (varFileInfo.Count() == 1)
                        {
                            fileInfo = varFileInfo.Single();
                        }
                    }

                    if (billType == CE_BillTypeEnum.制度发布流程)
                    {
                        string strVersion = "1.0";

                        if (lnqProcess.ReplaceFileID == null)
                        {
                            DataTable dtTemp = m_serverFileBasicInfo.GetFilesInfo(lnqProcess.FileNo, null);
                        }
                        else
                        {
                            m_serverFileBasicInfo.OperatorFTPSystemFile(ctx, Convert.ToInt32(lnqProcess.ReplaceFileID), 29);
                            strVersion =
                                (Convert.ToDouble(m_serverFileBasicInfo.GetFile(Convert.ToInt32(lnqProcess.ReplaceFileID)).Version) + 0.1).ToString();
                        }

                        FM_FileList lnqFile = new FM_FileList();

                        lnqFile.Department = lnqProcess.Department;
                        lnqFile.FileName   = lnqProcess.FileName;
                        lnqFile.FileNo     = lnqProcess.FileNo;
                        lnqFile.FileUnique = lnqProcess.FileUnique;
                        lnqFile.SortID     = lnqProcess.SortID;
                        lnqFile.Version    = strVersion;

                        ctx.FM_FileList.InsertOnSubmit(lnqFile);

                        if (m_serverFTP.Errormessage.Length != 0)
                        {
                            throw new Exception(m_serverFTP.Errormessage);
                        }
                    }
                    else if (billType == CE_BillTypeEnum.制度修订废弃申请流程 && lnqProcess.OperationMode == "废弃")
                    {
                        if (fileInfo != null)
                        {
                            fileInfo.SortID = 29;
                        }
                    }
                    else if (billType == CE_BillTypeEnum.制度销毁申请流程)
                    {
                        ctx.FM_FileList.DeleteOnSubmit(fileInfo);
                    }

                    serverBill.EndFlowMessage(lnqProcess.BillNo,
                                              string.Format("{0}号文件审查流程已结束", lnqProcess.BillNo), null,
                                              (from a in varList select a.Personnel).ToList());

                    break;

                case InstitutionBillStatus.流程已结束:
                    break;

                default:
                    break;
                }

                ctx.SubmitChanges();

                return(true);
            }
            catch (Exception ex)
            {
                error = ex.Message;
                return(false);
            }
        }
        public static void BusinessDataSelect(CE_BillTypeEnum billType, string keyName,
                                              GlobalObject.DelegateCollection.ShowDataGirdViewInfo formShow)
        {
            try
            {
                string error = "";
                _FormShow = formShow;
                ServerModule.IReport          reportService = ServerModule.ServerModuleFactory.GetServerModule <ServerModule.IReport>();
                List <BASE_IntegrationReport> listReport    = reportService.GetBusinessSelect(billType);

                if (listReport != null && listReport.Count > 0)
                {
                    FormDataComboBox frmCombox = new FormDataComboBox((from a in listReport select a.ReportName).ToList(),
                                                                      billType.ToString() + "报表查询");

                    if (frmCombox.ShowDialog() == DialogResult.OK)
                    {
                        string reportCode = (from a in listReport
                                             where a.ReportName == frmCombox.Result
                                             select a.ReportCode).Single().ToString();

                        List <BASE_IntegrationReportList> list = reportService.GetIntegrationReportList(reportCode);
                        DataTable listInfo = null;

                        if (list != null && list.Count() > 0)
                        {
                            FormValueSet frm = new FormValueSet(list);

                            if (frm.ShowDialog() != DialogResult.OK)
                            {
                                return;
                            }

                            listInfo = new DataTable();

                            listInfo.Columns.Add("参数类型");
                            listInfo.Columns.Add("查询内容");
                            listInfo.Columns.Add("参数名");

                            for (int i = 0; i < frm.Result.Count(); i++)
                            {
                                DataRow dr = listInfo.NewRow();

                                dr["参数名"]  = list[i].ParameterName;
                                dr["参数类型"] = frm.Result[i].ParameterType;
                                dr["查询内容"] = frm.Result[i].ReportCode;

                                listInfo.Rows.Add(dr);
                            }
                        }

                        DataTable dtSoucre = reportService.QueryInfo(reportCode, listInfo, out error);

                        FormConditionDataTableFind frmShow = new FormConditionDataTableFind(dtSoucre, keyName);
                        frmShow.FormShow += new DelegateCollection.ShowDataGirdViewInfo(frmShow_FormShow);
                        frmShow.ShowDialog();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageDialog.ShowPromptMessage(ex.Message);
            }
        }
Exemplo n.º 15
0
 /// <summary>
 /// 获取库存中的物品信息对话框
 /// </summary>
 /// <param name="billType">单据类型</param>
 /// <returns>成功则返回获取到的对话框,失败返回null</returns>
 static public FormQueryInfo GetStoreGoodsInfoDialog(CE_BillTypeEnum billType, string strStorageID)
 {
     return(GetStoreGoodsInfoDialog(billType, false, strStorageID));
 }
Exemplo n.º 16
0
        /// <summary>
        /// 获取库存中的物品信息对话框
        /// </summary>
        /// <param name="billType">单据类型</param>
        /// <param name="showZeroStoreGoods">是否显示零库存物品</param>
        /// <returns>成功则返回获取到的对话框,失败返回null</returns>
        static public FormQueryInfo GetStoreGoodsInfoDialog(CE_BillTypeEnum billType, bool showZeroStoreGoods, string strStorageID)
        {
            IStoreServer server = ServerModuleFactory.GetServerModule <IStoreServer>();
            IQueryable <View_S_Stock> queryResult;

            System.Data.DataTable dataTable = null;

            if (!server.GetAllStore(null, true, out queryResult, out m_err))
            {
                MessageDialog.ShowErrorMessage(m_err);
                return(null);
            }

            // 仅显示状态为正常且不在隔离库中的物品
            if (billType == CE_BillTypeEnum.领料单)
            {
                List <string> listTempStockStatus = new List <string>();
                listTempStockStatus.Add("正常");

                foreach (int statusID in _lstStockStatus)
                {
                    switch (statusID)
                    {
                    case 1:
                        listTempStockStatus.Add("仅限于返修箱用");
                        break;

                    case 2:
                        listTempStockStatus.Add("样品");
                        break;

                    case 3:
                        listTempStockStatus.Add("仅限于返修箱用");
                        listTempStockStatus.Add("仅限于售后备件");
                        break;

                    case 4:
                        listTempStockStatus.Add("隔离");
                        break;

                    default:
                        break;
                    }
                }

                queryResult = from r in queryResult
                              where listTempStockStatus.Contains(r.物品状态) &&
                              r.库房代码 == strStorageID
                              select r;
            }
            else if (billType == CE_BillTypeEnum.领料退库单)
            {
                queryResult = from r in queryResult
                              where r.物品状态 != "隔离"
                              select r;
            }

            ////TCU 采购部领用委外装配 Modify by cjb on 2014.5.28
            //if (!GlobalObject.GeneralFunction.IsNullOrEmpty(prefixDepotType) && strStorageID != "03")
            //{
            //    int len = prefixDepotType.Length;
            //    queryResult = from r in queryResult where r.材料类别编码.Substring(0, len) == prefixDepotType select r;
            //}

            if (!showZeroStoreGoods)
            {
                queryResult = from r in queryResult where r.库存数量 > 0 select r;
            }

            FormQueryInfo form = null;

            if (!BasicInfo.ListRoles.Exists(r => r.Contains("库管理员")))
            {
                if (billType == CE_BillTypeEnum.领料单 && !_lstStockStatus.Contains(2) && !_lstStockStatus.Contains(4))
                {
                    var result = (from r in queryResult select r).ToList().Distinct(new StockGoodsComparer());
                    dataTable = GlobalObject.GeneralFunction.ConvertToDataTable <View_S_Stock>(result);
                }
                else
                {
                    dataTable = GlobalObject.GeneralFunction.ConvertToDataTable <View_S_Stock>(queryResult);
                }
            }
            else
            {
                dataTable = GlobalObject.GeneralFunction.ConvertToDataTable <View_S_Stock>(queryResult);
            }

            form = new FormQueryInfo(dataTable);

            if (!showZeroStoreGoods)
            {
                form.Text = form.Text + ",库存数量为0的物品不会显示在列表中。";
            }

            if (!BasicInfo.ListRoles.Exists(r => r.Contains("库管理员")))
            {
                if (billType == CE_BillTypeEnum.报废单 || billType == CE_BillTypeEnum.领料退库单)
                {
                    form.HideColumns = new string[] { "序号", "物品ID", "单位", "单位ID", "库存数量", "仓库", "货架", "层", "列", "实际单价", "实际金额" }
                }
                ;
                else if (billType == CE_BillTypeEnum.领料单)
                {
                    form.HideColumns = new string[] { "序号", "物品ID", "单位", "实际单价", "实际金额" }
                }
                ;
            }
            else
            {
                form.HideColumns = new string[] { "序号", "物品ID", "单位ID", "单位", "实际单价", "实际金额" };
            }

            return(form);
        }
Exemplo n.º 17
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="billType">单据类型</param>
        /// <param name="billServer">单据服务接口</param>
        public BillNumberControl(string billType)
        {
            Debug.Assert(!GlobalObject.GeneralFunction.IsNullOrEmpty(billType));

            m_billType = (CE_BillTypeEnum)Enum.Parse(typeof(CE_BillTypeEnum), billType);
        }
Exemplo n.º 18
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="billType">单据类型</param>
 /// <param name="billServer">单据服务接口</param>
 public BillNumberControl(CE_BillTypeEnum billType, IBasicBillServer billServer)
 {
     Debug.Assert(billServer != null);
     m_billType   = billType;
     m_billServer = billServer;
 }
Exemplo n.º 19
0
        /// <summary>
        /// 获取订单信息
        /// </summary>
        /// <param name="listRole">角色列表</param>
        /// <param name="loginName">登录名</param>
        /// <param name="billType">单据类型</param>
        /// <param name="returnOrderFormInfo">返回查询到的订单信息</param>
        /// <param name="error">出错时返回错误信息,无错时返回null</param>
        /// <returns>操作是否成功的标志</returns>
        public bool GetAllOrderFormInfo(List <string> listRole, string loginName, CE_BillTypeEnum billType, out IQueryable <View_B_OrderFormInfo> returnOrderFormInfo,
                                        out string error)
        {
            returnOrderFormInfo = null;
            error = null;

            DepotManagementDataContext dataContxt = CommentParameter.DepotDataContext;

            try
            {
                var orderFormInfo = from a in dataContxt.View_B_OrderFormInfo
                                    select a;

                if (listRole.Contains(CE_RoleEnum.采购账务管理员.ToString()) ||
                    listRole.Contains(CE_RoleEnum.采购主管.ToString()))
                {
                    returnOrderFormInfo = from c in orderFormInfo orderby c.订货日期 descending select c;
                    return(true);
                }

                switch (billType)
                {
                case CE_BillTypeEnum.样品确认申请单:
                    orderFormInfo = (from a in orderFormInfo
                                     join b in dataContxt.ProviderPrincipal on a.供货单位 equals b.Provider
                                     where b.PrincipalWorkId == loginName
                                     select a).Distinct();
                    break;

                case CE_BillTypeEnum.报检入库单:

                    orderFormInfo = (from a in orderFormInfo
                                     join b in dataContxt.ProviderPrincipal on a.供货单位 equals b.Provider
                                     where b.PrincipalWorkId == loginName
                                     select a).Distinct();

                    break;

                case CE_BillTypeEnum.委外报检入库单:

                    orderFormInfo = (from a in orderFormInfo
                                     join b in dataContxt.ProviderPrincipal on a.供货单位 equals b.Provider
                                     where b.PrincipalWorkId == loginName
                                     select a).Distinct();
                    break;

                case CE_BillTypeEnum.普通入库单:
                    break;

                default:
                    break;
                }

                returnOrderFormInfo = orderFormInfo
                                      .OrderByDescending(k => k.订货日期)
                                      .ThenByDescending(k => k.订单号).AsQueryable <View_B_OrderFormInfo>();
                return(true);
            }
            catch (Exception exce)
            {
                error = exce.Message;
                return(false);
            }
        }