Exemplo n.º 1
0
        private void btnBillAdd_Click(object sender, EventArgs e)
        {
            FrmUnusualStockReturnsAdd from = new FrmUnusualStockReturnsAdd();
            from.Tag = "JC_G_JTD_ADD";
            from.Text = "非正常库存退货功能";
            if (from.ShowDialog() == DialogResult.OK)
            {
                if (!String.IsNullOrEmpty(gridView1.ActiveFilterString))
                {
                    xpServerCollectionSource1.FixedFilterString = gridView1.ActiveFilterString + " And [ZTID] = \'" + FrmLogin.getZTID + "\'";
                }
                else
                {
                    xpServerCollectionSource1.FixedFilterString = "[CZYID] = \'" + FrmLogin.getUserID + "\'";

                }
                this.unitOfWork1.DropIdentityMap();
                this.xpServerCollectionSource1.Reload();
            }
        }
Exemplo n.º 2
0
        private void btnBillLook_Click(object sender, EventArgs e)
        {
            if (selection1.SelectedCount != 1)
            {
                MessageBox.Show("请选择一张进退单产查看");
            }
            else
            {
                int RowIndex = selection1.GetSelectedRowIndex(0);
                int RowHandle = gridView1.GetRowHandle(RowIndex);
                string strZTID = gridView1.GetRowCellDisplayText(RowHandle, colZTID).ToString().Trim();
                string strZT = gridView1.GetRowCellDisplayText(RowHandle, colZT).ToString().Trim();
                string strJTDH = gridView1.GetRowCellDisplayText(RowHandle, colJTDH).ToString().Trim();
                string strczyid = gridView1.GetRowCellDisplayText(RowHandle, colCZYID).ToString().Trim();
                string strJTDID = gridView1.GetRowCellDisplayText(RowHandle, colJTDID).ToString().Trim();

                FrmUnusualStockReturnsAdd from = new FrmUnusualStockReturnsAdd(strJTDID);
                from.Tag = "JC_G_JTD_LOOK";
                from.Text = "非正常库存退货功能";
                from.ShowDialog();

            }
        }
Exemplo n.º 3
0
        private void btnBillEdit_Click(object sender, EventArgs e)
        {
            bool fgCheck = false;
            string selectid = "";
            if (selection1.SelectedCount != 1)
            {
                fgCheck = false;
                MessageBox.Show("请选择一张进退单编辑");
            }
            else
            {
                int RowIndex = selection1.GetSelectedRowIndex(0);
                int RowHandle = gridView1.GetRowHandle(RowIndex);
                string strZTID = gridView1.GetRowCellDisplayText(RowHandle, colZTID).ToString().Trim();
                string strZT = gridView1.GetRowCellDisplayText(RowHandle, colZT).ToString().Trim();
                string strJTDH = gridView1.GetRowCellDisplayText(RowHandle, colJTDH).ToString().Trim();
                string strczyid = gridView1.GetRowCellDisplayText(RowHandle, colCZYID).ToString().Trim();
                string strJTDID = gridView1.GetRowCellDisplayText(RowHandle, colJTDID).ToString().Trim();
                if (Convert.ToInt32(strZT) > 02)
                {
                    fgCheck = false;
                    MessageBox.Show("这个单子已经确认过了无法删除");
                }
                else if (strZTID != FrmLogin.getZTID.ToString())
                {
                    fgCheck = false;
                    MessageBox.Show("只有自己帐套下建立的单子才可以删除");

                }
                else if (string.IsNullOrEmpty(strJTDH))
                {
                    fgCheck = false;
                    MessageBox.Show("该进退单为空号");

                }
                else if (strczyid != FrmLogin.getUserID.ToString())
                {
                    fgCheck = false;
                    MessageBox.Show("只能删除自己建立的进退单");
                }
                else
                {
                    selectid = strJTDID;
                    fgCheck = true;

                }

            }
            if (fgCheck == true)
            {
                FrmUnusualStockReturnsAdd from = new FrmUnusualStockReturnsAdd(selectid);
                from.Tag = "JC_G_JTD_EDIT";
                from.Text = "非正常库存退货功能";
                if (from.ShowDialog() == DialogResult.OK)
                {
                    if (!String.IsNullOrEmpty(gridView1.ActiveFilterString))
                    {
                        xpServerCollectionSource1.FixedFilterString = gridView1.ActiveFilterString + " And [ZTID] = \'" + FrmLogin.getZTID + "\'";
                    }
                    else
                    {
                        xpServerCollectionSource1.FixedFilterString = "[CZYID] = \'" + FrmLogin.getUserID + "\'";

                    }
                    this.unitOfWork1.DropIdentityMap();
                    this.xpServerCollectionSource1.Reload();
                }

            }
        }