public static string geteventdesc(string eventid, string companyid)
        {
            clsServer objserver = new clsServer();
            DataSet   ds        = new DataSet();
            string    msg       = "";

            msg = "failure";
            objserver.action    = "getdescription";
            objserver.eventid   = eventid;
            objserver.companyid = companyid;

            try
            {
                ds = objserver.ServerLogDetail();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    msg = ds.Tables[0].Rows[0]["description"].ToString();
                }
                return(msg);
            }
            catch (Exception ex)
            {
                //msg = ex.Message;
                return(msg);
            }
        }
Ejemplo n.º 2
0
        public void filllogentryrepeter()
        {
            objserver.action = "select";
            //objserver = "";
            objserver.nid   = "";
            objserver.logid = hidid.Value;

            objserver.companyid = Session["companyId"].ToString();
            //objserver.clientname = "";
            //objuser.companyid = Session["companyId"].ToString();
            ds = objserver.ServerLogDetail();
            if (ds.Tables[0].Rows.Count > 0)
            {
                // rptlogentry.DataSource = ds;
                // rptlogentry.DataBind();
                //multiview1.ActiveViewIndex = 2;
                //ListItem li = new ListItem("--All Server--", "");
                //ddlserver.Items.Insert(0, li);
                //ddlserver.SelectedIndex = 0;
            }
        }
        /// <summary>
        /// Save Data
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        protected void save(object sender, EventArgs e)
        {
            //objserver.empid = dropemployee.Text;
            objserver.serverid       = ddlserver.Text;
            objserver.clientid       = ddlclient.Text;
            objserver.date           = txtlogdate.Text;
            objserver.ramutilization = rbtnramutilization.Text;
            objserver.cpuutilization = rbtncpuutilization.Text;
            objserver.usedspace      = txt_space.Text + " " + ddlspece.Text;
            objserver.IsUpdated      = rdlupdated.Text;
            objserver.createdby      = Session["userid"].ToString();
            if (objserver.IsUpdated == "Yes")
            {
                objserver.UpdateSummary = txtUpdateSummary.Text;
            }
            else
            {
                objserver.UpdateSummary = "";
            }

            objserver.TakenBackup = rdlbackup.Text;
            if (objserver.TakenBackup == "Yes")
            {
                objserver.BackupDescription = txtbackupdescription.Text;
            }
            else
            {
                objserver.BackupDescription = "";
            }


            objserver.action    = "insert";
            objserver.nid       = hidserverlogid.Value;
            objserver.companyid = Session["companyid"].ToString();
            ds = objserver.ServerLog();
            if (ds.Tables[0].Rows.Count > 0)
            {
                string msg = "";
                msg = "success";
                string[] logtype1 = hidlog.Value.Split(new string[] { "###" }, StringSplitOptions.None);
                string[] eventid1 = hidevent.Value.Split(new string[] { "###" }, StringSplitOptions.None);
                string[] Des1     = hiddes.Value.Split(new string[] { "###" }, StringSplitOptions.None);
                string[] level1   = hidlevel.Value.Split(new string[] { "###" }, StringSplitOptions.None);
                string[] action1  = hidaction.Value.Split(new string[] { "###" }, StringSplitOptions.None);
                string[] remark1  = hidremark.Value.Split(new string[] { "###" }, StringSplitOptions.None);

                try
                {
                    for (int i = 1; i < logtype1.Length; i++)
                    {
                        if (logtype1[i] != "--Select--" && logtype1[i] != "")
                        {
                            objserver.logid         = ds.Tables[0].Rows[0]["nid"].ToString();
                            objserver.nid           = "";
                            objserver.logtype       = logtype1[i];
                            objserver.eventid       = eventid1[i];
                            objserver.description   = Des1[i];
                            objserver.severity      = level1[i];
                            objserver.actionperform = action1[i];
                            objserver.remark        = remark1[i];

                            objserver.ServerLogDetail();
                        }
                    }
                    if (Session["itemtable"] != null)
                    {
                        DataTable itemtable = (DataTable)Session["itemtable"];
                        for (int i = 0; i < itemtable.Rows.Count; i++)
                        {
                            if (itemtable.Rows[i]["attachid"] != null && itemtable.Rows[i]["attachid"].ToString() == "")
                            {
                                objserver.logid            = ds.Tables[0].Rows[0]["nid"].ToString();
                                objserver.nid              = "";
                                objserver.title            = itemtable.Rows[i]["title"].ToString();
                                objserver.originalfilename = itemtable.Rows[i]["originalfilename"].ToString();
                                objserver.uploadfilename   = itemtable.Rows[i]["uploadfilename"].ToString();
                                objserver.action           = "insertfile";
                                objserver.ServerLogDetail();
                            }
                        }
                    }
                    GeneralMethod.alert(this.Page, "Saved Successfully!");
                    blank();
                    txtlogdate.Text     = System.DateTime.Now.ToString("MM/dd/yyyy");
                    rptinner.DataSource = null;
                    rptinner.DataBind();
                    ddlserver.SelectedIndex = 0;
                }

                catch (Exception ex)
                {
                    msg = ex.Message;
                }
            }
        }