Exemple #1
0
        public DataTable GetName(HoursIndicator Busibject)


        {
            //SametimeServers SametimeObj = new SametimeServers();
            DataTable BsTable = new DataTable();

            try
            {
                //if (Busibject.ID == 0)
                //{
                //    string sqlQuery = "Select * from HoursIndicator where Type='" + Busibject.Type + "' ";
                //    BsTable = objAdaptor.FetchData(sqlQuery);
                //}
                //else
                //{
                string sqlQuery = "Select * from HoursIndicator where (Type='" + Busibject.Type + "')and ID<>" + Busibject.ID + " ";
                BsTable = objAdaptor.FetchData(sqlQuery);
                //}
            }
            catch (Exception)
            {
                throw;
            }
            return(BsTable);
        }
Exemple #2
0
        public bool InsertData(HoursIndicator BusinesshoursObject)

        {
            bool Insert = false;

            try
            {
                DataTable NetworkDevicesDataTable = new DataTable();



                //4/23/2015 NS modified
                string SqlQuery = "INSERT INTO [HoursIndicator] (Type,Starttime,Duration,Issunday,IsMonday" +
                                  ",IsTuesday,IsWednesday,IsThursday,IsFriday,Issaturday,UseType) " +
                                  "VALUES('" + BusinesshoursObject.Type + "','" + BusinesshoursObject.Starttime + "','" + BusinesshoursObject.Duration + "','" + BusinesshoursObject.Issunday +
                                  "','" + BusinesshoursObject.IsMonday + "','" + BusinesshoursObject.IsTuesday + "','" + BusinesshoursObject.IsWednesday +
                                  "','" + BusinesshoursObject.IsThursday + "','" + BusinesshoursObject.IsFriday + "','" + BusinesshoursObject.Issaturday +
                                  "'," + BusinesshoursObject.UseType + ")";
                Insert = objAdaptor.ExecuteNonQuery(SqlQuery);
            }
            catch
            {
                Insert = false;
            }
            finally
            {
            }
            return(Insert);
        }
Exemple #3
0
        protected void btn_Click(object sender, EventArgs e)
        {
            ImageButton btn = (ImageButton)sender;
            // btn.Attributes["onClick"]=
            HoursIndicator ServerObject = new HoursIndicator();

            ServerObject.ID = Convert.ToInt32(btn.CommandArgument);
            id = Convert.ToInt32(btn.CommandArgument);
            string name = btn.AlternateText;

            pnlAreaDtls.Style.Add("visibility", "visible");
            divmsg.InnerHtml = "Are you sure you want to delete the " + name + "?";
        }
Exemple #4
0
        public DataTable GetBusiandOffhoursName(HoursIndicator Busibject)
        {
            DataTable BsTable = new DataTable();

            try
            {
                string sqlQuery = "Select * from HoursIndicator where ID=" + Busibject.ID;
                BsTable = objAdaptor.FetchData(sqlQuery);
            }
            catch (Exception)
            {
                throw;
            }
            return(BsTable);
        }
