Exemplo n.º 1
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;
        }
Exemplo n.º 2
0
        /// <summary>
        /// 从营销出库单导入
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLoadDataFromOutboundOrder_Click(object sender, EventArgs e)
        {
            if (!CheckData())
            {
                return;
            }

            FormQueryInfo dialog = QueryInfoDialog.GetOutboundBillDialog();

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                string billNo = dialog.GetStringDataItem("单据号");

                if (MessageDialog.ShowEnquiryMessage("您确定要导入 " + billNo
                                                     + " 营销出库单的信息吗?此过程需要一段时间,是否继续?") == DialogResult.No)
                {
                    return;
                }

                // 营销出库单服务
                ISellIn billServer = ServerModuleFactory.GetServerModule <ISellIn>();

                DataTable bill = billServer.GetBill(billNo, 0);

                string storageID = bill.Rows[0]["StorageID"].ToString();

                DataTable list = billServer.GetList((int)bill.Rows[0]["ID"]);

                if (list.Rows.Count > 0)
                {
                    List <StorageGoods> lstGoods = new List <StorageGoods>(list.Rows.Count);

                    for (int i = 0; i < list.Rows.Count; i++)
                    {
                        StorageGoods goods = new StorageGoods();

                        goods.GoodsCode = list.Rows[i]["GoodsCode"].ToString();
                        goods.GoodsName = list.Rows[i]["GoodsName"].ToString();
                        goods.Spec      = list.Rows[i]["Spec"].ToString();
                        goods.Provider  = list.Rows[i]["Provider"].ToString();
                        goods.BatchNo   = list.Rows[i]["BatchNo"].ToString();
                        goods.Quantity  = (decimal)list.Rows[i]["Count"];
                        goods.StorageID = storageID;

                        lstGoods.Add(goods);
                    }

                    if (是否一次性物品.Checked && GlobalObject.GeneralFunction.IsNullOrEmpty(m_productNumber))
                    {
                        m_productNumber = cmbProductCode.Text;
                    }

                    if (!m_mbpServer.AddFromBill(BasicInfo.LoginID, Convert.ToInt32(
                                                     cmbPurpose.SelectedValue), m_productNumber, billNo, lstGoods, out m_error))
                    {
                        MessageDialog.ShowErrorMessage(m_error);
                    }
                    else
                    {
                        MessageDialog.ShowPromptMessage("操作成功");

                        SearchData(0);
                    }
                }
            }
        }
Exemplo n.º 3
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;
            }
        }