Exemplo n.º 1
0
        internal void InitSub(SummonVO SVO, IRole UVO, Form form)
        {
            this.SVO         = SVO;
            this.UVO         = UVO;
            this.FORM        = form;
            cbStatus.Enabled = false;
            done             = false;
            if ((UVO.Role != Roles.OTK) && (UVO.Role != Roles.Montage) && (UVO.Role != Roles.MainMontage) && (UVO.Role != Roles.Ozis) && (UVO.Role != Roles.Admin))
            {
                this.Visible = false;
                return;
            }

            DBCurStatus dbcs = new DBCurStatus();

            cbStatus.ValueMember   = "ID";
            cbStatus.DisplayMember = "SNAME";
            cbStatus.DataSource    = dbcs.GetAllSubStatuses(UVO, SVO);
            //cbStatus.SelectedValue = SVO.IDSUBST;
            cbStatus.SelectedValue = dbcs.DefaultSubStatus;

            //SetDefaultsSub();
            groupBox1.Text = "Смена субстатуса";
            button3.Text   = "Сменить субстатус";
            label1.Text    = "Выберите субстатус";
            sub            = true;
        }
Exemplo n.º 2
0
        public fAdminChangeStatus(SummonVO svo, IRole uvo)
        {
            InitializeComponent();

            this.SVO = svo;
            this.UVO = uvo;
        }
Exemplo n.º 3
0
        internal void SaveNewSummon(SummonVO SVO, IRole UVO)
        {
            this.SaveSummon(SVO);
            DBCurStatus dbcs = new DBCurStatus();

            dbcs.SaveNewCurstatus(SVO.ID, UVO.id);
        }
Exemplo n.º 4
0
        public void Init(SummonVO svo, IRole uvo, Form form)
        {
            //    InitializeComponent();
            this.SVO         = svo;
            this.UVO         = uvo;
            this.FORM        = form;
            cbStatus.Enabled = false;
            done             = false;

            if ((UVO.Role == Roles.Buhgalter) ||
                (UVO.Role == Roles.Constructor) ||
                (UVO.Role == Roles.Director) ||
                (UVO.Role == Roles.Inzhener) ||
                (UVO.Role == Roles.OTD) ||
                (UVO.Role == Roles.Shemotehnik) ||
                (UVO.Role == Roles.SimpleInzhener) ||
                (UVO.Role == Roles.Tehnolog))
            {
                return;
            }

            DBCurStatus dbcs = new DBCurStatus();

            cbStatus.ValueMember   = "ID";
            cbStatus.DisplayMember = "SNAME";
            cbStatus.DataSource    = dbcs.GetAllStatuses(UVO, SVO);
            //cbStatus.SelectedValue = SVO.IDSTATUS;
            cbStatus.SelectedValue = dbcs.DefaultStatus;

            //SetDefaults();
        }
Exemplo n.º 5
0
        private void просмотрИРедактированиеToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //mf.ViewEditMenuItem_Click(sender, e);
            if (dgSummon.SelectedRows.Count == 0)
            {
                MessageBox.Show("Извещение не выбрано!");
                return;
            }
            DBSummon      dbs = new DBSummon();
            SummonVO      svo = dbs.GetSummonByIDS(dgSummon.SelectedRows[0].Cells["ids"].Value.ToString());
            PreviousState ps  = new PreviousState(dgSummon);

            ShowSummon ss = new ShowSummon(mf.UVO, svo);

            ss.ShowDialog();

            //switch (mf.UVO.Role)
            //{
            //    case Roles.Manager:
            //        ShowSummon ss = new ShowSummon(mf.UVO,svo);
            //        ss.ShowDialog();
            //        break;
            //    case Roles.Ozis:
            //        ShowSummonOZIS ssozis = new ShowSummonOZIS(svo.IDS, mf.UVO,svo.ID);
            //        ssozis.ShowDialog();
            //        break;
            //    case Roles.Prod:
            //        ShowSummonPROD ssprod = new ShowSummonPROD(svo.IDS, mf.UVO,svo.ID);
            //        ssprod.ShowDialog();
            //        break;
            //    case Roles.OTK:
            //        ShowSummonOTK ssotk = new ShowSummonOTK(svo.IDS, mf.UVO,svo.ID);
            //        ssotk.ShowDialog();
            //        break;
            //    case Roles.Ware:
            //        ShowSummonWare ssware = new ShowSummonWare(svo.IDS, mf.UVO,svo.ID);
            //        ssware.ShowDialog();
            //        break;
            //    case Roles.Logist:
            //        ShowSummonLOG ssLOG = new ShowSummonLOG(svo.IDS, mf.UVO,svo.ID);
            //        ssLOG.ShowDialog();
            //        break;
            //    case Roles.Director:
            //        ShowSummonDIR ssDIR = new ShowSummonDIR(svo.IDS, mf.UVO,svo.ID);
            //        ssDIR.ShowDialog();
            //        break;
            //    case Roles.Wsh:
            //        ShowSummonWSH ssWSH = new ShowSummonWSH(svo.IDS, mf.UVO,svo.ID);
            //        ssWSH.ShowDialog();
            //        break;
            //    case Roles.Admin:
            //        ShowSummonDIR ssadmin = new ShowSummonDIR(svo.IDS, mf.UVO,svo.ID);
            //        ssadmin.ShowDialog();
            //        break;
            //}
            ReloadData();
            ps.Restore();
        }