Exemple #5
0
        public DataTable GetNamebydropdown(HoursIndicator Busibject)

        {
            DataTable BsTable = new DataTable();

            try
            {
                string sqlQuery = "Select * from HoursIndicator where Type='" + Busibject.Type + "' ";
            }
            catch (Exception)
            {
                throw;
            }
            return(BsTable);
        }
        private void Filldata(int ServerKey)
        {
            //ServerKey = int.Parse(Request.QueryString["Key"]);
            HoursIndicator BusinessObjects = new HoursIndicator();
            HoursIndicator ReturnObject    = new HoursIndicator();

            BusinessObjects.ID = ServerKey;

            //ReturnDSObject = VSWebBL.ConfiguratorBL.DominoPropertiesBL.Ins.GetData(DominoServersObject);
            ReturnObject     = VSWebBL.ConfiguratorBL.Businesshoursbl.Ins.GetData(BusinessObjects);
            txttimezone.Text = ReturnObject.Type.ToString();
            //4/22/2015 NS added
            if (ReturnObject.Type.ToString() == "Business Hours")
            {
                txttimezone.Enabled = false;
            }
            MonCheckBox.Checked       = Convert.ToBoolean(ReturnObject.IsMonday.ToString());
            TueCheckBox.Checked       = Convert.ToBoolean(ReturnObject.IsTuesday.ToString());
            WedCheckBox.Checked       = Convert.ToBoolean(ReturnObject.IsWednesday.ToString());
            ThusCheckBox.Checked      = Convert.ToBoolean(ReturnObject.IsThursday.ToString());
            FriCheckBox.Checked       = Convert.ToBoolean(ReturnObject.IsFriday.ToString());
            SatCheckBox.Checked       = Convert.ToBoolean(ReturnObject.Issaturday.ToString());
            SunCheckBox.Checked       = Convert.ToBoolean(ReturnObject.Issunday.ToString());
            MaintDurationTextBox.Text = ReturnObject.Duration.ToString();
            if (ReturnObject.Starttime != null && ReturnObject.Starttime != "")
            {
                DurationTrackBar.Value = ReturnObject.Duration.ToString();
            }
            txttimezone.Text = ReturnObject.Type.ToString();
            if (ReturnObject.Starttime != null && ReturnObject.Starttime != "")
            {
                MaintStartTimeEdit.Text = ReturnObject.Starttime.ToString();
            }

            if (ReturnObject.Starttime != null && ReturnObject.Starttime != "" && ReturnObject.Starttime != null && ReturnObject.Starttime != "")
            {
                lblEndTime.Text = Convert.ToDateTime(ReturnObject.Starttime.ToString()).AddMinutes(Convert.ToDouble(ReturnObject.Duration.ToString())).ToShortTimeString();
            }
            if (MonCheckBox.Checked == true && TueCheckBox.Checked == true && WedCheckBox.Checked == true && ThusCheckBox.Checked == true && FriCheckBox.Checked == true && SatCheckBox.Checked == true && SunCheckBox.Checked == true)
            {
                AllCheckBox.Checked = true;
            }
            //4/23/2015 NS added
            UseDaysRadioButtonList.SelectedIndex = Convert.ToInt32(ReturnObject.UseType.ToString());
        }
Exemple #7
0
        protected void btn_OkClick(object sender, EventArgs e)
        {
            HoursIndicator businessobj = new HoursIndicator();

            businessobj.ID = id;
            Object ReturnValue = VSWebBL.ConfiguratorBL.Businesshoursbl.Ins.DeleteBusinessHoursDetails(businessobj);

            if (Convert.ToBoolean(ReturnValue) == false)
            {
                NavigatorPopupControl.ShowOnPageLoad = true;
                MsgLabel.Text = "This Business Hours cannot be deleted, other dependencies exist.";
            }
            else
            {
                FillBusinesshoursgrid();
                Response.Redirect("~/Configurator/BusinessHoursGrid.aspx", false);
            }
        }
        private HoursIndicator CollectDataForBusinessHours()

        {
            try
            {
                HoursIndicator BusinesshoursObject = new HoursIndicator();

                if (flag == "Update")
                {
                    BusinesshoursObject.ID = ServerKey;
                }
                BusinesshoursObject.Type = txttimezone.Text;
                if (MaintDurationTextBox.Text != null && MaintDurationTextBox.Text != "")
                {
                    //BusinesshoursObject.Duration = Convert.ToInt32(DurationTrackBar.Value.ToString());
                    BusinesshoursObject.Duration = Convert.ToInt32(MaintDurationTextBox.Text);
                }
                else
                {
                    BusinesshoursObject.Duration = null;
                }


                BusinesshoursObject.Starttime = MaintStartTimeEdit.Text;

                BusinesshoursObject.Issunday    = SunCheckBox.Checked;
                BusinesshoursObject.IsMonday    = MonCheckBox.Checked;
                BusinesshoursObject.IsTuesday   = TueCheckBox.Checked;
                BusinesshoursObject.IsWednesday = WedCheckBox.Checked;
                BusinesshoursObject.IsThursday  = ThusCheckBox.Checked;
                BusinesshoursObject.IsFriday    = FriCheckBox.Checked;
                BusinesshoursObject.Issaturday  = SatCheckBox.Checked;
                BusinesshoursObject.UseType     = UseDaysRadioButtonList.SelectedIndex;

                return(BusinesshoursObject);
            }
            catch (Exception ex)
            {
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }
            finally { }
        }
