Esempio n. 1
0
        private Boolean updateDashBoard(smrn smrn, int stat)
        {
            Boolean status = true;

            try
            {
                dashboardalarm dsb   = new dashboardalarm();
                DashboardDB    ddsDB = new DashboardDB();
                dsb.DocumentID    = smrn.DocumentID;
                dsb.TemporaryNo   = smrn.SMRNNo;
                dsb.TemporaryDate = smrn.SMRNDate;
                //dsb.DocumentNo = smrn.ProductionPlanNo;
                //dsb.DocumentDate = smrn.ProductionPlanDate;
                dsb.FromUser = Login.userLoggedIn;
                if (stat == 1)
                {
                    dsb.ActivityType = 2;
                    dsb.ToUser       = smrn.ForwardUser;
                    if (!ddsDB.insertDashboardAlarm(dsb))
                    {
                        MessageBox.Show("DashBoard Fail to update");
                        status = false;
                    }
                }
                else if (stat == 2)
                {
                    dsb.ActivityType = 3;
                    List <documentreceiver> docList = DocumentReceiverDB.getDocumentWiseReceiver(prevsh.DocumentID);
                    foreach (documentreceiver docRec in docList)
                    {
                        dsb.ToUser       = docRec.EmployeeID; //To store UserID Form DocumentReceiver for current Document
                        dsb.DocumentDate = UpdateTable.getSQLDateTime();
                        if (!ddsDB.insertDashboardAlarm(dsb))
                        {
                            MessageBox.Show("DashBoard Fail to update");
                            status = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                status = false;
            }
            return(status);
        }
Esempio n. 2
0
        private Boolean updateDashBoard(popiheader popih, int stat)
        {
            Boolean status = true;

            try
            {
                dashboardalarm dsb   = new dashboardalarm();
                DashboardDB    ddsDB = new DashboardDB();
                dsb.DocumentID    = popih.DocumentID;
                dsb.TemporaryNo   = popih.TemporaryNo;
                dsb.TemporaryDate = popih.TemporaryDate;
                dsb.DocumentNo    = popih.TrackingNo;
                dsb.DocumentDate  = popih.TrackingDate;
                dsb.FromUser      = Login.userLoggedIn;
                if (stat == 1)
                {
                    dsb.ActivityType = 2;
                    dsb.ToUser       = popih.ForwardUser;
                    if (!ddsDB.insertDashboardAlarm(dsb))
                    {
                        MessageBox.Show("DashBoard Fail to update");
                        status = false;
                    }
                }
                else if (stat == 2)
                {
                    dsb.ActivityType = 3;
                    List <documentreceiver> docList = DocumentReceiverDB.getDocumentWiseReceiver(MatDel.DocumentID);
                    foreach (documentreceiver docRec in docList)
                    {
                        dsb.ToUser       = docRec.EmployeeID;
                        dsb.DocumentDate = UpdateTable.getSQLDateTime();
                        if (!ddsDB.insertDashboardAlarm(dsb))
                        {
                            MessageBox.Show("DashBoard Fail to update");
                            status = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                status = false;
            }
            return(status);
        }