Exemplo n.º 6
0
        internal SummonVO GetSummonByID(string id)
        {
            DA.SelectCommand.CommandText = "select * from " + Base.BaseName + "..SUMMON where ID = " + id;
            DA.Fill(DS, "t");

            SummonVO SVO = FillSVO(DS.Tables["t"].Rows[0]);

            return(SVO);
        }
Exemplo n.º 7
0
 internal void AddSummonView(SummonVO SVO, IRole UVO)
 {
     DA.InsertCommand             = new System.Data.SqlClient.SqlCommand();
     DA.InsertCommand.Connection  = new System.Data.SqlClient.SqlConnection(MainF.ConnectionString);
     DA.InsertCommand.CommandText = "insert into " + Base.BaseName + "..SUMMONVIEWS (IDSUMMON,DATEVIEWED,IDUSER) values " +
                                    "(" + SVO.ID + ",getdate()," + UVO.id + ") ";
     DA.InsertCommand.Connection.Open();
     DA.InsertCommand.ExecuteNonQuery();
     DA.InsertCommand.Connection.Close();
 }
Exemplo n.º 8
0
 public void Init(string ID_, IRole UVO_, SummonVO SVO_)
 {
     this.ID  = ID_;
     this.UVO = UVO_;
     this.SVO = SVO_;
     if (UVO.Role != Roles.Admin)
     {
         button3.Visible = false;
     }
 }
Exemplo n.º 9
0
        private void button2_Click(object sender, EventArgs e)
        {
            DBSummon                 dbs  = new DBSummon();
            SummonVO                 svo  = dbs.GetSummonByIDS(dgSummon.SelectedRows[0].Cells["ids"].Value.ToString());
            SummonVOForReport        svor = new SummonVOForReport(svo);
            List <SummonVOForReport> sl   = new List <SummonVOForReport>();

            sl.Add(svor);
            ShowReport sr = new ShowReport(sl);

            sr.ShowDialog();
        }
Exemplo n.º 10
0
        private void bPrint_Click(object sender, EventArgs e)
        {
            DBSummon                 dbs  = new DBSummon();
            SummonVO                 svo  = dbs.GetSummonByIDS(tbIDS.Text);
            SummonVOForReport        svor = new SummonVOForReport(svo);
            List <SummonVOForReport> sl   = new List <SummonVOForReport>();

            sl.Add(svor);
            ShowReport sr = new ShowReport(sl);

            sr.ShowDialog();
        }
Exemplo n.º 11
0
        private void dgSummon_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex == -1)
            {
                return;
            }
            DBSummon dbs = new DBSummon();
            SummonVO svo = dbs.GetSummonByIDS(dgSummon.SelectedRows[0].Cells["ids"].Value.ToString());



            //ShowSummonDIR ssDIR = new ShowSummonDIR(svo.IDS, null, svo.ID);
            //ssDIR.ShowDialog();
        }
Exemplo n.º 12
0
        private void bGoToSummon_Click(object sender, EventArgs e)
        {
            if (dgSumm.SelectedRows.Count == 0)
            {
                MessageBox.Show("Извещение не выбрано!");
                return;
            }
            DBSummon dbs = new DBSummon();
            SummonVO svo = dbs.GetSummonByID(dgSumm.SelectedRows[0].Cells["IDSUMMON"].Value.ToString());

            ShowSummon ss = new ShowSummon(UVO, svo);

            ss.ShowDialog();
            Remarks_Load(sender, e);
        }
Exemplo n.º 13
0
 internal void ChangeStatus(SummonVO SVO, int idstatus, string iduser)
 {
     DA.InsertCommand.CommandText = "insert into " + Base.BaseName + "..CURSTATUS (IDSUMMON,STATID,CAUSE,CHANGED,IDUSER) " +
                                    " values (" + SVO.ID + "," + idstatus.ToString() + ",@cause,'" + DateTime.Now.ToString("yyyyMMdd HH:mm") + "'," + iduser + ")";
     DA.InsertCommand.Parameters.Add("cause", System.Data.SqlDbType.NVarChar);
     DA.InsertCommand.Parameters["cause"].Value = "";
     DA.InsertCommand.Connection.Open();
     DA.InsertCommand.ExecuteNonQuery();
     DA.InsertCommand.Connection.Close();
     DA.InsertCommand.Parameters.Remove(DA.InsertCommand.Parameters["cause"]);
     DA.UpdateCommand.CommandText = "update " + Base.BaseName + "..SUMMON set VIEWED = 0,IDSTATUS = " + idstatus.ToString() + " where ID = " + SVO.ID;
     DA.UpdateCommand.Connection.Open();
     DA.UpdateCommand.ExecuteNonQuery();
     DA.UpdateCommand.Connection.Close();
 }
Exemplo n.º 14
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (dgSummon.SelectedRows.Count == 0)
            {
                return;
            }
            DBSummon dbs = new DBSummon();
            SummonVO svo = dbs.GetSummonByIDS(dgSummon.SelectedRows[0].Cells["ids"].Value.ToString());


            ShowSummon ss = new ShowSummon(new UVO_DIRECTOR(), svo);

            ss.Tag = "finished";
            ss.ShowDialog();
            //ShowSummonDIR ssDIR = new ShowSummonDIR(svo.IDS, null, svo.ID);
            //ssDIR.ShowDialog();
        }