Exemple #9
0
        public bool UpdateAlertDetails(HoursIndicator obj)

        {
            bool Update = false;

            try
            {
                //6/29/2015 NS modified for VSPLUS-1821
                //string SqlQuery = "Update AlertDetails set StartTime='" + obj.Starttime + "',Duration=" + obj.Duration + " where HoursIndicator=" + obj.ID + "";
                string SqlQuery = "UPDATE AlertDetails SET StartTime='" + obj.Starttime + "',Duration=" + obj.Duration + ",Day='" +
                                  obj.Days + "' WHERE HoursIndicator=" + obj.ID + "";

                Update = objAdaptor.ExecuteNonQuery(SqlQuery);
            }
            catch (Exception)
            {
                Update = false;
            }
            return(Update);
        }
Exemple #10
0
        public bool UpdateBusinesshours(HoursIndicator obj)

        {
            bool Update = false;

            try
            {
                //4/23/2015 NS modified
                string SqlQuery = "Update HoursIndicator set Type='" + obj.Type + "',Starttime='" + obj.Starttime + "',Duration='" + obj.Duration + "'," +
                                  " Issunday='" + obj.Issunday + "',IsMonday='" + obj.IsMonday + "',IsTuesday='" + obj.IsTuesday + "',IsWednesday='" + obj.IsWednesday +
                                  "',IsThursday='" + obj.IsThursday + "',IsFriday='" + obj.IsFriday + "',Issaturday='" + obj.Issaturday +
                                  "',UseType=" + obj.UseType.ToString() + " where ID=" + obj.ID + "";

                Update = objAdaptor.ExecuteNonQuery(SqlQuery);
            }
            catch (Exception)
            {
                Update = false;
            }
            return(Update);
        }
Exemple #11
0
        public Object DeleteBusinessHoursDetails(HoursIndicator Business)


        {
            Object Delete;

            try
            {
                string SqlQuery = "Delete from HoursIndicator where ID=" + Business.ID + " and ID not in(0,1)";
                Delete = objAdaptor.ExecuteNonQuery(SqlQuery);
            }
            catch
            {
                Delete = false;
            }
            finally
            {
            }

            return(Delete);
        }
Exemple #12
0
        public DataTable GetBusinesshoursNames()

        {
            DataTable      BusinesshoursnameDataTable = new DataTable();
            HoursIndicator ReturnLOCbject             = new HoursIndicator();

            try
            {
                //3/19/2014 NS modified for VSPLUS-484
                //4/23/2015 NS modified
                string SqlQuery = "SELECT * FROM HoursIndicator WHERE UseType!=0 ORDER BY TYPE";

                BusinesshoursnameDataTable = objAdaptor.FetchData(SqlQuery);
            }
            catch
            {
            }
            finally
            {
            }
            return(BusinesshoursnameDataTable);
        }
Exemple #13
0
        protected void BusinessrGridView_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            try
            {
                HoursIndicator businessobj = new HoursIndicator();

                businessobj.ID = Convert.ToInt32(e.Keys[0]);
                DataTable dt = VSWebBL.ConfiguratorBL.Businesshoursbl.Ins.GetBusiandOffhoursName(businessobj);

                if (dt.Rows[0]["Type"].ToString() == "Business Hours")
                {
                }



                else
                {
                    //Div1.Style.Value = "display:none";
                    Object ReturnValue = VSWebBL.ConfiguratorBL.Businesshoursbl.Ins.DeleteBusinessHoursDetails(businessobj);
                    if (!Convert.ToBoolean(ReturnValue))
                    {
                        MsgLabel.Text = "This Hours Definition may not be deleted. Please re-assign any servers (Maintain Servers) and/or alert definitions (Alert Definitions) before deleting this record.";
                        NavigatorPopupControl.ShowOnPageLoad = true;
                    }
                }
            }
            catch (Exception ex)
            {
                //6/27/2014 NS added for VSPLUS-634
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
            }

            ASPxGridView gridview = (ASPxGridView)sender;

            gridview.CancelEdit();
            e.Cancel = true;
            FillBusinesshoursgrid();
        }
