Esempio n. 1
0
        /// <summary>
        /// 工具账务操作
        /// </summary>
        /// <param name="ctx">数据上下文</param>
        /// <param name="billNo">单据号</param>
        /// <param name="goodsID">物品ID</param>
        /// <param name="provider">供应商</param>
        /// <param name="operationCount">操作数量</param>
        /// <param name="workID">操作人员ID</param>
        void ToolsOperation(DepotManagementDataContext ctx, string billNo, int goodsID, string provider,
                            decimal operationCount, string workID)
        {
            IToolsManage serverTools = ServerModule.ServerModuleFactory.GetServerModule <IToolsManage>();

            if (serverTools.IsTools(goodsID))
            {
                Service_Manufacture_WorkShop.IWorkShopBasic serverWSBasic =
                    Service_Manufacture_WorkShop.ServerModuleFactory.GetServerModule <Service_Manufacture_WorkShop.IWorkShopBasic>();
                IPersonnelInfoServer serverPersonnel = ServerModuleFactory.GetServerModule <IPersonnelInfoServer>();

                View_HR_Personnel viewPersonnel = serverPersonnel.GetPersonnelInfo(workID);
                WS_WorkShopCode   tempWSCode    = serverWSBasic.GetPersonnelWorkShop(workID);

                S_MachineAccount_Tools toolsInfo = new S_MachineAccount_Tools();

                toolsInfo.GoodsID    = goodsID;
                toolsInfo.Provider   = provider;
                toolsInfo.StockCount = -operationCount;

                if (tempWSCode != null)
                {
                    toolsInfo.StorageCode = tempWSCode.WSCode;
                }
                else
                {
                    toolsInfo.StorageCode = viewPersonnel.部门编码;
                }

                serverTools.OpertionInfo(ctx, toolsInfo);
                serverTools.DayToDayAccount(ctx, toolsInfo, billNo);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 界面初始化
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void 营销出库明细单_Load(object sender, EventArgs e)
        {
            DataTable dt = m_findSellIn.GetBill(m_strDJH, m_intDJID);

            m_drZdCK = dt.NewRow();

            if (m_intDJID != 0)
            {
                m_strDJZTFlag = dt.Rows[0]["DJZT_Flag"].ToString();

                View_HR_Personnel lnqPersonnel = m_findPersonnel.GetPersonnelInfo(dt.Rows[0]["LRRY"].ToString());

                lbUserName.Text   = lnqPersonnel.姓名.ToString();
                lbUserName.Tag    = lnqPersonnel.工号.ToString();
                lbKS.Text         = lnqPersonnel.部门名称.ToString();
                lbKS.Tag          = lnqPersonnel.部门编码.ToString();
                m_dtMxCK          = m_findSellIn.GetList(m_intDJID);
                tbsClient.Tag     = dt.Rows[0]["ObjectDept"].ToString();
                txtSellID.Text    = dt.Rows[0]["DJH"].ToString();
                tbsClient.Text    = m_findClientServer.GetClientName(dt.Rows[0]["ObjectDept"].ToString());
                cmbCKFS.Text      = dt.Rows[0]["YWFS"].ToString();
                txtRemarkAll.Text = dt.Rows[0]["Remark"].ToString();

                cmbStorage.Text = UniversalFunction.GetStorageName(dt.Rows[0]["StorageID"].ToString());
            }
            else
            {
                m_strDJZTFlag   = "已保存";
                lbUserName.Text = BasicInfo.LoginName;
                lbUserName.Tag  = BasicInfo.LoginID;
                lbKS.Text       = BasicInfo.DeptName;
                lbKS.Tag        = BasicInfo.DeptCode;

                txtSellID.Text = m_billNoControl.GetNewBillNo();

                CreateDateTableStyle();
            }

            if (m_strDJZTFlag != "已保存" && m_strDJZTFlag != "")
            {
                cmbCKFS.Enabled    = false;
                tbsClient.Enabled  = false;
                cmbStorage.Enabled = false;

                if (UniversalFunction.CheckStorageAndPersonnel(dt.Rows[0]["StorageID"].ToString()) == false)
                {
                    btnAffirm.Visible = false;
                }
            }

            dgv_Main.DataSource = m_dtMxCK;
            m_strDJH            = txtSellID.Text.Trim();
            dgv_Main.Columns["SellUnitPrice"].Visible = false;
            dgv_Main.Columns["UnitPrice"].Visible     = false;
            dgv_Main.Columns["Price"].Visible         = false;
        }
Esempio n. 3
0
        private void 库房调拨明细单_Load(object sender, EventArgs e)
        {
            S_CannibalizeBill tempBillInfo = new S_CannibalizeBill();

            if (m_intDJID != 0)
            {
                tempBillInfo  = m_serverCannibalize.GetBill(m_intDJID);
                m_strDJZTFlag = tempBillInfo.DJZT;

                View_HR_Personnel lnqPersonnel = m_findPersonnel.GetPersonnelInfo(tempBillInfo.LRRY);

                if (lnqPersonnel.姓名 != BasicInfo.LoginName)
                {
                    btnSave.Visible       = false;
                    cmbInStorage.Enabled  = false;
                    cmbOutStorage.Enabled = false;
                }

                m_dtMxCK           = m_serverCannibalize.GetList(m_intDJID);
                txtSellID.Text     = tempBillInfo.DJH;
                txtPrice.Text      = tempBillInfo.Price.ToString();
                txtRemarkAll.Text  = tempBillInfo.Remark;
                cmbInStorage.Text  = UniversalFunction.GetStorageName(tempBillInfo.InStoreRoom);
                cmbOutStorage.Text = UniversalFunction.GetStorageName(tempBillInfo.OutStoreRoom);
                btnAffirm.Visible  = UniversalFunction.CheckStorageAndPersonnel(tempBillInfo.OutStoreRoom);
            }
            else
            {
                m_strDJZTFlag     = "已保存";
                btnAffirm.Visible = false;
                txtSellID.Text    = m_billNoControl.GetNewBillNo();
                CreateDateTableStyle();
            }

            if (m_strDJZTFlag != "已保存" && m_strDJZTFlag != "")
            {
                cmbOutStorage.Enabled = false;
                cmbInStorage.Enabled  = false;

                if (!UniversalFunction.CheckStorageAndPersonnel(tempBillInfo.OutStoreRoom) == false)
                {
                    btnSh.Visible = false;
                }
            }

            dgv_Main.DataSource = m_dtMxCK;

            m_strDJH = txtSellID.Text.Trim();
        }
Esempio n. 4
0
        private void dataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e)
        {
            if (dataGridView1.CurrentRow == null)
            {
                return;
            }

            txtFileName.Text   = dataGridView1.CurrentRow.Cells["文件名称"].Value.ToString();
            txtFileNo.Text     = dataGridView1.CurrentRow.Cells["文件编号"].Value.ToString();
            txtFileNo.Tag      = dataGridView1.CurrentRow.Cells["文件ID"].Value;
            txtVersion.Text    = dataGridView1.CurrentRow.Cells["版本号"].Value.ToString();
            txtDestroyWay.Text = dataGridView1.CurrentRow.Cells["销毁办法"].Value.ToString();
            txtCoverFile.Text  = dataGridView1.CurrentRow.Cells["文件载体"].Value.ToString();
            numCopies.Value    = Convert.ToDecimal(dataGridView1.CurrentRow.Cells["份数"].Value);

            lbProposer.Text         = dataGridView1.CurrentRow.Cells["申请人"].Value.ToString();
            lbProposerTime.Text     = dataGridView1.CurrentRow.Cells["申请日期"].Value.ToString();
            lbApprover.Text         = dataGridView1.CurrentRow.Cells["批准人"].Value.ToString();
            lbApproverTime.Text     = dataGridView1.CurrentRow.Cells["批准日期"].Value.ToString();
            lbDestroyPersonnel.Text = dataGridView1.CurrentRow.Cells["销毁人"].Value.ToString();
            lbDestroyTime.Text      = dataGridView1.CurrentRow.Cells["销毁日期"].Value.ToString();

            if (BasicInfo.ListRoles.Contains(
                    m_billMessageServer.GetDeptDirectorRoleName(
                        m_serverPersonnel.GetPersonnelInfo(lbProposer.Text).部门编码)[0]))
            {
                btnApprove.Visible = true;
            }
            else
            {
                btnApprove.Visible = false;
            }

            if (lbApprover.Text.Trim().Length != 0 && lbDestroyPersonnel.Text.Trim().Length == 0)
            {
                btnDestroy.Visible = true;
            }
            else
            {
                btnDestroy.Visible = false;
            }
        }
Esempio n. 5
0
        private void dataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e)
        {
            if (dataGridView1.CurrentRow == null)
            {
                return;
            }

            txtFileName.Text          = dataGridView1.CurrentRow.Cells["文件名称"].Value.ToString();
            txtFileName.Tag           = dataGridView1.CurrentRow.Cells["序号"].Value.ToString();
            txtFileNo.Text            = dataGridView1.CurrentRow.Cells["文件编号"].Value.ToString();
            txtFileNo.Tag             = dataGridView1.CurrentRow.Cells["文件ID"].Value;
            txtGrantDepartment.Text   = dataGridView1.CurrentRow.Cells["发文单位"].Value.ToString();
            txtGrantDepartment.Tag    = m_serverDepartment.GetDepartmentCode(dataGridView1.CurrentRow.Cells["发文单位"].Value.ToString());
            txtRecoverDepartment.Text = dataGridView1.CurrentRow.Cells["收文单位"].Value.ToString();
            txtRecoverDepartment.Tag  = m_serverDepartment.GetDepartmentCode(dataGridView1.CurrentRow.Cells["收文单位"].Value.ToString());
            txtVersion.Text           = dataGridView1.CurrentRow.Cells["版本号"].Value.ToString();

            lbGrantPersonnel.Text   = dataGridView1.CurrentRow.Cells["发放人"].Value.ToString();
            lbGrantTime.Text        = dataGridView1.CurrentRow.Cells["发放日期"].Value.ToString();
            lbRecoverPersonnel.Text = dataGridView1.CurrentRow.Cells["回收确认人"].Value.ToString();
            lbRecoverTime.Text      = dataGridView1.CurrentRow.Cells["回收日期"].Value.ToString();
            lbSignPersonnel.Text    = dataGridView1.CurrentRow.Cells["签收人"].Value.ToString();
            lbSignTime.Text         = dataGridView1.CurrentRow.Cells["签收日期"].Value.ToString();

            if (lbSignPersonnel.Text.Length != 0 &&
                lbRecoverPersonnel.Text.Length == 0 &&
                BasicInfo.DeptCode.Substring(0, 2) ==
                m_serverPersonnel.GetPersonnelInfo(lbGrantPersonnel.Text).部门编码.Substring(0, 2))
            {
                btnRecover.Visible = true;
            }
            else
            {
                btnRecover.Visible = false;
            }

            btnSign.Visible = UniversalFunction.IsOperator("DORR" + txtFileName.Tag.ToString());
        }
        /// <summary>
        /// 有检测废的物品直接生成领料单
        /// </summary>
        /// <param name="ctx">数据上下文</param>
        /// <param name="inDepotInfo">报检单信息</param>
        /// <param name="mrBillNo">分配的领料单单号</param>
        /// <param name="error">出错时返回错误信息</param>
        /// <returns>操作是否成功的标志</returns>
        public bool InsertIntoMaterialRequisition(DepotManagementDataContext ctx, S_CheckOutInDepotBill inDepotInfo,
                                                  out string mrBillNo, out string error)
        {
            error    = null;
            mrBillNo = null;
            string billNo = null;

            MaterialRequisitionServer serverMaterialBill = new MaterialRequisitionServer();

            try
            {
                billNo   = m_assignBill.AssignNewNo(serverMaterialBill, CE_BillTypeEnum.领料单.ToString());
                mrBillNo = billNo;

                var varData = from a in ctx.S_MaterialRequisition
                              where a.Bill_ID == billNo
                              select a;

                S_MaterialRequisition lnqMaterial = null;

                if (varData.Count() != 0)
                {
                    error = string.Format("自动生成的报废物品领料单单号 {0} 已被占用,请尝试重新进行此操作,再三出现无法生成可用的单号时与管理员联系", billNo);
                    return(false);
                }
                else
                {
                    DateTime dt = ServerTime.Time;

                    lnqMaterial = new S_MaterialRequisition();

                    lnqMaterial.Bill_ID             = billNo;
                    lnqMaterial.Bill_Time           = dt;
                    lnqMaterial.AssociatedBillNo    = inDepotInfo.Bill_ID;
                    lnqMaterial.AssociatedBillType  = CE_BillTypeEnum.报检入库单.ToString();
                    lnqMaterial.BillStatus          = "已出库";
                    lnqMaterial.Department          = "ZK03";
                    lnqMaterial.DepartmentDirector  = "";
                    lnqMaterial.DepotManager        = inDepotInfo.DepotManager;
                    lnqMaterial.FetchCount          = 0;
                    lnqMaterial.FetchType           = "零星领料";
                    lnqMaterial.FillInPersonnel     = inDepotInfo.QualityInputer;
                    lnqMaterial.FillInPersonnelCode = m_personnelInfoServer.GetPersonnelInfo(inDepotInfo.QualityInputer).工号;
                    lnqMaterial.ProductType         = "";
                    lnqMaterial.PurposeCode         = UniversalFunction.GetPurpose(CE_PickingPurposeProperty.破坏性检测).Code;
                    lnqMaterial.Remark       = "因入库零件进行了破坏性检测,由系统自动生成的破坏件领料单,对应单据号:" + inDepotInfo.Bill_ID;
                    lnqMaterial.StorageID    = inDepotInfo.StorageID;
                    lnqMaterial.OutDepotDate = dt;

                    if (!serverMaterialBill.AutoCreateBill(ctx, lnqMaterial, out error))
                    {
                        return(false);
                    }
                }

                var varDataList = from a in ctx.S_MaterialRequisitionGoods
                                  where a.Bill_ID == billNo
                                  select a;

                if (varDataList.Count() != 0)
                {
                    error = "此单据号已被占用";
                    return(false);
                }
                else
                {
                    S_MaterialRequisitionGoods lnqMaterialGoods = new S_MaterialRequisitionGoods();

                    lnqMaterialGoods.Bill_ID      = billNo;
                    lnqMaterialGoods.BasicCount   = 0;
                    lnqMaterialGoods.BatchNo      = inDepotInfo.BatchNo;
                    lnqMaterialGoods.GoodsID      = inDepotInfo.GoodsID;
                    lnqMaterialGoods.ProviderCode = inDepotInfo.Provider;
                    lnqMaterialGoods.RealCount    = Convert.ToDecimal(inDepotInfo.DeclareWastrelCount);
                    lnqMaterialGoods.Remark       = "";
                    lnqMaterialGoods.RequestCount = Convert.ToDecimal(inDepotInfo.DeclareWastrelCount);
                    lnqMaterialGoods.ShowPosition = 1;

                    MaterialRequisitionGoodsServer serverMaterialGoods = new MaterialRequisitionGoodsServer();

                    if (!serverMaterialGoods.AutoCreateGoods(ctx, lnqMaterialGoods, out error))
                    {
                        return(false);
                    }
                }

                ctx.SubmitChanges();

                if (!serverMaterialBill.FinishBill(ctx, lnqMaterial.Bill_ID, "", out error))
                {
                    throw new Exception(error);
                }

                ctx.SubmitChanges();

                return(true);
            }
            catch (Exception ex)
            {
                error = ex.Message;

                //if (serverMaterialBill.DeleteBill(billNo, out error))
                //{
                //    error = ex.Message;
                //}

                return(false);
            }
        }