Exemplo n.º 15
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (dgSummOnProd.SelectedRows.Count == 0)
            {
                MessageBox.Show("Выберите извещение!");
                return;
            }
            SummonVO SVO = SummonVO.SummonVOByID(dgSummOnProd.SelectedRows[0].Cells["ID"].Value.ToString());


            ShowSummon ss = new ShowSummon(this.UVO, SVO);

            if (SVO.STATUSNAME == "Завершено")
            {
                ss = new ShowSummon(new UVO_DIRECTOR(), SVO);
            }
            ss.ShowDialog();
        }
Exemplo n.º 16
0
        private void печатьToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            // mf.PrintMenuItem_Click(sender, e);
            if (dgSummon.SelectedRows.Count == 0)
            {
                MessageBox.Show("Извещение не выбрано!");
                return;
            }
            DBSummon                 dbs  = new DBSummon();
            SummonVO                 svo  = dbs.GetSummonByIDS(dgSummon.SelectedRows[0].Cells["ids"].Value.ToString());
            SummonVOForReport        svor = new SummonVOForReport(svo);
            List <SummonVOForReport> sl   = new List <SummonVOForReport>();

            sl.Add(svor);
            ShowReport sr = new ShowReport(sl);

            sr.ShowDialog();
        }
Exemplo n.º 17
0
        private void dgSummon_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex == -1)
            {
                return;
            }

            if (dgSummon.SelectedRows.Count == 0)
            {
                MessageBox.Show("Извещение не выбрано!");
                return;
            }
            DBSummon      dbs = new DBSummon();
            SummonVO      svo = dbs.GetSummonByIDS(dgSummon.SelectedRows[0].Cells["ids"].Value.ToString());
            PreviousState ps  = new PreviousState(dgSummon);

            ShowSummon ss = new ShowSummon(mf.UVO, svo);

            ss.ShowDialog();
        }
Exemplo n.º 18
0
        public SummonVOForReport(SummonVO VO)
        {
            VO.FillReportFields();

            this.IDS = VO.IDS;
            //this.ACCEPTANCE = VO.ACCEPTANCE;
            this.CONTRACT        = VO.CONTRACT;
            this.CREATED         = VO.CREATED;
            this.CUSTOMERCONTACT = VO.CUSTOMERCONTACT;
            this.CUSTOMERNAME    = VO.CUSTOMERNAME;
            this.CUSTOMERADDRESS = VO.CUSTOMERADDRESS;
            this.IDCUSTOMERDEPT  = VO.IDCUSTOMERDEPT;
            //this.CUSTOMERCONTACTEXE = VO.CUSTOMERCONTACTEXE;
            //this.CUSTOMERCONTACTLOG = VO.CUSTOMERCONTACTLOG;
            this.DEPTCONTACTEXE = VO.DEPTCONTACTEXE;
            this.DEPTCONTACTLOG = VO.DEPTCONTACTLOG;
            this.DEPTNAME       = VO.DEPTNAME;
            this.DELIVERY       = VO.DELIVERY;
            this.IDACCEPT       = VO.IDACCEPT;
            //this.IDCURSTATUS = VO.IDCURSTATUS;
            this.IDCUSTOMER      = VO.IDCUSTOMER;
            this.PAYSTATUS       = VO.PAYSTATUS;
            this.IDSTATUS        = VO.IDSTATUS;
            this.IDWPNAME        = VO.IDWPNAME;
            this.NOTE            = VO.NOTE;
            this.NOTEPDB         = VO.NOTEPDB;
            this.PASSDATETEXT    = VO.PASSDATETEXT;
            this.PTIME           = VO.PTIME;
            this.QUANTITY        = VO.QUANTITY;
            this.SHIPPING        = VO.SHIPPING;
            this.SISP            = VO.SISP;
            this.SISPNAME        = VO.SISPNAME;
            this.STATUSNAME      = VO.STATUSNAME;
            this.TECHREQPATH     = "NotImplemented";//VO.TECHREQPATH;
            this.WPNAME          = VO.ProductVO.GetName();
            this.PACKINGNAME     = VO.PACKINGNAME;
            this.EXTCABLENAMES   = VO.EXTCABLENAMES;
            this.MOUNTINGKITNAME = VO.MOUNTINGKITNAME;
        }
Exemplo n.º 19
0
        internal object GetAllSubStatuses(IRole UVO, SummonVO SVO)
        {
            DS = new DataSet();
            switch (UVO.Role)
            {
            case Roles.OTK:
                DA.SelectCommand.CommandText = "select ID,case when ID = 17 then 'Субстатус закрыт' else " +
                                               " 'Возвращено монтажникам из ОТК'  end SNAME" +
                                               " from " + Base.BaseName +
                                               "..STATUSLIST where ID in (17,18)";
                DefaultSubStatus = 17;
                break;

            case Roles.Ozis:
                DA.SelectCommand.CommandText = "select ID, 'Монтажники' SNAME " +
                                               " from " + Base.BaseName +
                                               "..STATUSLIST where ID in (15)";
                DefaultSubStatus = 15;
                break;

            case Roles.Montage:
            case Roles.MainMontage:
                DA.SelectCommand.CommandText = "select ID, 'ОТК' SNAME from " + Base.BaseName +
                                               "..STATUSLIST where ID in (16)";
                DefaultSubStatus = 16;
                break;

            case Roles.Admin:
                DA.SelectCommand.CommandText = "select ID, SNAME from " + Base.BaseName +
                                               "..STATUSLIST where ID in (15,16,17,18)";
                DefaultSubStatus = 18;
                break;
            }
            DA.Fill(DS, "t");
            return(DS.Tables["t"]);
        }