Exemple #14
0
        public HoursIndicator GetDataForBUsinesshrs(HoursIndicator Busibject)
        {
            DataTable      BusinessDataTable = new DataTable();
            HoursIndicator ReturnBUsibject   = new HoursIndicator();
            object         response          = "";

            try
            {
                string SqlQuery = "Select * from HoursIndicator where Type='" + Busibject.Type + "'";
                BusinessDataTable = objAdaptor.FetchData(SqlQuery);
                //populate & return data object
                if (BusinessDataTable.Rows.Count > 0)
                {
                    if (BusinessDataTable.Rows[0]["ID"].ToString() != "")
                    {
                        ReturnBUsibject.ID        = int.Parse(BusinessDataTable.Rows[0]["ID"].ToString());
                        ReturnBUsibject.Starttime = BusinessDataTable.Rows[0]["Starttime"].ToString();
                        if (BusinessDataTable.Rows[0]["Duration"].ToString() != null && BusinessDataTable.Rows[0]["Duration"].ToString() != "")
                        {
                            ReturnBUsibject.Duration = int.Parse(BusinessDataTable.Rows[0]["Duration"].ToString());
                        }
                    }
                }
                else
                {
                    response = 0;
                }
            }
            catch
            {
            }
            finally
            {
            }
            return(ReturnBUsibject);
        }
Exemple #15
0
        public Object DeleteBusinessHoursDetails(HoursIndicator Business)

        {
            //return VSWebDAL.ConfiguratorDAL.AlertsDAL.Ins.DeleteBusinessHoursDetails(Business);
            return(VSWebDAL.ConfiguratorDAL.Businesshoursdal.Ins.DeleteBusinessHoursDetails(Business));
        }
Exemple #16
0
 public HoursIndicator GetData(HoursIndicator BusinessObjects)
 {
     return(VSWebDAL.ConfiguratorDAL.Businesshoursdal.Ins.GetData(BusinessObjects));
 }
Exemple #17
0
        public bool InsertData(HoursIndicator BusinesshoursObject)

        {
            //return VSWebDAL.ConfiguratorDAL.FeedbackDAL.Ins.InsertData(StatusObj);
            return(VSWebDAL.ConfiguratorDAL.Businesshoursdal.Ins.InsertData(BusinesshoursObject));
        }
        private void InsertBusinesshoursData()

        {
            if (flag == "Insert")
            {
                HoursIndicator Busibject = new HoursIndicator();

                Busibject.Type = txttimezone.Text;

                //UrlObj.Name = NameTextBox.Text;
                //DataTable returntable = VSWebBL.ConfiguratorBL.NetworkDevicesBL.Ins.GetIPAddress(Busibject);
                DataTable returntable = VSWebBL.ConfiguratorBL.Businesshoursbl.Ins.GetName(Busibject);
                if (AllCheckBox.Checked || SunCheckBox.Checked || MonCheckBox.Checked || TueCheckBox.Checked || WedCheckBox.Checked || ThusCheckBox.Checked || FriCheckBox.Checked || SatCheckBox.Checked)
                {
                    checks = true;
                }

                if (checks == false)
                {
                    Div1.InnerHtml = "Plase select at least one day." +
                                     "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                    Div1.Style.Value = "display: block";
                    flags            = true;
                }

                else if (Convert.ToInt32(MaintDurationTextBox.Text) == 0)
                {
                    Div1.InnerHtml = "Please enter duration greater than 0." +
                                     "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                    Div1.Style.Value = "display: block";
                    flags            = true;
                }
                else if (returntable.Rows.Count > 0)
                {
                    //3/19/2014 NS modified
                    //ErrorMessageLabel.Text = "This Name or IP Address is already being monitored. Please enter another IP Address or Name.";
                    //ErrorMessagePopupControl.ShowOnPageLoad = true;
                    //10/6/2014 NS modified for VSPLUS-990
                    Div1.InnerHtml = "The Business Hours Name  already exists. Please enter another Name." +
                                     "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                    Div1.Style.Value = "display: block";
                    flags            = true;
                    //IPAddressTextBox.Focus();
                }


                else
                {
                    object ReturnValue = VSWebBL.ConfiguratorBL.Businesshoursbl.Ins.InsertData(CollectDataForBusinessHours());
                }
            }



            if (flag == "Update")
            {
                HoursIndicator Busibject = new HoursIndicator();

                Busibject.Type = txttimezone.Text;
                bool result = false;
                Busibject.ID = ServerKey;
                DataTable returntable = VSWebBL.ConfiguratorBL.Businesshoursbl.Ins.GetName(Busibject);
                if (AllCheckBox.Checked || SunCheckBox.Checked || MonCheckBox.Checked || TueCheckBox.Checked || WedCheckBox.Checked || ThusCheckBox.Checked || FriCheckBox.Checked || SatCheckBox.Checked)
                {
                    checks = true;
                }

                if (checks == false)
                {
                    Div1.InnerHtml = "Plase select at least one day." +
                                     "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                    Div1.Style.Value = "display: block";
                    flags            = true;
                }

                else if (Convert.ToInt32(MaintDurationTextBox.Text) == 0)
                {
                    Div1.InnerHtml = "Please enter duration greater than 0." +
                                     "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                    Div1.Style.Value = "display: block";
                    flags            = true;
                }
                else if (returntable.Rows.Count > 0)
                {
                    //3/19/2014 NS modified
                    //ErrorMessageLabel.Text = "This Name or IP Address is already being monitored. Please enter another IP Address or Name.";
                    //ErrorMessagePopupControl.ShowOnPageLoad = true;
                    //10/6/2014 NS modified for VSPLUS-990
                    Div1.InnerHtml = "This Business Hours Name is already existed. Please enter another Name." +
                                     "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                    Div1.Style.Value = "display: block";
                    flags            = true;
                    //IPAddressTextBox.Focus();
                }
                else
                {
                    result = VSWebBL.ConfiguratorBL.Businesshoursbl.Ins.UpdateBusinesshours(CollectDataForBusinessHours());
                    //successDiv.Style.Value = "display: none";
                }
            }
        }