Esempio n. 7
0
        /// <summary>
        /// 界面初始化
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void 营销入库明细单_Load(object sender, EventArgs e)
        {
            DataTable dt = m_findSellIn.GetBill(m_strDJH, m_intDJID);

            m_drZdRK = dt.NewRow();

            if (m_intDJID != 0)
            {
                View_HR_Personnel lnqPersonnel = m_findPersonnel.GetPersonnelInfo(dt.Rows[0]["LRRY"].ToString());

                m_strDJZTFlag   = dt.Rows[0]["DJZT_Flag"].ToString();
                lbUserName.Text = lnqPersonnel.姓名.ToString();
                lbUserName.Tag  = lnqPersonnel.工号.ToString();
                lbKS.Text       = lnqPersonnel.部门名称.ToString();
                lbKS.Tag        = lnqPersonnel.部门编码.ToString();
                m_dtMxRK        = m_findSellIn.GetList(m_intDJID);
                tbsDept.Tag     = dt.Rows[0]["ObjectDept"].ToString();
                txtSellID.Text  = dt.Rows[0]["DJH"].ToString();

                View_Department linVdepartment = m_findDepartmentServer.GetDepartments(dt.Rows[0]["ObjectDept"].ToString());

                tbsDept.Text      = linVdepartment.部门名称;
                txtPrice.Text     = dt.Rows[0]["Price"].ToString();
                txtRemarkAll.Text = dt.Rows[0]["Remark"].ToString();
                cmbRKFS.Text      = dt.Rows[0]["YWFS"].ToString();
                cmbStorage.Text   = UniversalFunction.GetStorageName(dt.Rows[0]["StorageID"].ToString());
                m_lnqWSCode       = m_serverWSBasic.GetWorkShopCodeInfo(tbsDept.Tag.ToString());
            }
            else
            {
                m_strDJZTFlag   = "已保存";
                lbUserName.Text = BasicInfo.LoginName;
                lbUserName.Tag  = BasicInfo.LoginID;
                lbKS.Text       = BasicInfo.DeptName;
                lbKS.Tag        = BasicInfo.DeptCode;

                WS_WorkShopCode tempWorkCodeInfo = m_serverWSBasic.GetPersonnelWorkShop(BasicInfo.LoginID);

                if (tempWorkCodeInfo != null)
                {
                    tbsDept.Text = tempWorkCodeInfo.WSName;
                    tbsDept.Tag  = tempWorkCodeInfo.DeptCode;
                }

                txtSellID.Text = m_billNoControl.GetNewBillNo();

                CreateDateTableStyle();
            }

            if (!Convert.ToBoolean(BasicInfo.BaseSwitchInfo[(int)GlobalObject.CE_SwitchName.开启车间管理模块]))
            {
                txtBatchNo.Enabled = false;
            }

            if (m_strDJZTFlag != "已保存" && m_strDJZTFlag != "")
            {
                cmbRKFS.Enabled    = false;
                tbsDept.Enabled    = false;
                cmbStorage.Enabled = false;

                if (UniversalFunction.CheckStorageAndPersonnel(dt.Rows[0]["StorageID"].ToString()) == false)
                {
                    btnAffirm.Visible = false;
                }
            }

            OperationbtnCheckIsVisible(m_dtMxRK);

            //DataRow drDept = m_serverDepartment.GetPersonnelAffiliatedTopFunction(lbUserName.Text).Rows[0];

            //tbsDept.Enabled = false;
            //tbsDept.Text = drDept["DepartmentName"].ToString();
            //tbsDept.Tag = drDept["DepartmentCode"].ToString();
            dgv_Main.DataSource = m_dtMxRK;

            m_strDJH = txtSellID.Text.Trim();
        }
        /// <summary>
        /// 界面初始化
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void 营销退货明细单_Load(object sender, EventArgs e)
        {
            DataTable dt = m_findSellIn.GetBill(m_strDJH, m_intDJID);

            m_drZdRK = dt.NewRow();

            if (m_intDJID != 0)
            {
                m_strDJZTFlag = dt.Rows[0]["DJZT_Flag"].ToString();

                View_HR_Personnel lnqPersonnel = m_findPersonnel.GetPersonnelInfo(dt.Rows[0]["LRRY"].ToString());

                lbUserName.Text = lnqPersonnel.姓名.ToString();
                lbUserName.Tag  = lnqPersonnel.工号.ToString();
                lbKS.Text       = lnqPersonnel.部门名称.ToString();
                lbKS.Tag        = lnqPersonnel.部门编码.ToString();
                m_dtMxRK        = m_findSellIn.GetList(m_intDJID);
                tbsDept.Tag     = dt.Rows[0]["ObjectDept"].ToString();

                View_Department linVdepartment = m_findDepartmentServer.GetDepartments(dt.Rows[0]["ObjectDept"].ToString());

                tbsDept.Text      = linVdepartment.部门名称;
                txtSellID.Text    = dt.Rows[0]["DJH"].ToString();
                txtPrice.Text     = dt.Rows[0]["Price"].ToString();
                cmbTHFS.Text      = dt.Rows[0]["YWFS"].ToString();
                txtRemarkAll.Text = dt.Rows[0]["Remark"].ToString();
                cmbStorage.Text   = UniversalFunction.GetStorageName(dt.Rows[0]["StorageID"].ToString());
            }
            else
            {
                m_strDJZTFlag   = "已保存";
                lbUserName.Text = BasicInfo.LoginName;
                lbUserName.Tag  = BasicInfo.LoginID;
                lbKS.Text       = BasicInfo.DeptName;
                lbKS.Tag        = BasicInfo.DeptCode;
                txtSellID.Text  = m_billNoControl.GetNewBillNo();

                CreateDateTableStyle();
            }

            if (m_strDJZTFlag != "已保存" && m_strDJZTFlag != "")
            {
                cmbTHFS.Enabled    = false;
                tbsDept.Enabled    = false;
                cmbStorage.Enabled = false;
            }

            dgv_Main.DataSource = m_dtMxRK;
            m_strDJH            = txtSellID.Text.Trim();


            if (cmbStorage.Text == "售后库房")
            {
                label11.Visible         = true;
                cmbRepairStatus.Visible = true;
                dgv_Main.Columns["RepairStatus"].Visible = true;
            }
            else
            {
                label11.Visible         = false;
                cmbRepairStatus.Visible = false;
                dgv_Main.Columns["RepairStatus"].Visible = false;
            }
        }