Inheritance: MonoBehaviour
Example #1
0
        //Link Button
        #region [Link Button]

        protected void linkbtnView_Click(object sender, EventArgs e)
        {
            try
            {
                lock (this)
                {
                    EWA_Messages ObjEWA = new EWA_Messages();
                    DL_Messages  ObjDL  = new DL_Messages();

                    LinkButton  lnkBtnId  = (LinkButton)sender;
                    GridViewRow grdrow    = lnkBtnId.NamingContainer as GridViewRow;
                    string      MessageId = GrdViewAnnouncement.DataKeys[grdrow.RowIndex].Values["MessageId"].ToString();
                    ObjEWA.MessageId = MessageId;
                    ObjEWA.Action    = "FetchAttachment";
                    dsAttachment     = ObjDL.FetchAttachment(ObjEWA);
                    //GrdAttachement.DataSource = dsAttachment;
                    //GrdAttachement.DataBind();
                    lblFrom.Text       = GrdViewAnnouncement.DataKeys[grdrow.RowIndex].Values["Sender"].ToString();
                    lblSubject.Text    = GrdViewAnnouncement.DataKeys[grdrow.RowIndex].Values["Subject"].ToString();
                    txtMessage.Text    = GrdViewAnnouncement.DataKeys[grdrow.RowIndex].Values["MessageContent"].ToString();
                    txtMessage.Enabled = false;

                    MessagePopUp.Show();
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Example #2
0
        protected void btnSend_Click(object sender, EventArgs e)
        {
            try
            {
                string[] to = txtTo.Text.Split(';');

                foreach (string emailAdd in to)
                {
                    if (!string.IsNullOrEmpty(emailAdd))
                    {
                        SendEmail(emailAdd);
                    }
                }

                txtTo.Text      = "";
                txtSubject.Text = "";
                txtMessage.Text = "";
                lblSent.Text    = "Message sent.";
                MessagePopUp.Show();
            }
            catch
            {
                lblSent.Text = "Message failed.";
                MessagePopUp.Show();
            }
        }
Example #3
0
 public ModelLoadingManager()
 {
     libraryview      = null;
     printerview      = null;
     messagebox       = null;
     informationbox   = null;
     modelLoadedQueue = new ConcurrentQueue <ModelLoadingManager.ModelLoadDetails>();
 }
Example #4
0
 public RecentModelTab(LibraryView libraryView, ModelLoadingManager model_loading_manager, MessagePopUp infobox, GLControl glControl)
 {
     libraryData = new RecentModelHistory();
     this.model_loading_manager = model_loading_manager;
     this.libraryView           = libraryView;
     this.glControl             = glControl;
     this.infobox = infobox;
 }
Example #5
0
 private void Awake()
 {
     if (Instance != this)
     {
         Destroy(gameObject);
     }
     playerRaycast = FindObjectOfType <PlayerRaycast>();
     messagePopUp  = FindObjectOfType <MessagePopUp>();
 }
        public void SendEmptyMessage_IsDisplayedErrorPopUp()
        {
            MessagePopUp messagePopUp = inboxGmailPage.OpenNewMessagePopUp();

            ErrorMessagePopUp errorMessagePopUp = messagePopUp.SendMessage();

            Thread.Sleep(100);

            Assert.IsTrue(errorMessagePopUp.IsDisplayd());
        }
        public void SendMessage_IsSended()
        {
            this.themeOfMessage = "Test method SentMessage";
            this.messageBody    = "sent a message to the method being tested SentMessage()";

            MessagePopUp messagePopUp = inboxGmailPage.OpenNewMessagePopUp();

            messagePopUp.SendFullMessage(this.firstMail, this.themeOfMessage, this.messageBody);

            Assert.IsTrue(inboxGmailPage.GetMessageByTheme(themeOfMessage).Displayed);
        }
        public void SendEmptyMessage_IsDisplayedErrorPopUp()
        {
            MessagePopUp messagePopUp = inboxGmailPage.OpenNewMessagePopUp();

            ErrorMessagePopUp errorMessagePopUp = messagePopUp.SendMessage();

            string errorPopUpTitleText = errorMessagePopUp.GetTitleText();

            Console.WriteLine(errorPopUpTitleText);

            Assert.IsTrue(errorPopUpTitleText.Length > 0);
        }
Example #9
0
 private void InitGUI()
 {
     Locale.GlobalLocale = new Locale(Path.Combine(Paths.ReadOnlyDataFolder, "locales", "English.locale.xml"));
     m_gui_host          = new GUIHost(Locale.GlobalLocale, 11f, Paths.PublicDataFolder, glControl1);
     m_gui_host.OnResize(glControl1.Width, glControl1.Height);
     Sprite.texture_height_pixels = 1024;
     Sprite.texture_width_pixels  = 1024;
     Sprite.pixel_perfect         = true;
     messagebox = new PopupMessageBox(0);
     messagebox.Init(m_gui_host);
     informationbox = new MessagePopUp(0, settingsManager);
     informationbox.Init(m_gui_host);
 }
        public void SendMessageWithAttachedFile_sentCorrectFileExtension()
        {
            this.themeOfMessage = "Message with attached file";
            this.messageBody    = "sent a message to the method being tested SentMessageWithAttachedFile()";
            this.fileName       = "Account.txt";
            this.pathFileName   = controller.GetFilePath(fileName);

            MessagePopUp messagePopUp = inboxGmailPage.OpenNewMessagePopUp();

            messagePopUp.SendMessageWithAttachedFile(this.firstMail, this.themeOfMessage, this.messageBody, pathFileName);

            Assert.IsTrue(inboxGmailPage.GetMessageByFileName(fileName).Displayed);
        }
        public void SendMessageWithAttachedFile_SentMessageWithoutFile()
        {
            this.themeOfMessage = "incorrect file extension";
            this.messageBody    = "sent a message to the method being tested SentMessageWithAttachedFile() with incorrect file extension";
            this.fileName       = "iTechArt.7z";
            this.pathFileName   = controller.GetFilePath(fileName);

            MessagePopUp messagePopUp = inboxGmailPage.OpenNewMessagePopUp();

            messagePopUp.SendMessageWithAttachedFile(this.firstMail, this.themeOfMessage, this.messageBody, pathFileName);
            messagePopUp.ConfirmAlertPopUp();

            Assert.IsTrue(inboxGmailPage.GetMessageByTheme(themeOfMessage).Displayed);
        }
Example #12
0
 public void Init(SettingsManager settings, LibraryView libraryview, PrinterView printerview, PopupMessageBox messagebox, MessagePopUp informationbox)
 {
     this.libraryview    = libraryview;
     this.printerview    = printerview;
     this.settings       = settings;
     this.messagebox     = messagebox;
     this.informationbox = informationbox;
     update_timer        = new System.Windows.Forms.Timer
     {
         Interval = 200
     };
     update_timer.Tick += new EventHandler(on_UpdateTimerTick);
     update_timer.Start();
 }
Example #13
0
        private void ShowMessagePopup(string Message)
        {
            _messagePopup = new MessagePopUp();
            _messagePopup.msg_Label.Content = Message;
            _messagePopup.OkButton.Click   += (a, b) => { _messagePopup.Close(); };

            _messagePopup.CancelButton.Click += (a, b) =>
            {
                _canDeleteUser = false;
                _messagePopup.Close();
            };


            _messagePopup.ShowDialog();
        }
Example #14
0
 public SpoolerConnection(PopupMessageBox messagebox, MessagePopUp informationbox, SettingsManager settingsManager)
 {
     this.messagebox      = messagebox;
     this.informationbox  = informationbox;
     this.settingsManager = settingsManager;
     thread_sync          = new object();
     connected_printers   = new List <PrinterObject>();
     PrinterCount         = new ThreadSafeVariable <int>
     {
         Value = 0
     };
     printerIDList    = new List <string>();
     selected_printer = new ThreadSafeVariable <PrinterObject>
     {
         Value = null
     };
     general_log = new CircularArray <string>(200);
 }
        //Link Button
        #region [Link Button]

        protected void linkbtnView_Click(object sender, EventArgs e)
        {
            try
            {
                lock (this)
                {
                    EWA_Messages ObjEWA = new EWA_Messages();
                    DL_Messages  ObjDL  = new DL_Messages();

                    LinkButton  lnkBtnId  = (LinkButton)sender;
                    GridViewRow grdrow    = lnkBtnId.NamingContainer as GridViewRow;
                    string      MessageId = GrdViewAnnouncement.DataKeys[grdrow.RowIndex].Values["MessageId"].ToString();
                    ObjEWA.MessageId = MessageId;
                    ObjEWA.Action    = "FetchAttachment";
                    dsAttachment     = ObjDL.FetchAttachment(ObjEWA);
                    //GrdAttachement.DataSource = dsAttachment;
                    //GrdAttachement.DataBind();
                    lblFrom.Text = GrdViewAnnouncement.DataKeys[grdrow.RowIndex].Values["Sender"].ToString();
                    // lblSubject.Text = GrdViewAnnouncement.DataKeys[grdrow.RowIndex].Values["Subject"].ToString();
                    string URL1 = GrdViewAnnouncement.DataKeys[grdrow.RowIndex].Values["Subject"].ToString();
                    if (URL1.StartsWith("https://www") || URL1.StartsWith("http://www"))
                    {
                        lnkbtnViewSubjectClick.Text      = URL1;
                        lnkbtnViewSubjectClick.Visible   = true;
                        lnkbtnViewSubjectClick.ForeColor = System.Drawing.Color.Blue;
                    }
                    else
                    {
                        lblSubject.Text    = URL1;
                        lblSubject.Visible = true;
                    }

                    txtMessage.Text    = GrdViewAnnouncement.DataKeys[grdrow.RowIndex].Values["MessageContent"].ToString();
                    txtMessage.Enabled = false;

                    MessagePopUp.Show();
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
        public void SetUp()
        {
            this.driver         = new ChromeDriver();
            this.inboxGmailPage = new InboxGmailPage(this.driver);
            this.messagePopUp   = new MessagePopUp(this.driver);
            this.controller     = new GmailController(this.driver);

            this.firstMail     = controller.GetFirstMail();
            this.firstPassword = controller.GetFirstPassword();

            controller.StartGmail();

            LoginMailPage loginMailPage = new LoginMailPage(this.driver);

            loginMailPage.SetMail(firstMail);
            loginMailPage.GoToPasswordPage();

            LoginPasswordPage loginPasswordPage = new LoginPasswordPage(this.driver);

            loginPasswordPage.SetPassword(firstPassword);
            loginPasswordPage.LoginClick();
        }
Example #17
0
        private void Init(GUIHost host, SettingsManager settingsManager, PopupMessageBox messagebox, MessagePopUp infobox)
        {
            base.SetVisible(false);
            Init(host, "guicontrols", 640f, 320f, 704f, 383f, 41, 8, 64, 35, 8, 64);
            SetSize(792, 356);
            var textWidget = new TextWidget(9);

            textWidget.SetPosition(50, 2);
            textWidget.SetSize(500, 35);
            textWidget.Text      = "Manage Filament Page";
            textWidget.Alignment = QFontAlignment.Left;
            textWidget.Size      = FontSize.Large;
            textWidget.Color     = new Color4(0.5f, 0.5f, 0.5f, 1f);
            AddChildElement(textWidget);
            var buttonWidget = new ButtonWidget(4)
            {
                X = -40,
                Y = 4
            };

            buttonWidget.SetSize(32, 32);
            buttonWidget.Text          = "";
            buttonWidget.TextColor     = new Color4(0.5f, 0.5f, 0.5f, 1f);
            buttonWidget.TextDownColor = new Color4(1f, 1f, 1f, 1f);
            buttonWidget.TextOverColor = new Color4(0.161f, 0.79f, 0.95f, 1f);
            buttonWidget.Alignment     = QFontAlignment.Left;
            buttonWidget.Init(host, "guicontrols", 704f, 320f, 735f, 351f, 736f, 320f, 767f, 351f, 704f, 352f, 735f, 383f);
            buttonWidget.DontMove = true;
            buttonWidget.SetCallback(new ButtonCallback(StartupPageButtonCallback));
            AddChildElement(buttonWidget);
            var frame1 = new Frame(0)
            {
                CenterHorizontallyInParent = true,
                CenterVerticallyInParent   = true,
                RelativeHeight             = 0.9f,
                RelativeWidth = 0.9f
            };

            AddChildElement(frame1);
            frames.Add(new FilamentStartupPage(0, host, this, settingsManager, messagebox));
            frames.Add(new FilamentHeatingNozzle(1, host, this, settingsManager, messagebox));
            frames.Add(new FilamentRetractingFilament(2, host, this));
            frames.Add(new FilamentHasRetractedFilament(3, host, this, settingsManager));
            frames.Add(new FilamentInsertNewFilament(4, host, this));
            frames.Add(new FilamentHasFilamentExited(5, host, this, settingsManager, messagebox));
            frames.Add(new FilamentIsThereFilament(6, host, this, settingsManager));
            frames.Add(new FilamentFilamentColor(7, host, this, settingsManager));
            frames.Add(new FilamentWaitingPage(8, host, this, messagebox));
            frames.Add(new FilamentChangeFilamentDetails(9, host, this, settingsManager, messagebox));
            frames.Add(new FilamentPrimingNozzle(10, host, this));
            frames.Add(new FilamentCheatCodePage(11, host, this, settingsManager, messagebox));
            frames.Add(new FilamentRaisingExtruder(12, host, this, settingsManager, messagebox));
            frames.Add(new FilamentFilamentLocation(13, host, this, settingsManager, messagebox));
            frames.Add(new FilamentInternalSpoolInstructions(14, host, this));
            frames.Add(new FilamentCloseBedInstructions(15, host, this));
            frames.Add(new FilamentRemoveInternalSpoolInstructions(16, host, this));
            frames.Add(new FilamentCleanNozzle(17, host, this));
            frames.Add(new FilamentFilamentSpoolSize(18, host, this, settingsManager, messagebox));
            frames.Add(new FilamentIsNewSpoolPage(19, host, this, settingsManager, infobox));
            foreach (Manage3DInkChildWindow frame2 in frames)
            {
                frame2.Init();
                frame2.Visible = false;
                frame1.AddChildElement(frame2);
            }
        }
Example #18
0
 public Manage3DInkMainWindow(int ID, GUIHost host, SettingsManager main_controller, PopupMessageBox messagebox, MessagePopUp infobox, SpoolerConnection spooler_connection)
     : base(ID, null)
 {
     this.spooler_connection              = spooler_connection;
     spooler_connection.OnPrinterMessage += new SpoolerConnection.PrinterMessageCallback(PrinterMessageCallback);
     Init(host, main_controller, messagebox, infobox);
 }
Example #19
0
 public FilamentIsNewSpoolPage(int ID, GUIHost host, Manage3DInkMainWindow mainWindow, SettingsManager settingsManager, MessagePopUp infobox)
     : base(ID, host, mainWindow)
 {
     this.infobox         = infobox;
     this.settingsManager = settingsManager;
 }
        protected void lnkBtnStudentName_Click(object sender, EventArgs e)
        {
            LinkButton btn = (LinkButton)sender;

            //Get the row that contains this button
            GridViewRow gvr       = (GridViewRow)btn.NamingContainer;
            string      ReceiptNO = grdFees.DataKeys[gvr.RowIndex].Values[0].ToString();
            string      FeesID    = grdFees.DataKeys[gvr.RowIndex].Values[1].ToString();
            string      TransDate = grdFees.DataKeys[gvr.RowIndex].Values[2].ToString();

            lblReceiptNo.Text  = ReceiptNO;
            lblReceiptNo1.Text = ReceiptNO;
            Label1.Text        = txtName.Text;

            lblDate.Text  = TransDate; //todaysdate;
            lblDate1.Text = TransDate; //todaysdate;

            float _tamount = db.getDb_Value("select  sum(Amount) from  tblFeesDetails  where FeesId =" + FeesID + " ");


            float _pamount = db.getDb_Value("select  isnull(sum(paidamount),0) from  tblstudentfeespaid  " +
                                            " where studentid =" + txtStudentId.Text + "");

            lblReceiptNo.Text  = ReceiptNO;
            lblReceiptNo1.Text = ReceiptNO;
            Label1.Text        = txtName.Text;

            string RouteId      = db.getDbstatus_Value("select isnull((select routeid from tblStudentRouteAssign where UserCode = " + txtStudentId.Text + "),0)");
            float  _pamount_bus = db.getDb_Value("select isnull((select sum(paidamount) from tblStudentBusFeesPaid   where  StudentId=" + txtStudentId.Text + "" +
                                                 "  and Studentrouteid=" + RouteId + "),0)");


            float _tamount_bus = db.getDb_Value("select isnull((select amount from tblroute where RouteId=" + RouteId + "),0)");

            _tamount = _tamount + _tamount_bus;
            lblTotalFees_Footer.Text = lblTotalFees_Footer1.Text = _tamount.ToString();
            _pamount = _pamount + _pamount_bus;

            lblPendingFees_Footer.Text = lblPendingFees_Footer1.Text = (_tamount - _pamount).ToString();

            string query = "select remark Particular,'First/Second Term' Term,(select amount from tblfeesdetails where feesdetailsid=tblStudentFeesPaid.feesdetailsid) 'Total Fees',PaidAmount'Received Fees',PendingAmount 'Due Fees'" +
                           " from   tblStudentFeesPaid where studentid='" + txtStudentId.Text + "' and GroupReceiptNo=" + ReceiptNO + "" +
                           "  union all " +
                           "select remark Particular,'First/Second Term' Term,TotalAmount 'Total Fees',PaidAmount'Received Fees',PendingAmount 'Due Fees'" +
                           " from   tblStudentBusFeesPaid where studentid='" + txtStudentId.Text + "' and ReceiptNo=" + ReceiptNO + "";
            DataTable gridDT  = db.Displaygrid(query);
            DataTable gridDT1 = new DataTable();

            gridDT1.Columns.Add("Particular");
            gridDT1.Columns.Add("Term");
            gridDT1.Columns.Add("Total Fees");
            gridDT1.Columns.Add("Received Fees");
            gridDT1.Columns.Add("Due Fees");

            double  TF = 0.00, RF = 0.00, DF = 0.00;
            DataRow dr;

            for (int i = 0; i < gridDT.Rows.Count; i++)
            {
                dr = gridDT1.NewRow();

                dr[0] = gridDT.Rows[i]["Particular"].ToString();
                dr[1] = gridDT.Rows[i]["Term"].ToString();
                dr[2] = gridDT.Rows[i]["Total Fees"].ToString();
                dr[3] = gridDT.Rows[i]["Received Fees"].ToString();
                dr[4] = gridDT.Rows[i]["Due Fees"].ToString();

                TF = TF + Convert.ToDouble(gridDT.Rows[i]["Total Fees"].ToString());
                RF = RF + Convert.ToDouble(gridDT.Rows[i]["Received Fees"].ToString());
                DF = DF + Convert.ToDouble(gridDT.Rows[i]["Due Fees"].ToString());

                gridDT1.Rows.Add(dr);
            }

            dr = gridDT1.NewRow();

            dr[0] = "Total";
            dr[1] = "";
            dr[2] = TF;
            dr[3] = RF;
            dr[4] = DF;

            gridDT1.Rows.Add(dr);


            gridHistory.DataSource = gridDT1;
            gridHistory.DataBind();

            gridHistory1.DataSource = gridDT1;
            gridHistory1.DataBind();

            gridHistory.Rows[gridDT1.Rows.Count - 1].Cells[0].Font.Bold = true;
            gridHistory.Rows[gridDT1.Rows.Count - 1].Cells[2].Font.Bold = true;
            gridHistory.Rows[gridDT1.Rows.Count - 1].Cells[3].Font.Bold = true;
            gridHistory.Rows[gridDT1.Rows.Count - 1].Cells[4].Font.Bold = true;

            gridHistory1.Rows[gridDT1.Rows.Count - 1].Cells[0].Font.Bold = true;
            gridHistory1.Rows[gridDT1.Rows.Count - 1].Cells[2].Font.Bold = true;
            gridHistory1.Rows[gridDT1.Rows.Count - 1].Cells[3].Font.Bold = true;
            gridHistory1.Rows[gridDT1.Rows.Count - 1].Cells[4].Font.Bold = true;


            DataTable co_br_cl = db.Displaygrid("SELECT     (FirstName + ' ' + MiddleName + ' ' + LastName) AS Name,co.CourseName," +
                                                " br.BranchName,cl.ClassName,GRNo,ay.AcademicYear  FROM  tblStudent  st  inner join tblCourse co ON co.CourseId=st.CourseId " +
                                                " inner join tblBranch br ON br.BranchId=st.BranchId  inner join tblClass cl ON cl.ClassId=st.ClassId" +
                                                " inner join tblAcademicYear ay ON ay.AcademicYearId=st.AcademicYearId  where UserCode='" + txtStudentId.Text + "'");

            //Added by Ashwini 23-sep-2020
            DataTable dtClassdtls = db.Displaygrid("select tblcourse.Coursename as CourseName,tblclass.ClassName as ClassName,tblBranch.Branchname as BranchName,tblAcademicYear.AcademicYear as AcademicYear from tblFees left join tblcourse on tblcourse.CourseId=tblFees.CourseId left join tblclass on tblclass.ClassId=tblFees.classId left join tblBranch on tblBranch.BranchId = tblFees.BranchId left join tblAcademicYear on tblAcademicYear.AcademicYearId = tblFees.AcademicYearId where FeesId ='" + FeesID + "'");

            lblCourse.Text        = co_br_cl.Rows[0]["CourseName"].ToString();
            lblCourse1.Text       = lblCourse.Text;
            lblStd.Text           = co_br_cl.Rows[0]["BranchName"].ToString();
            lblStd1.Text          = lblStd.Text;
            lblDiv.Text           = co_br_cl.Rows[0]["ClassName"].ToString();
            lblDiv1.Text          = lblDiv.Text;
            lblAcademicYear.Text  = co_br_cl.Rows[0]["AcademicYear"].ToString();
            lblAcademicYear1.Text = lblAcademicYear.Text;
            //


            lblName.Text  = co_br_cl.Rows[0]["Name"].ToString();
            lblName1.Text = lblName.Text;

            // lblCourse.Text = co_br_cl.Rows[0]["CourseName"].ToString();
            // lblCourse1.Text = lblCourse.Text;

            //lblAcademicYear.Text = co_br_cl.Rows[0]["AcademicYear"].ToString();
            //lblAcademicYear1.Text = lblAcademicYear.Text;

            // lblStd.Text = co_br_cl.Rows[0]["BranchName"].ToString();
            // lblStd1.Text = lblStd.Text;

            // lblDiv.Text = co_br_cl.Rows[0]["ClassName"].ToString();
            // lblDiv1.Text = lblDiv.Text;

            lblGRNo.Text  = co_br_cl.Rows[0]["GRNo"].ToString();
            lblGRNo1.Text = lblGRNo.Text;

            MessagePopUp.Show();
        }
Example #21
0
        //General message
        #region [General Message]

        private void Action(string strAction)
        {
            try
            {
                BL_TimeTableCreation  objBl1  = new BL_TimeTableCreation();
                EWA_TimeTableCreation objEWA1 = new EWA_TimeTableCreation();
                objEWA1.Action       = strAction;
                Session["strAction"] = strAction;

                objEWA1.ClassId    = Convert.ToInt32(ddlClass.SelectedValue.ToString());
                objEWA1.DayId      = Convert.ToInt32(ddlDay.SelectedValue.ToString());
                objEWA1.TimeSlotId = Convert.ToInt32(ddlTimeSlot.SelectedValue.ToString());
                objEWA1.SubEmpId   = Convert.ToInt32(ddlEmployee.SelectedValue.ToString());
                objEWA1.LecNo      = Convert.ToInt32(txtlectureno.Text);

                if (strAction == "Update" || strAction == "Delete")
                {
                    objEWA1.TimeTableId = Convert.ToInt32(ViewState["TimeTableId"].ToString());
                }
                else
                {
                    objEWA1.TimeTableId = 0;
                }

                DataSet ds = objBl1.CheckTimeTable(objEWA1);

                if ((ds.Tables[0].Rows.Count <= 0 && strAction == "Save") || (strAction == "Update" && ds.Tables[0].Rows.Count <= 0) || (strAction == "Update" && ds.Tables[0].Rows[0][0].ToString() == objEWA1.TimeTableId.ToString()) || strAction == "Delete")
                {
                    BL_TimeTableCreation  objBl2   = new BL_TimeTableCreation();
                    EWA_TimeTableCreation objEWA2  = new EWA_TimeTableCreation();
                    BL_TimeTableCreation  objBl22  = new BL_TimeTableCreation();
                    EWA_TimeTableCreation objEWA22 = new EWA_TimeTableCreation();

                    objEWA22.ClassId    = Convert.ToInt32(ddlClass.SelectedValue.ToString());
                    objEWA22.DayId      = Convert.ToInt32(ddlDay.SelectedValue.ToString());
                    objEWA22.TimeSlotId = Convert.ToInt32(ddlTimeSlot.SelectedValue.ToString());
                    objEWA22.SubEmpId   = Convert.ToInt32(ddlEmployee.SelectedValue.ToString());
                    objEWA2.LecNo       = Convert.ToInt32(txtlectureno.Text);
                    DataSet dss = objBl22.Employeetest(objEWA22);
                    if (dss.Tables[0].Rows.Count > 0)
                    {
                        msgBox.ShowMessage("Already lecture assigned to teacher for that day", "Saved", UserControls.MessageBox.MessageStyle.Critical);
                    }

                    objEWA2.ClassId    = Convert.ToInt32(ddlClass.SelectedValue.ToString());
                    objEWA2.DayId      = Convert.ToInt32(ddlDay.SelectedValue.ToString());
                    objEWA2.TimeSlotId = Convert.ToInt32(ddlTimeSlot.SelectedValue.ToString());
                    objEWA2.SubEmpId   = Convert.ToInt32(ddlEmployee.SelectedValue.ToString());
                    objEWA2.LecNo      = Convert.ToInt32(txtlectureno.Text);

                    if (strAction == "Update" || strAction == "Delete")
                    {
                        objEWA2.TimeTableId = Convert.ToInt32(ViewState["TimeTableId"].ToString());
                    }
                    else
                    {
                        objEWA2.TimeTableId = 0;
                    }

                    DataSet ds1 = objBl2.CheckTimeTable1(objEWA2);

                    if ((ds1.Tables[0].Rows.Count <= 0 && strAction == "Save") || (strAction == "Update" && ds1.Tables[0].Rows.Count <= 0) || (strAction == "Update" && ds1.Tables[0].Rows[0][0].ToString() == objEWA1.TimeTableId.ToString()) || strAction == "Delete")
                    {
                        //To check Date According to Current Date
                        DateTime CurrentDate      = DateTime.Now.Date;
                        int      CurrentStartYear = CurrentDate.Year;
                        DateTime CurrentEndYear   = CurrentDate.AddYears(1);
                        int      CurrentMonth     = CurrentDate.Month;

                        BL_TimeTableCreation  objBl  = new BL_TimeTableCreation();
                        EWA_TimeTableCreation objEWA = new EWA_TimeTableCreation();
                        objEWA.Action = strAction;

                        objEWA.ClassId    = Convert.ToInt32(ddlClass.SelectedValue.ToString());
                        objEWA.DayId      = Convert.ToInt32(ddlDay.SelectedValue.ToString());
                        objEWA.TimeSlotId = Convert.ToInt32(ddlTimeSlot.SelectedValue.ToString());
                        objEWA.LecNo      = Convert.ToInt32(txtlectureno.Text);
                        if (strAction == "Update" || strAction == "Delete")
                        {
                            objEWA.TimeTableId = Convert.ToInt32(ViewState["TimeTableId"].ToString());
                        }
                        else
                        {
                            objEWA.TimeTableId = 0;
                        }

                        objEWA.CourseId  = Convert.ToInt32(ddlCourse.SelectedValue.ToString());
                        objEWA.BranchId  = Convert.ToInt32(ddlBranch.SelectedValue.ToString());
                        objEWA.SubjectId = Convert.ToInt32(ddlSubject.SelectedValue.ToString());
                        objEWA.SubEmpId  = Convert.ToInt32(ddlEmployee.SelectedValue.ToString());
                        objEWA.OrgId     = orgId;
                        objEWA.UserId    = Session["UserCode"].ToString();
                        objEWA.IsActive  = "True";
                        objEWA.LecNo     = Convert.ToInt32(txtlectureno.Text);
                        //int flag = objBL.(objEWA);
                        int flag = objBl.TimeTableCreationAction_BL(objEWA);
                        if (flag > 0 && flag != 2)
                        {
                            ClearCntrl();
                            DisableCntrl();
                            BindTimeTable();
                            if (strAction == "Save")
                            {
                                msgBox.ShowMessage("Record Saved Successfully !!!", "Saved", UserControls.MessageBox.MessageStyle.Successfull);
                            }
                            else if (strAction == "Update")
                            {
                                msgBox.ShowMessage("Record Updated Successfully !!!", "Updated", UserControls.MessageBox.MessageStyle.Successfull);
                            }
                            else if (strAction == "Delete")
                            {
                                msgBox.ShowMessage("Record Deleted Successfully !!!", "Deleted", UserControls.MessageBox.MessageStyle.Successfull);
                            }
                        }

                        else if (flag > 0 && flag == 2)
                        {
                            if (strAction == "Save")
                            {
                                msgBox.ShowMessage("Sorry For that day Lecture NO Already Used!!!", "Saved", UserControls.MessageBox.MessageStyle.Critical);
                            }
                            else if (strAction == "Update")
                            {
                                msgBox.ShowMessage("Sorry For that day Lecture NO Already Used !!!", "Updated", UserControls.MessageBox.MessageStyle.Critical);
                            }
                        }
                        else
                        {
                            if (strAction == "Save")
                            {
                                msgBox.ShowMessage("Unable to  Save !!!", "Critical", UserControls.MessageBox.MessageStyle.Critical);
                            }
                            else if (strAction == "Update")
                            {
                                msgBox.ShowMessage("Unable to  Update !!!", "Critical", UserControls.MessageBox.MessageStyle.Critical);
                            }
                            else if (strAction == "Delete")
                            {
                                msgBox.ShowMessage("Unable to  Delete !!!", "Critical", UserControls.MessageBox.MessageStyle.Critical);
                            }
                        }
                    }
                    else
                    {
                        MessagePopUp1.Show();

                        //msgBox.ShowMessage("Already Created !!!", "Critical", UserControls.MessageBox.MessageStyle.Critical);
                        //DialogResult res = MessageBox.Show("Employee Overlap! Are You OK with Employee Overlap?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                        //if (res == DialogResult.Yes)
                        //{

                        //    overlapEmployee(strAction);
                        //}
                        //if (res == DialogResult.No)
                        //{


                        //}
                    }
                }
                else
                {
                    //string message = "Your request is being processed.";
                    //System.Text.StringBuilder sb = new System.Text.StringBuilder();
                    //sb.Append("alert('");
                    //sb.Append(message);
                    //sb.Append("');");
                    //ClientScript.RegisterOnSubmitStatement(this.GetType(), "alert", sb.ToString());

                    MessagePopUp.Show();

                    //DialogResult res = MessageBox.Show("Subject Overlap! Are You OK with Subject Overlap?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                    //if (res == DialogResult.Yes)
                    //{
                    //    //MessageBox.Show("You have clicked Ok Button");
                    //    overlapsubject(strAction);
                    //}
                    //if (res == DialogResult.No)
                    //{
                    //    //MessageBox.Show("You have clicked Cancel Button");

                    //}
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Example #22
0
        public LibraryView(int ID, Element2D parent, GLControl glControl, GUIHost host, MessagePopUp infobox, ModelLoadingManager model_loading_manager)
            : base(ID, parent)
        {
            bUpdateWhenNotVisible        = true;
            m_gui_host                   = host;
            Sprite.texture_height_pixels = 1024;
            Sprite.texture_width_pixels  = 1024;
            m_gui_host.SetFontProperty(FontSize.VeryLarge, 20f);
            m_gui_host.SetFontProperty(FontSize.Large, 14f);
            m_gui_host.SetFontProperty(FontSize.Medium, 11f);
            m_gui_host.SetFontProperty(FontSize.Small, 8f);
            RelativeX      = 0.51f;
            RelativeY      = 0.11f;
            RelativeWidth  = 0.423f;
            RelativeHeight = 0.83f;
            var imageWidget1 = new ImageWidget(1008, null);

            imageWidget1.Init(host, "extendedcontrols3", 3f, 288f, 84f, 374f, 3f, 288f, 84f, 374f, 3f, 288f, 84f, 374f);
            imageWidget1.Text           = "Remove From List";
            imageWidget1.Color          = new Color4(0.5f, 0.5f, 0.5f, 1f);
            imageWidget1.VAlignment     = TextVerticalAlignment.Bottom;
            imageWidget1.TextAreaHeight = 32;
            imageWidget1.ImageAreaWidth = 80;
            imageWidget1.SetSize(80, 115);
            imageWidget1.Visible = false;
            AddChildElement(imageWidget1);
            imageWidget1.SetPosition(-12, -115);
            var imageWidget2 = new ImageWidget(1009, null);

            imageWidget2.Init(host, "extendedcontrols3", 92f, 285f, 173f, 346f, 92f, 285f, 173f, 346f, 92f, 285f, 173f, 346f);
            imageWidget2.Text           = "Save";
            imageWidget2.Color          = new Color4(0.5f, 0.5f, 0.5f, 1f);
            imageWidget2.VAlignment     = TextVerticalAlignment.Bottom;
            imageWidget2.TextAreaHeight = 20;
            imageWidget2.ImageAreaWidth = 81;
            imageWidget2.SetSize(81, 85);
            imageWidget2.Visible = false;
            AddChildElement(imageWidget2);
            imageWidget2.SetPosition(-12, -240);
            search_filter = "";
            var editBoxWidget = new EditBoxWidget(1001, null);

            editBoxWidget.Init(host, "guicontrols", 513f, 0.0f, 608f, 63f);
            editBoxWidget.SetGrowableWidth(40, 16, 64);
            editBoxWidget.Size  = FontSize.Large;
            editBoxWidget.Color = new Color4(0.71f, 0.71f, 0.71f, 1f);
            editBoxWidget.SetTextWindowBorders(48, 16, 22, 16);
            editBoxWidget.SetToolTipRegion(0, 48, 0, 60);
            editBoxWidget.ToolTipMessage = host.Locale.T("T_TOOLTIP_SEARCH");
            editBoxWidget.Hint           = m_gui_host.Locale.T("T_SEARCH");
            tabsFrame = new HorizontalLayout(0, null)
            {
                FixedColumnWidth = true,
                BorderWidth      = 0,
                BorderHeight     = 0,
                RelativeWidth    = 1f
            };
            navigation      = new Frame(0, null);
            navigation_left = new ButtonWidget(1005, null)
            {
                Text   = "",
                X      = 16,
                Y      = 0,
                Width  = 32,
                Height = 32
            };
            navigation_left.SetCallback(new ButtonCallback(MyButtonCallback));
            navigation_left.Init(host, "guicontrols", 608f, 0.0f, 639f, 31f, 640f, 0.0f, 671f, 31f, 672f, 0.0f, 703f, 31f, 704f, 0.0f, 735f, 31f);
            navigation_right = new ButtonWidget(1006, null)
            {
                Text   = "",
                X      = -48,
                Y      = 0,
                Width  = 32,
                Height = 32
            };
            navigation_right.SetCallback(new ButtonCallback(MyButtonCallback));
            navigation_right.Init(host, "guicontrols", 608f, 32f, 639f, 63f, 640f, 32f, 671f, 63f, 672f, 32f, 703f, 63f, 704f, 32f, 735f, 63f);
            pagebuttons = new ButtonWidget[32];
            for (var ID1 = 1032; ID1 <= 1063; ++ID1)
            {
                var index = ID1 - 1032;
                pagebuttons[index] = new ButtonWidget(ID1, null)
                {
                    Text   = "",
                    X      = 48 + (ID1 - 1032) * 24,
                    Y      = 8,
                    Width  = 16,
                    Height = 16
                };
                pagebuttons[index].SetCallback(new ButtonCallback(MyButtonCallback));
                pagebuttons[index].Init(host, "guicontrols", 448f, 192f, 463f, 208f, 480f, 192f, 495f, 208f, 464f, 192f, 479f, 208f);
                pagebuttons[index].DontMove  = true;
                pagebuttons[index].GroupID   = 1;
                pagebuttons[index].ClickType = ButtonType.Checkable;
                pagebuttons[index].Visible   = false;
                navigation.AddChildElement(pagebuttons[index]);
            }
            navigation.AddChildElement(navigation_left);
            navigation.AddChildElement(navigation_right);
            LibraryGrid = new GridLayout(1)
            {
                ColumnWidth  = 130,
                RowHeight    = 150,
                BorderWidth  = 0,
                BorderHeight = 0
            };
            var verticalLayout = new VerticalLayout(0)
            {
                RelativeHeight = 1f,
                RelativeWidth  = 1f,
                BorderHeight   = 10
            };

            verticalLayout.AddChildElement(editBoxWidget, 0, 64 + verticalLayout.BorderHeight);
            verticalLayout.AddChildElement(tabsFrame, 1, 64 + verticalLayout.BorderHeight);
            verticalLayout.AddChildElement(navigation, 2, 32 + verticalLayout.BorderHeight);
            verticalLayout.AddChildElement(LibraryGrid, 3, -1);
            AddChildElement(verticalLayout);
            library_status = new TextWidget(1007)
            {
                Text           = m_gui_host.Locale.T("T_NOMODELS"),
                Size           = FontSize.VeryLarge,
                Alignment      = QFontAlignment.Centre,
                RelativeHeight = 1f,
                RelativeWidth  = 1f,
                X     = 0,
                Y     = 0,
                Color = new Color4(0.9922f, 0.3765f, 0.2471f, 1f)
            };
            AddChildElement(library_status);
            recentModelsTab = new RecentModelTab(this, model_loading_manager, infobox, glControl);
            ButtonWidget buttonWidget = AddTabButton(host, recentModelsTab, LibraryView.TabButtonStyle.Left, m_gui_host.Locale.T("T_RECENT_MODELS"), 1002);

            recentPrintsTab = new RecentPrintsTab(this, model_loading_manager);
            AddTabButton(host, recentPrintsTab, LibraryView.TabButtonStyle.Right, m_gui_host.Locale.T("T_RECENT_PRINTS"), 1004);
            var num = 1;

            buttonWidget.SetChecked(num != 0);
            ShowView(true);
            viewstate = ViewState.Active;
        }