Exemple #19
0
        //          public DataTable GetDefaultGMT()
        //{


        //               string logopath;
        //              DataTable DefaultGMT = new DataTable();
        //              try
        //              {
        //                  string sqlQuery = "Select GMT from BusinessHours where name='Default'";
        //                  DefaultGMT = objAdaptor.FetchData(sqlQuery);

        //                  5/23/2013 NS modified

        //              }
        //              catch (Exception)
        //              {

        //                  throw;
        //              }

        //              return DefaultGMT;
        //          }
        public HoursIndicator GetData(HoursIndicator BusinessObjects)

        {
            DataTable BusinesshoursDataTable = new DataTable();

            HoursIndicator ReturnDSObject = new HoursIndicator();

            try
            {
                //4/23/2015 NS modified
                string SqlQuery = "select *,ISNULL(UseType,2) UseType2 from HoursIndicator where ID=" + BusinessObjects.ID + "";


                BusinesshoursDataTable = objAdaptor.FetchData(SqlQuery);


                if (BusinesshoursDataTable.Rows.Count > 0)
                {
                    ReturnDSObject.Type = BusinesshoursDataTable.Rows[0]["Type"].ToString();
                    if (BusinesshoursDataTable.Rows[0]["Duration"].ToString() != null && BusinesshoursDataTable.Rows[0]["Duration"].ToString() != "")
                    {
                        ReturnDSObject.Duration = Convert.ToInt32(BusinesshoursDataTable.Rows[0]["Duration"].ToString());
                    }
                    ReturnDSObject.Starttime = BusinesshoursDataTable.Rows[0]["Starttime"].ToString();
                    // ReturnDSObject.Issunday = Convert.ToBoolean(BusinesshoursDataTable.Rows[0]["Issunday"].ToString());
                    if (BusinesshoursDataTable.Rows[0]["Issunday"].ToString() != null && BusinesshoursDataTable.Rows[0]["Issunday"].ToString() != "")
                    {
                        ReturnDSObject.Issunday = Convert.ToBoolean(BusinesshoursDataTable.Rows[0]["Issunday"].ToString());
                    }
                    if (BusinesshoursDataTable.Rows[0]["IsMonday"].ToString() != null && BusinesshoursDataTable.Rows[0]["IsMonday"].ToString() != "")
                    {
                        ReturnDSObject.IsMonday = Convert.ToBoolean(BusinesshoursDataTable.Rows[0]["IsMonday"].ToString());
                    }
                    if (BusinesshoursDataTable.Rows[0]["IsTuesday"].ToString() != null && BusinesshoursDataTable.Rows[0]["IsTuesday"].ToString() != "")
                    {
                        ReturnDSObject.IsTuesday = Convert.ToBoolean(BusinesshoursDataTable.Rows[0]["IsTuesday"].ToString());
                    }
                    if (BusinesshoursDataTable.Rows[0]["IsWednesday"].ToString() != null && BusinesshoursDataTable.Rows[0]["IsWednesday"].ToString() != "")
                    {
                        ReturnDSObject.IsWednesday = Convert.ToBoolean(BusinesshoursDataTable.Rows[0]["IsWednesday"].ToString());
                    }
                    if (BusinesshoursDataTable.Rows[0]["IsThursday"].ToString() != null && BusinesshoursDataTable.Rows[0]["IsThursday"].ToString() != "")
                    {
                        ReturnDSObject.IsThursday = Convert.ToBoolean(BusinesshoursDataTable.Rows[0]["IsThursday"].ToString());
                    }
                    if (BusinesshoursDataTable.Rows[0]["IsFriday"].ToString() != null && BusinesshoursDataTable.Rows[0]["IsFriday"].ToString() != "")
                    {
                        ReturnDSObject.IsFriday = Convert.ToBoolean(BusinesshoursDataTable.Rows[0]["IsFriday"].ToString());
                    }
                    if (BusinesshoursDataTable.Rows[0]["Issaturday"].ToString() != null && BusinesshoursDataTable.Rows[0]["Issaturday"].ToString() != "")
                    {
                        ReturnDSObject.Issaturday = Convert.ToBoolean(BusinesshoursDataTable.Rows[0]["Issaturday"].ToString());
                    }
                    //4/23/2015 NS added
                    ReturnDSObject.UseType = Convert.ToInt32(BusinesshoursDataTable.Rows[0]["UseType2"].ToString());
                }
            }

            catch
            {
            }
            finally
            {
            }
            return(ReturnDSObject);
        }
