Ejemplo n.º 1
0
        private void btnBillLook_Click(object sender, EventArgs e)
        {
            bool check = false;
            if (selection1.SelectedCount == 0)
            { check = false; MessageBox.Show("请选择要查看的采购销售单"); }
            else if (selection1.SelectedCount != 1)
            { check = false; MessageBox.Show("每次只能看看一张采购销售单"); }
            else
            { check = true; }
            if (check == true)
            {
                int RowIndex = selection1.GetSelectedRowIndex(0);
                int RowHandle = gridView1.GetRowHandle(RowIndex);
                string strXSJSDID = gridView1.GetRowCellValue(RowHandle, colXSJSDID).ToString();
                if (this.Tag.ToString() == "JT_C_XSJSD_ZDJS")
                {

                    FrmSaleStageJTAdd frm = new FrmSaleStageJTAdd(strXSJSDID);
                    frm.Text = "集团——采购结算单——整单结算——查看";
                    frm.Tag = "JT_XSJSD_ZDJS_LOOK";
                    selection1.ClearSelection();
                    frm.ShowDialog();

                }
                else if (this.Tag.ToString() == "JT_C_XSJSD_SXSJ")
                {
                    FrmSaleStageJTAdd frm = new FrmSaleStageJTAdd(strXSJSDID);
                    frm.Text = "集团——采购结算单——实销实结——查看";
                    frm.Tag = "JT_XSJSD_SXSJ_LOOK";
                    selection1.ClearSelection();
                    frm.ShowDialog();
                }

            }
        }
Ejemplo n.º 2
0
        private void btnBillAdd_Click(object sender, EventArgs e)
        {
            selection1.ClearSelection();
            selection2.ClearSelection();
            if (this.Tag.ToString() == "JT_C_XSJSD_ZDJS")
            {
                FrmSaleStageJTAdd frm = new FrmSaleStageJTAdd("0");
                frm.Text = "集团——销售结算单——整单结算——增加";
                frm.Tag = "JT_XSJSD_ZDJS_ADD";
                if (frm.ShowDialog() == DialogResult.OK)
                {
                //    if (string.IsNullOrEmpty(this.gridView1.ActiveFilterString))
                 //   {
                //        xpServerCollectionSource1.FixedFilterString = "[CZYID] = \'" + FrmLogin.getUserID + "\'And [ZTID] = \'" + FrmLogin.getZTID + "\'And [ZT] = \'" + "02" + "\'";
                //    }

                    unitOfWork1.DropIdentityMap();
                    SlelectCountClear();
                    xpServerCollectionSource1.Reload();
                    gridView1.BestFitColumns();
                }
            }
            else if (this.Tag.ToString() == "JT_C_XSJSD_SXSJ")
            {
                FrmSaleStageJTAdd frm = new FrmSaleStageJTAdd("0");
                frm.Text = "集团——销售结算单——实销实结——增加";
                frm.Tag = "JT_XSJSD_SXSJ_ADD";
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    if (string.IsNullOrEmpty(this.gridView1.ActiveFilterString))
                    {
                        xpServerCollectionSource1.FixedFilterString = "[CZYID] = \'" + FrmLogin.getUserID + "\'And [ZTID] = \'" + FrmLogin.getZTID + "\'And [ZT] = \'" + "02" + "\'";
                    }
                    unitOfWork1.DropIdentityMap();
                    SlelectCountClear();
                    xpServerCollectionSource1.Reload();
                    gridView1.BestFitColumns();
                }
            }
        }
Ejemplo n.º 3
0
        private void btnBillAlter_Click(object sender, EventArgs e)
        {
            bool check = false;
            if (selection1.SelectedCount == 0)
            { check = false; MessageBox.Show("请选择要修改的采购销售单"); }
            else if (selection1.SelectedCount != 1)
            { check = false; MessageBox.Show("每次只能修改一张采购销售单"); }
            else
            { check = true; }
            if (check == true)
            {
                bool fgshowfrom = false;
                int RowIndex = selection1.GetSelectedRowIndex(0);
                int RowHandle = gridView1.GetRowHandle(RowIndex);
                string strZT = gridView1.GetRowCellDisplayText(RowHandle, colZT).ToString().Trim();
                string strZTID = gridView1.GetRowCellValue(RowHandle, colZTID).ToString();
                string strXSJSDID = gridView1.GetRowCellValue(RowHandle, colXSJSDID).ToString();
                string strCZYID = gridView1.GetRowCellDisplayText(RowHandle, colCZYID).ToString().Trim();
                if (strZT != "02")
                {
                    fgshowfrom = false;
                    MessageBox.Show("只有存盘状态下的结算单才可以被修改");
                }
                else if (strZTID != FrmLogin.getZTID.ToString())
                {
                    fgshowfrom = false;
                    MessageBox.Show("只有自己帐套下的结算单才可以被修改");
                }
                else if (strCZYID != FrmLogin.getUserID.ToString())
                {
                    fgshowfrom = false;
                    MessageBox.Show("只有自己新建的结算单才可以被修改");

                }
                else
                { fgshowfrom = true; }
                if (fgshowfrom == true)
                {
                    if (this.Tag.ToString() == "JT_C_XSJSD_ZDJS")
                    {

                        FrmSaleStageJTAdd frm = new FrmSaleStageJTAdd(strXSJSDID);
                        frm.Text = "集团——采购结算单——整单结算——修改";
                        frm.Tag = "JT_XSJSD_ZDJS_ALTER";
                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            selection1.ClearSelection();
                            SlelectCountClear();
                            unitOfWork1.DropIdentityMap();
                            xpServerCollectionSource1.Reload();
                            gridView1.BestFitColumns();
                        }
                    }
                    else if (this.Tag.ToString() == "JT_C_XSJSD_SXSJ")
                    {

                        FrmSaleStageJTAdd frm = new FrmSaleStageJTAdd(strXSJSDID);
                        frm.Text = "集团——采购结算单——实销实结——修改";
                        frm.Tag = "JT_XSJSD_SXSJ_ALTER";
                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            selection1.ClearSelection();
                            unitOfWork1.DropIdentityMap();
                            SlelectCountClear();
                            xpServerCollectionSource1.Reload();
                            gridView1.BestFitColumns();
                        }
                    }

                }

            }
        }