Exemplo n.º 20
0
        private void bAdd_Click(object sender, EventArgs e)
        {
            if (pickWPName1.textBox1.Text == "")
            {
                MessageBox.Show("Выбеоите изделие!");
                return;
            }
            if (tbQUANTITY.Value == 0)
            {
                MessageBox.Show("Введите количество изделий!");
                return;
            }
            if (cbCustDept.Items.Count == 0)
            {
                MessageBox.Show("Необходиом добавить хотя бы один отдел заказчика!");
                return;
            }
            if (MessageBox.Show("Вы действительно хотите сохранить и передать в ПДБ?", "Внимание!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                return;
            }
            DBSummon dbs = new DBSummon();
            SummonVO SVO = new SummonVO();

            SVO.ID  = this.IDNEWSUMMON.ToString();
            SVO.IDS = dbs.GetNextNumber();
            //SVO.ACCEPTANCE = cbAccept.Text;
            SVO.CONTRACT   = tbCONTRACT.Text;
            SVO.CREATED    = DateTime.Now;
            SVO.DELIVERY   = tbDELIVERY.Text;
            SVO.IDCUSTOMER = cbCustomers.SelectedValue.ToString();
            SVO.PAYSTATUS  = tbPAYSTATUS.Text;
            SVO.IDSTATUS   = 2;
            SVO.NOTE       = tbNote.Text;
            SVO.PTIME      = dtpPTIME.Value;
            SVO.QUANTITY   = (int)tbQUANTITY.Value;
            SVO.SHIPPING   = tbSHIPPING.Text;
            if (cbSISP.SelectedIndex == 0)
            {
                SVO.SISP = false;
            }
            else
            {
                SVO.SISP = true;
            }
            SVO.IDWPNAME  = pickWPName1.PickedProduct.GetID();
            SVO.WPTYPE    = pickWPName1.PickedProduct.GetProductType().ToString();
            SVO.IDACCEPT  = (int)cbAccept.SelectedValue;
            SVO.IDPACKING = (int)cbPacking.SelectedValue;
            //SVO.IDMOUNTINGKIT = (int)cbMountingKit.SelectedValue;
            SVO.IDCUSTOMERDEPT = (int)cbCustDept.SelectedValue;
            //SVO.PASSDATE = null;
            SVO.VIEWED         = false;
            SVO.NOTEPDB        = "";
            SVO.DOCSREADY      = false;
            SVO.BILLPAYED      = false;
            SVO.CONTRACTTYPE   = cbCONTRACTTYPE.Text;
            SVO.BILLNUMBER     = tbBillNumber.Text;
            SVO.PACKINGLISTREQ = true;
            SVO.PASSPORTREQ    = true;
            SVO.PLANKAREQ      = true;
            SVO.SERIALREQ      = true;
            SVO.MANUALREQ      = true;

            dbs.AddNewSummon(SVO, UVO);
            //MessageBox.Show("Извещение успешно создано и передано в ОЗиС!");
            this.Close();
        }
Exemplo n.º 21
0
 public ShowSummon(IRole uvo, SummonVO svo)
 {
     this.UVO = uvo;
     this.SVO = svo;
     InitializeComponent();
 }
Exemplo n.º 22
0
        private SummonVO FillSVO(DataRow dataRow)
        {
            SummonVO SVO = new SummonVO();

            SVO.ID = dataRow["ID"].ToString();
            //SVO.ACCEPTANCE = dataRow["ACCEPTANCE"].ToString();
            SVO.CONTRACT = dataRow["CONTRACT"].ToString();
            SVO.CREATED  = (DateTime)dataRow["CREATED"];
            SVO.DELIVERY = dataRow["DELIVERY"].ToString();
            //string tmp = dataRow["IDCURSTATUS"].ToString();
            //SVO.IDCURSTATUS = int.Parse(dataRow["IDCURSTATUS"].ToString());
            SVO.IDCUSTOMER = dataRow["IDCUSTOMER"].ToString();
            SVO.PAYSTATUS  = dataRow["PAYSTATUS"].ToString();
            SVO.IDS        = dataRow["IDS"].ToString();
            SVO.IDSTATUS   = (int)(dataRow["IDSTATUS"]);
            SVO.NOTE       = dataRow["NOTE"].ToString();
            SVO.PTIME      = (DateTime)dataRow["PTIME"];
            SVO.QUANTITY   = (int)dataRow["QUANTITY"];
            SVO.SHIPPING   = dataRow["SHIPPING"].ToString();
            SVO.SISP       = (bool)dataRow["SISP"];
            SVO.IDWPNAME   = (int)dataRow["IDWP"];
            SVO.WPTYPE     = dataRow["WPTYPE"].ToString();
            if (SVO.WPTYPE == "WPNAMELIST")
            {
                SVO.WPTYPEENUM = WPTYPE.WPNAMELIST;
            }
            if (SVO.WPTYPE == "ZHGUTLIST")
            {
                SVO.WPTYPEENUM = WPTYPE.ZHGUTLIST;
            }
            if (SVO.WPTYPE == "CABLELIST")
            {
                SVO.WPTYPEENUM = WPTYPE.CABLELIST;
            }

            SVO.ProductVO = ProductFactory.Create(SVO.IDWPNAME, SVO.WPTYPE);
            //SVO.WPNAME = SVO.ProductVO.GetName();
            SVO.IDACCEPT  = (int)dataRow["IDACCEPT"];
            SVO.IDPACKING = (int)dataRow["IDPACKING"];
            //SVO.IDMOUNTINGKIT = (int)dataRow["IDMOUNTINGKIT"];
            SVO.IDCUSTOMERDEPT = (int)dataRow["IDCUSTOMERDEPT"];
            SVO.VIEWED         = (bool)dataRow["VIEWED"];

            /*if (dataRow["PASSDATE"] == DBNull.Value)
             * {
             *  SVO.PASSDATE = null;
             *  SVO.PASSDATETEXT = "Не определено";
             * }
             * else
             * {
             *  SVO.PASSDATE = (DateTime)dataRow["PASSDATE"];
             *  SVO.PASSDATETEXT = ((DateTime)dataRow["PASSDATE"]).ToString("dd.MM.yyyy");
             * }*/
            SVO.IDSUBST    = (int)dataRow["IDSUBST"];
            SVO.BILLPAYED  = (bool)dataRow["BILLPAYED"];
            SVO.DOCSREADY  = (bool)dataRow["DOCSREADY"];
            SVO.STATUSNAME = new DBCurStatus().GetStatusNameByID(SVO.IDSTATUS);
            if (SVO.IDSUBST == 0)
            {
                SVO.SUBSTATUSNAME = "НЕ ПРИСВОЕНО";
            }
            else
            {
                SVO.SUBSTATUSNAME = new DBCurStatus().GetStatusNameByID(SVO.IDSUBST);
            }
            SVO.CONTRACTTYPE = dataRow["CONTRACTTYPE"].ToString();
            SVO.PLANKA       = dataRow["PLANKA"].ToString();
            SVO.PLANKAREQ    = (bool)dataRow["PLANKAREQ"];
            SVO.SERIAL       = dataRow["SERIAL"].ToString();
            SVO.SERIALREQ    = (bool)dataRow["SERIALREQ"];
            SVO.BILLNUMBER   = dataRow["BILLNUMBER"].ToString();

            SVO.PASSPORT       = dataRow["PASSPORT"].ToString();
            SVO.MANUAL         = dataRow["MANUAL"].ToString();
            SVO.PACKINGLIST    = dataRow["PACKINGLIST"].ToString();
            SVO.PASSPORTREQ    = (bool)dataRow["PASSPORTREQ"];
            SVO.MANUALREQ      = (bool)dataRow["MANUALREQ"];
            SVO.PACKINGLISTREQ = (bool)dataRow["PACKINGLISTREQ"];
            //SVO.LENGTH = dataRow["LENGTH"].ToString();
            //SVO.WIDTH = dataRow["WIDTH"].ToString();
            //SVO.HEIGHT = dataRow["HEIGHT"].ToString();
            //SVO.WEIGHT = dataRow["WEIGHT"].ToString();

            return(SVO);
        }
Exemplo n.º 23
0
 public void Print(SummonVO SVO)
 {
     SVO = SVO.FillReportFields();
 }
Exemplo n.º 24
0
        internal object GetAllStatuses(IRole UVO, SummonVO SVO)
        {
            DS = new DataSet();
            switch (UVO.Role)
            {
            case Roles.Admin:
            case Roles.Director:
                DA.SelectCommand.CommandText = "select ID,SNAME from " + Base.BaseName +
                                               "..STATUSLIST where  ID not in (2,6,11,14,15,16,17,18)";
                DefaultStatus = 2;
                break;

            case Roles.Logist:
                DA.SelectCommand.CommandText = "select ID,'Закрыть извещение' SNAME from " + Base.BaseName +
                                               "..STATUSLIST where  (ID = 13)";
                DefaultStatus = 13;
                break;

            case Roles.Manager:
                DA.SelectCommand.CommandText = "select ID,'ПДБ' SNAME from " + Base.BaseName +
                                               "..STATUSLIST where  ID in (3)";
                DefaultStatus = 3;
                break;

            case Roles.Montage:
            case Roles.MainMontage:
                DA.SelectCommand.CommandText = "select ID,'В ОТК от монтажников' SNAME from " + Base.BaseName +
                                               "..STATUSLIST where ID in (16)";
                DefaultStatus = 16;
                break;

            case Roles.OTK:
                if ((SVO.ProductVO.GetProductType() == WPTYPE.CABLELIST) || (SVO.ProductVO.GetProductType() == WPTYPE.ZHGUTLIST))
                {
                    DA.SelectCommand.CommandText = "select ID, SNAME from " + Base.BaseName +
                                                   "..STATUSLIST where ID in (8,9,18)";
                    DefaultStatus = 9;
                }
                else
                {
                    if (SVO.SISP)
                    {
                        if (SVO.IDSTATUS == 19)
                        {
                            DA.SelectCommand.CommandText = "select ID,'Производство после СИ и СП' SNAME from " + Base.BaseName +
                                                           "..STATUSLIST where ID in (21)";
                            DefaultStatus = 21;
                        }
                        else if (SVO.IDSTATUS == 20)
                        {
                            DA.SelectCommand.CommandText = "select ID,'Цех после СИ и СП' SNAME from " + Base.BaseName +
                                                           "..STATUSLIST where ID in (22)";
                            DefaultStatus = 22;
                        }
                        else
                        {
                            DA.SelectCommand.CommandText = "select ID,'Коммерческий отдел' SNAME from " + Base.BaseName +
                                                           "..STATUSLIST where ID in (9)";
                            DefaultStatus = 9;
                        }
                    }
                    else
                    {
                        DA.SelectCommand.CommandText = "select ID, SNAME from " + Base.BaseName +
                                                       "..STATUSLIST where ID in (8,9)";
                        DefaultStatus = 9;
                    }
                }
                break;

            case Roles.Ozis:
                if ((SVO.ProductVO.GetProductType() == WPTYPE.CABLELIST) || (SVO.ProductVO.GetProductType() == WPTYPE.ZHGUTLIST))
                {
                    DA.SelectCommand.CommandText = "select ID, 'Монтажники' SNAME " +
                                                   " from " + Base.BaseName +
                                                   "..STATUSLIST where  ID in (15)";
                    DefaultStatus = 15;
                }
                else
                {
                    DA.SelectCommand.CommandText = "select ID, 'Производство' SNAME " +
                                                   " from " + Base.BaseName +
                                                   "..STATUSLIST where ID in (4)";
                    DefaultStatus = 4;
                }

                break;

            case Roles.Prod:
                if (SVO.SISP)
                {
                    if (SVO.IDSTATUS == 21)
                    {
                        DA.SelectCommand.CommandText = "select ID, 'Цех' SNAME" +
                                                       " from " + Base.BaseName +
                                                       "..STATUSLIST where ID in (5)";
                        DefaultStatus = 5;
                    }
                    else
                    {
                        DA.SelectCommand.CommandText = "select ID, 'СИ и СП (ОТК - Произ-во)' SNAME" +
                                                       " from " + Base.BaseName +
                                                       "..STATUSLIST where ID in (19)";
                        DefaultStatus = 19;
                    }
                }
                else
                {
                    DA.SelectCommand.CommandText = "select ID, 'Цех' SNAME" +
                                                   " from " + Base.BaseName +
                                                   "..STATUSLIST where ID in (5)";
                    DefaultStatus = 5;
                }
                break;

            case Roles.Ware:
                DA.SelectCommand.CommandText = "select ID,'Отгружается' SNAME from " + Base.BaseName +
                                               "..STATUSLIST where ID in (12)";
                DefaultStatus = 12;
                break;

            case Roles.Wsh:
                if (SVO.SISP)
                {
                    if (SVO.IDSTATUS == 22)
                    {
                        DA.SelectCommand.CommandText = "select ID, 'OTK' SNAME" +
                                                       " from " + Base.BaseName +
                                                       "..STATUSLIST where  ID in (7)";
                        DefaultStatus = 7;
                    }
                    else
                    {
                        DA.SelectCommand.CommandText = "select ID, 'СИ и СП (ОТК - Цех)' SNAME" +
                                                       " from " + Base.BaseName +
                                                       "..STATUSLIST where  ID in (20)";
                        DefaultStatus = 20;
                    }
                }
                else
                {
                    DA.SelectCommand.CommandText = "select ID, 'ОТК' SNAME" +
                                                   " from " + Base.BaseName +
                                                   "..STATUSLIST where ID in (7)";
                    DefaultStatus = 7;
                }
                break;

            default:
                DA.SelectCommand.CommandText = "select ID, 'ОТК' SNAME" +
                                               " from " + Base.BaseName +
                                               "..STATUSLIST where ID in (7777)";
                DefaultStatus = 0;

                break;
            }
            //DA.SelectCommand.CommandText = "select * from " + Base.BaseName + "..STATUSLIST where ID != 14";
            DA.Fill(DS, "t");
            return(DS.Tables["t"]);
        }
Exemplo n.º 25
0
        private void bSave_Click(object sender, EventArgs e)
        {
            if (pickWPName1.textBox1.Text == "")
            {
                MessageBox.Show("Выберите изделие!");
                return;
            }
            if (tbQUANTITY.Value == 0)
            {
                MessageBox.Show("Введите количество изделий!");
                return;
            }
            if (cbCustDept.Items.Count == 0)
            {
                MessageBox.Show("Необходиом добавить хотя бы один отдел заказчика!");
                return;
            }
            DBSummon dbs = new DBSummon();
            SummonVO SVO = new SummonVO();

            SVO.ID  = this.IDNEWSUMMON.ToString();
            SVO.IDS = dbs.GetNextNumber();
            //SVO.ACCEPTANCE = cbAccept.Text;
            SVO.CONTRACT   = tbCONTRACT.Text;
            SVO.CREATED    = DateTime.Now;
            SVO.DELIVERY   = tbDELIVERY.Text;
            SVO.IDCUSTOMER = cbCustomers.SelectedValue.ToString();
            SVO.PAYSTATUS  = tbPAYSTATUS.Text;
            SVO.IDSTATUS   = 1;
            SVO.NOTE       = tbNote.Text;
            SVO.PTIME      = dtpPTIME.Value;
            SVO.QUANTITY   = (int)tbQUANTITY.Value;
            SVO.SHIPPING   = tbSHIPPING.Text;
            if (cbSISP.SelectedIndex == 0)
            {
                SVO.SISP = false;
            }
            else
            {
                SVO.SISP = true;
            }
            SVO.IDACCEPT       = (int)cbAccept.SelectedValue;
            SVO.IDWPNAME       = pickWPName1.PickedProduct.GetID();
            SVO.WPTYPE         = pickWPName1.PickedProduct.GetProductType().ToString();
            SVO.IDPACKING      = (int)cbPacking.SelectedValue;
            SVO.IDCUSTOMERDEPT = (int)cbCustDept.SelectedValue;
            SVO.VIEWED         = true;
            SVO.NOTEPDB        = "";
            SVO.BILLPAYED      = false;
            SVO.DOCSREADY      = false;
            SVO.CONTRACTTYPE   = cbCONTRACTTYPE.Text;
            SVO.BILLNUMBER     = tbBillNumber.Text;

            SVO.PACKINGLISTREQ = true;
            SVO.PASSPORTREQ    = true;
            SVO.PLANKAREQ      = true;
            SVO.SERIALREQ      = true;
            SVO.MANUALREQ      = true;

            /*if (chbDeterm.Checked)
             *  SVO.PASSDATE = null;
             * else
             *  SVO.PASSDATE = dtpAPPROX.Value;*/

            dbs.SaveNewSummon(SVO, UVO);
            tbIDS.Text = SVO.IDS;
            MessageBox.Show("Извещение успешно создано! Извещению присвоен номер: " + SVO.IDS);
            this.Close();
        }
Exemplo n.º 26
0
        internal void SaveSummon(SummonVO SVO)
        {
            DA.UpdateCommand.Parameters.Add("ID", SqlDbType.Int);
            DA.UpdateCommand.Parameters["ID"].Value = SVO.ID;
            //DA.UpdateCommand.Parameters.Add("ACCEPTANCE", SqlDbType.NVarChar);
            //DA.UpdateCommand.Parameters["ACCEPTANCE"].Value = SVO.ACCEPTANCE;
            DA.UpdateCommand.Parameters.Add("CONTRACT", SqlDbType.NVarChar);
            DA.UpdateCommand.Parameters["CONTRACT"].Value = SVO.CONTRACT;
            DA.UpdateCommand.Parameters.Add("CREATED", SqlDbType.DateTime);
            DA.UpdateCommand.Parameters["CREATED"].Value = SVO.CREATED;
            DA.UpdateCommand.Parameters.Add("DELIVERY", SqlDbType.NVarChar);
            DA.UpdateCommand.Parameters["DELIVERY"].Value = SVO.DELIVERY;
            //DA.UpdateCommand.Parameters.Add("IDCURSTATUS", SqlDbType.Int);
            //DA.UpdateCommand.Parameters["IDCURSTATUS"].Value = SVO.IDCURSTATUS;
            DA.UpdateCommand.Parameters.Add("IDCUSTOMER", SqlDbType.Int);
            DA.UpdateCommand.Parameters["IDCUSTOMER"].Value = SVO.IDCUSTOMER;
            DA.UpdateCommand.Parameters.Add("PAYSTATUS", SqlDbType.NVarChar);
            DA.UpdateCommand.Parameters["PAYSTATUS"].Value = SVO.PAYSTATUS;
            DA.UpdateCommand.Parameters.Add("IDS", SqlDbType.NVarChar);
            DA.UpdateCommand.Parameters["IDS"].Value = SVO.IDS;
            //DA.UpdateCommand.Parameters.Add("IDSTATUS", SqlDbType.Int);
            //DA.UpdateCommand.Parameters["IDSTATUS"].Value = SVO.IDSTATUS;
            DA.UpdateCommand.Parameters.Add("NOTE", SqlDbType.NVarChar);
            DA.UpdateCommand.Parameters["NOTE"].Value = SVO.NOTE;
            DA.UpdateCommand.Parameters.Add("PTIME", SqlDbType.DateTime);
            DA.UpdateCommand.Parameters["PTIME"].Value = SVO.PTIME;
            DA.UpdateCommand.Parameters.Add("QUANTITY", SqlDbType.Int);
            DA.UpdateCommand.Parameters["QUANTITY"].Value = SVO.QUANTITY;
            DA.UpdateCommand.Parameters.Add("SHIPPING", SqlDbType.NVarChar);
            DA.UpdateCommand.Parameters["SHIPPING"].Value = SVO.SHIPPING;
            DA.UpdateCommand.Parameters.Add("SISP", SqlDbType.Bit);
            DA.UpdateCommand.Parameters["SISP"].Value = SVO.SISP;
            DA.UpdateCommand.Parameters.Add("IDWP", SqlDbType.Int);
            DA.UpdateCommand.Parameters["IDWP"].Value = SVO.IDWPNAME;
            DA.UpdateCommand.Parameters.Add("WPTYPE", SqlDbType.NVarChar);
            DA.UpdateCommand.Parameters["WPTYPE"].Value = SVO.WPTYPE;
            DA.UpdateCommand.Parameters.Add("IDACCEPT", SqlDbType.Int);
            DA.UpdateCommand.Parameters["IDACCEPT"].Value = SVO.IDACCEPT;
            DA.UpdateCommand.Parameters.Add("IDPACKING", SqlDbType.Int);
            DA.UpdateCommand.Parameters["IDPACKING"].Value = SVO.IDPACKING;
            //DA.UpdateCommand.Parameters.Add("IDMOUNTINGKIT", SqlDbType.Int);
            //DA.UpdateCommand.Parameters["IDMOUNTINGKIT"].Value = SVO.IDMOUNTINGKIT;
            DA.UpdateCommand.Parameters.Add("IDCUSTOMERDEPT", SqlDbType.Int);
            DA.UpdateCommand.Parameters["IDCUSTOMERDEPT"].Value = SVO.IDCUSTOMERDEPT;
            DA.UpdateCommand.Parameters.Add("VIEWED", SqlDbType.Bit);
            DA.UpdateCommand.Parameters["VIEWED"].Value = SVO.VIEWED;
            DA.UpdateCommand.Parameters.Add("CONTRACTTYPE", SqlDbType.NVarChar);
            DA.UpdateCommand.Parameters["CONTRACTTYPE"].Value = SVO.CONTRACTTYPE;

            DA.UpdateCommand.Parameters.Add("PLANKA", SqlDbType.NVarChar);
            DA.UpdateCommand.Parameters["PLANKA"].Value = (((object)SVO.PLANKA) ?? DBNull.Value);
            DA.UpdateCommand.Parameters.Add("PLANKAREQ", SqlDbType.Bit);
            DA.UpdateCommand.Parameters["PLANKAREQ"].Value = SVO.PLANKAREQ;

            DA.UpdateCommand.Parameters.Add("SERIAL", SqlDbType.NVarChar);
            DA.UpdateCommand.Parameters["SERIAL"].Value = (((object)SVO.SERIAL) ?? DBNull.Value);
            DA.UpdateCommand.Parameters.Add("SERIALREQ", SqlDbType.Bit);
            DA.UpdateCommand.Parameters["SERIALREQ"].Value = SVO.SERIALREQ;


            //DA.UpdateCommand.Parameters.Add("PASSDATE", SqlDbType.DateTime);
            //if (SVO.PASSDATE == null)
            //    DA.UpdateCommand.Parameters["PASSDATE"].Value = SqlDateTime.Null;
            //else
            //    DA.UpdateCommand.Parameters["PASSDATE"].Value = SVO.PASSDATE;

            DA.UpdateCommand.Parameters.Add("IDSUBST", SqlDbType.Int);
            DA.UpdateCommand.Parameters["IDSUBST"].Value = SVO.IDSUBST;
            DA.UpdateCommand.Parameters.Add("BILLPAYED", SqlDbType.Bit);
            DA.UpdateCommand.Parameters["BILLPAYED"].Value = SVO.BILLPAYED;
            DA.UpdateCommand.Parameters.Add("DOCSREADY", SqlDbType.Bit);
            DA.UpdateCommand.Parameters["DOCSREADY"].Value = SVO.DOCSREADY;
            DA.UpdateCommand.Parameters.Add("BILLNUMBER", SqlDbType.NVarChar);
            DA.UpdateCommand.Parameters["BILLNUMBER"].Value = SVO.BILLNUMBER;


            DA.UpdateCommand.Parameters.AddWithValue("PASSPORT", ((object)SVO.PASSPORT) ?? DBNull.Value);
            DA.UpdateCommand.Parameters.AddWithValue("MANUAL", ((object)SVO.MANUAL) ?? DBNull.Value);
            DA.UpdateCommand.Parameters.AddWithValue("PACKINGLIST", ((object)SVO.PACKINGLIST) ?? DBNull.Value);
            DA.UpdateCommand.Parameters.AddWithValue("PASSPORTREQ", SVO.PASSPORTREQ);
            DA.UpdateCommand.Parameters.AddWithValue("MANUALREQ", SVO.MANUALREQ);
            DA.UpdateCommand.Parameters.AddWithValue("PACKINGLISTREQ", SVO.PACKINGLISTREQ);

            //DA.UpdateCommand.Parameters.AddWithValue("LENGTH", SVO.LENGTH);
            //DA.UpdateCommand.Parameters.AddWithValue("WIDTH", SVO.WIDTH);
            //DA.UpdateCommand.Parameters.AddWithValue("HEIGHT", SVO.HEIGHT);
            //DA.UpdateCommand.Parameters.AddWithValue("WEIGHT", SVO.WEIGHT);



            //если что-то добавляешь сюда , то добавь и в функцию get summon by ids
            DA.UpdateCommand.CommandText = "update " + Base.BaseName + "..SUMMON set CONTRACT=@CONTRACT,DELIVERY=@DELIVERY,IDCUSTOMER=@IDCUSTOMER,PAYSTATUS=@PAYSTATUS, " +
                                           "NOTE=@NOTE,PTIME=@PTIME,QUANTITY=@QUANTITY,SHIPPING=@SHIPPING,SISP=@SISP,  " +
                                           " IDWP = @IDWP,IDACCEPT = @IDACCEPT,IDPACKING = @IDPACKING, CREATED = @CREATED " +
                                           " , IDCUSTOMERDEPT = @IDCUSTOMERDEPT, VIEWED = @VIEWED , IDS = @IDS " +
                                           " , IDSUBST = @IDSUBST,BILLPAYED=@BILLPAYED,DOCSREADY=@DOCSREADY, WPTYPE = @WPTYPE, CONTRACTTYPE=@CONTRACTTYPE " +
                                           " , PLANKA=@PLANKA, PLANKAREQ = @PLANKAREQ, SERIAL = @SERIAL, SERIALREQ=@SERIALREQ, BILLNUMBER = @BILLNUMBER " +
                                           " , PASSPORT=@PASSPORT, MANUAL=@MANUAL, PACKINGLIST=@PACKINGLIST, PASSPORTREQ=@PASSPORTREQ, MANUALREQ=@MANUALREQ, PACKINGLISTREQ=@PACKINGLISTREQ" +
                                           //" , LENGTH=@LENGTH WIDTH=@WIDTH, HEIGHT=@HEIGHT, WEIGHT=@WEIGHT" +
                                           " where ID = @ID";
            DA.UpdateCommand.Connection.Open();
            DA.UpdateCommand.ExecuteNonQuery();
            DA.UpdateCommand.Connection.Close();
        }