Exemple #20
0
 public DataTable GetBusiandOffhoursName(HoursIndicator Busibject)
 {
     return(VSWebDAL.ConfiguratorDAL.Businesshoursdal.Ins.GetBusiandOffhoursName(Busibject));
 }
Exemple #21
0
 public bool UpdateAlertDetails(HoursIndicator obj)
 {
     return(VSWebDAL.ConfiguratorDAL.Businesshoursdal.Ins.UpdateAlertDetails(obj));
 }
Exemple #22
0
 public HoursIndicator GetDataForBUsinesshrs(HoursIndicator Busibject)
 {
     return(VSWebDAL.ConfiguratorDAL.Businesshoursdal.Ins.GetDataForBUsinesshrs(Busibject));
 }
        private Servers CollectDataForServers(string Mode, DataRow ServersRow)
        {
            if (ServersRow["ServerType"].ToString() != "Database Availability Group" && ServersRow["IPAddress"].ToString() == "False")
            {
                throw new ArgumentException("Enter IPAddress");
            }
            else
            {
                try
                {
                    Servers ServersObject = new Servers();
                    if (Mode == "Update")
                    {
                        ServersObject.ID = int.Parse(ServersRow["ID"].ToString());
                    }
                    ServersObject.ServerName = ServersRow["ServerName"].ToString();
                    ServersObject.IPAddress  = ServersRow["IPAddress"].ToString();
                    if (ServersRow["MonthlyOperatingCost"].ToString() != "")
                    {
                        ServersObject.MonthlyOperatingCost = Convert.ToDouble(ServersRow["MonthlyOperatingCost"]);
                    }
                    if (ServersRow["IdealUserCount"].ToString() != "")
                    {
                        ServersObject.IdealUserCount = Convert.ToInt32(ServersRow["IdealUserCount"]);
                    }
                    ProfileNames profilenames = new ProfileNames();
                    profilenames.ProfileName = ServersRow["ProfileName"].ToString();
                    //	ServersObject.ProfileName = ServersRow["ProfileName"].ToString();
                    ProfileNames ReturnPname = VSWebBL.SecurityBL.ProfilesNamesBL.Ins.GetDataForLocation1(profilenames);
                    ServersObject.ProfileName = Convert.ToString(ReturnPname.ID);
                    ServersObject.Description = ServersRow["Description"].ToString();
                    ServerTypes STypeobject = new ServerTypes();
                    STypeobject.ServerType = ServersRow["ServerType"].ToString();
                    ServerTypes ReturnValue = VSWebBL.SecurityBL.ServerTypesBL.Ins.GetDataForServerType(STypeobject);
                    ServersObject.ServerTypeID = ReturnValue.ID;

                    //DataTable ReturnValue = VSWebBL.SecurityBL.AdminTabBL.Ins.GetNavigatorByDisplayText(ServersRow["ServerType"].ToString());
                    //ServersObject.ServerTypeID =int.Parse(ReturnValue.Rows[0]["ID"].ToString());

                    //ServersObject.ServerTypeID = ServerTypeComboBox.Text;
                    // ServersObject.LocationID = int.Parse(ServersRow["LocationID"].ToString());
                    //ServersObject.ServerTypeID = int.Parse(ServersRow["ServerType"].ToString());
                    //ServersObject.LocationID = int.Parse(ServersRow["Location"].ToString());
                    Locations LOCobject = new Locations();
                    LOCobject.Location = ServersRow["Location"].ToString();

                    Locations ReturnLocValue = VSWebBL.SecurityBL.LocationsBL.Ins.GetDataForLocation(LOCobject);
                    ServersObject.LocationID = ReturnLocValue.ID;
                    HoursIndicator Busibject = new HoursIndicator();

                    Busibject.Type = ServersRow["Type"].ToString();


                    HoursIndicator ReturnBusiValue = VSWebBL.ConfiguratorBL.Businesshoursbl.Ins.GetDataForBUsinesshrs(Busibject);
                    ServersObject.BusinesshoursID = ReturnBusiValue.ID;


                    return(ServersObject);
                }
                catch (Exception ex)
                {
                    Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                    throw ex;
                }
                finally { }
            }
        }
Exemple #24
0
 public DataTable GetNamebydropdown(HoursIndicator Busibject)
 {
     return(VSWebDAL.ConfiguratorDAL.Businesshoursdal.Ins.GetNamebydropdown(Busibject));
 }
        private void UPdateAlertDetails()
        {
            if (flag == "Update")
            {
                HoursIndicator Busibject = new HoursIndicator();
                Busibject.ID = ServerKey;
                if (MaintDurationTextBox.Text != null && MaintDurationTextBox.Text != "")
                {
                    Busibject.Duration = Convert.ToInt32(MaintDurationTextBox.Text);
                }
                else
                {
                    Busibject.Duration = null;
                }


                Busibject.Starttime = MaintStartTimeEdit.Text;
                //6/29/2015 NS added for VSPLUS-1821
                Busibject.Issunday    = SunCheckBox.Checked;
                Busibject.IsMonday    = MonCheckBox.Checked;
                Busibject.IsTuesday   = TueCheckBox.Checked;
                Busibject.IsWednesday = WedCheckBox.Checked;
                Busibject.IsThursday  = ThusCheckBox.Checked;
                Busibject.IsFriday    = FriCheckBox.Checked;
                Busibject.Issaturday  = SatCheckBox.Checked;
                string day = "";
                if (Busibject.Issunday)
                {
                    day += "Sunday, ";
                }
                if (Busibject.IsMonday)
                {
                    day += "Monday, ";
                }
                if (Busibject.IsTuesday)
                {
                    day += "Tuesday, ";
                }
                if (Busibject.IsWednesday)
                {
                    day += "Wednesday, ";
                }
                if (Busibject.IsThursday)
                {
                    day += "Thursday, ";
                }
                if (Busibject.IsFriday)
                {
                    day += "Friday, ";
                }
                if (Busibject.Issaturday)
                {
                    day += "Saturday";
                }
                if (day != null && day != "")
                {
                    if (day.Substring(day.Length - 1, 1) == ",")
                    {
                        day = day.Substring(0, day.Length - 1);
                    }
                }
                Busibject.Days = day;
                bool result = false;
                result = VSWebBL.ConfiguratorBL.Businesshoursbl.Ins.UpdateAlertDetails(Busibject);
            }
        }