Exemple #1
0
    protected void FindProblemToChangeAttach()
    {
        int incidentid = Convert.ToInt32(Session["incidentid"].ToString());

        foreach (GridViewRow gv in grdvwChange.Rows)
        {
            string gvIDs;
            // Declare local variable deleteChkBxItem of Checkbox type to get the Checkbox Instance of Grid Row
            CheckBox deleteChkBxItem = (CheckBox)gv.FindControl("deleteRec");
            // If deleteChkBxItem is Checked then ,mapped Current site to this user

            int chanid;

            gvIDs  = ((Label)gv.FindControl("Changeid")).Text.ToString();
            chanid = Convert.ToInt32(gvIDs);
            // Check if gvIDs is not null
            if (gvIDs != "")
            {
                ObjincidentToChange = ObjincidentToChange.Get_By_id(incidentid, chanid);

                if (ObjincidentToChange.Changeid != 0)
                {
                    deleteChkBxItem.Checked = true;
                }
            }
        }
    }
    protected void btnAttach_Click(object sender, EventArgs e)
    {
        int incidentid = Convert.ToInt16(Session["incident"].ToString());
        foreach (GridViewRow gv in grdvwChange.Rows)
        {
            string gvIDs;
            // Declare local variable deleteChkBxItem of Checkbox type to get the Checkbox Instance of Grid Row
            CheckBox deleteChkBxItem = (CheckBox)gv.FindControl("deleteRec");
            // If deleteChkBxItem is Checked then ,mapped Current site to this user
            if (deleteChkBxItem.Checked)
            {
                int chanid;

                gvIDs = ((Label)gv.FindControl("Changeid")).Text.ToString();
                chanid = Convert.ToInt16(gvIDs);
                // Check if gvIDs is not null
                if (gvIDs != "")
                {

                    ObjincidentToChange = ObjincidentToChange.Get_By_id(incidentid, chanid);
                    if (ObjincidentToChange.Changeid == 0)
                    {
                        ObjincidentToChange.Changeid = chanid;
                        ObjincidentToChange.Incidentid = incidentid;

                       ObjincidentToChange.Insert();
                    }

                }

            }
        }

        lblErrorMsg.Text = "Change is Attached to Current Problems";
    }
Exemple #3
0
    protected void btnAttach_Click(object sender, EventArgs e)
    {
        int incidentid = Convert.ToInt16(Session["incident"].ToString());

        foreach (GridViewRow gv in grdvwChange.Rows)
        {
            string gvIDs;
            // Declare local variable deleteChkBxItem of Checkbox type to get the Checkbox Instance of Grid Row
            CheckBox deleteChkBxItem = (CheckBox)gv.FindControl("deleteRec");
            // If deleteChkBxItem is Checked then ,mapped Current site to this user
            if (deleteChkBxItem.Checked)
            {
                int chanid;

                gvIDs  = ((Label)gv.FindControl("Changeid")).Text.ToString();
                chanid = Convert.ToInt16(gvIDs);
                // Check if gvIDs is not null
                if (gvIDs != "")
                {
                    ObjincidentToChange = ObjincidentToChange.Get_By_id(incidentid, chanid);
                    if (ObjincidentToChange.Changeid == 0)
                    {
                        ObjincidentToChange.Changeid   = chanid;
                        ObjincidentToChange.Incidentid = incidentid;

                        ObjincidentToChange.Insert();
                    }
                }
            }
        }


        lblErrorMsg.Text = "Change is Attached to Current Problems";
    }
    protected void btnAttach_Click(object sender, EventArgs e)
    {
        //Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            int incidentid = Convert.ToInt32(Session["incident"].ToString());
            foreach (GridViewRow gv in grdvwChange.Rows)
            {
                string gvIDs;
                // Declare local variable deleteChkBxItem of Checkbox type to get the Checkbox Instance of Grid Row
                CheckBox deleteChkBxItem = (CheckBox)gv.FindControl("deleteRec");
                // If deleteChkBxItem is Checked then ,mapped Current site to this user
                if (deleteChkBxItem.Checked)
                {
                    int chanid;

                    gvIDs = ((Label)gv.FindControl("Changeid")).Text.ToString();
                    chanid = Convert.ToInt32(gvIDs);
                    // Check if gvIDs is not null
                    if (gvIDs != "")
                    {

                        ObjincidentToChange = ObjincidentToChange.Get_By_id(incidentid, chanid);
                        if (ObjincidentToChange.Changeid == 0)
                        {
                            ObjincidentToChange.Changeid = chanid;
                            ObjincidentToChange.Incidentid = incidentid;

                            ObjincidentToChange.Insert();
                        }

                    }

                }
            }

            lblErrorMsg.Text = "Change is Attached to Current Problems";
        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
Exemple #5
0
    protected void btnAttach_Click(object sender, EventArgs e)
    {//Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            int incidentid = Convert.ToInt32(Session["incident"].ToString());
            foreach (GridViewRow gv in grdvwChange.Rows)
            {
                string gvIDs;
                // Declare local variable deleteChkBxItem of Checkbox type to get the Checkbox Instance of Grid Row
                CheckBox deleteChkBxItem = (CheckBox)gv.FindControl("deleteRec");
                // If deleteChkBxItem is Checked then ,mapped Current site to this user
                if (deleteChkBxItem.Checked)
                {
                    int chanid;

                    gvIDs  = ((Label)gv.FindControl("Changeid")).Text.ToString();
                    chanid = Convert.ToInt32(gvIDs);
                    // Check if gvIDs is not null
                    if (gvIDs != "")
                    {
                        ObjincidentToChange = ObjincidentToChange.Get_By_id(incidentid, chanid);
                        if (ObjincidentToChange.Changeid == 0)
                        {
                            ObjincidentToChange.Changeid   = chanid;
                            ObjincidentToChange.Incidentid = incidentid;

                            ObjincidentToChange.Insert();
                        }
                    }
                }
            }


            lblErrorMsg.Text = "Change is Attached to Current Problems";
        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        /////Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            //added by lalit on 14 march
            int currentstatus = Convert.ToInt32(ViewState["currentstatus"]);
            //////////////////////////////////////////change done by meenakshi 3rd october 2012
            if (Session["CMDBUpdate"] == "true")
            {
                currentstatus = 14;
            }
            //////////////////////////////////////////end
            string strStatusResolved = Resources.MessageResource.strStatusResolved.ToString();
            int statusidOnresolved = objStatus.Get_By_StatusName(strStatusResolved);
            string statusClose = Resources.MessageResource.strStatusClose.ToString();
            if (currentstatus != statusidOnresolved)
            {
                int statusidClose = objStatus.Get_By_StatusName(statusClose);
                if ((Convert.ToInt32(drpStatus.SelectedValue) == statusidClose))
                {
                    Lblstatusupdatemsg.Text = "You can not close this call. This call is not resolved yet.";
                    return;
                }
            }
            //end
            Incident_To_Change Objincidenttochange = new Incident_To_Change();
            Objincidenttochange = Objincidenttochange.Get_By_Incidentid(Convert.ToInt32(Request.QueryString[0]));
            /////////////////////////////////////////////////change done by meenakshi 3rd oct
            //if (Objincidenttochange.Incidentid != 0 )

            //////////////////////////////////////////////////end
            if (Objincidenttochange.Incidentid != 0 && Session["CMDBUpdate"] != "true")
            {

                string statusOnClose = Resources.MessageResource.strStatusClose.ToString();
                int statusidOnClose = objStatus.Get_By_StatusName(statusOnClose);
                if (Convert.ToInt32(drpStatus.SelectedValue) == statusidOnClose)
                {
                    Session["drpStatus.SelectedValue"] = drpStatus.SelectedValue;
                    Session["drpMode.SelectedValue"] = drpMode.SelectedValue;
                    Session["drpCategory.SelectedValue"] = drpCategory.SelectedValue;
                    Session["drpSubcategory.SelectedValue"] = drpSubcategory.SelectedValue;
                    Session["Incidentidforchange"] = Convert.ToInt32(Request.QueryString[0]);
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "window.open('../CMDB/UpdateCMDB.aspx','popupwindow','width=650,height=400,left=380,top=230,Scrollbars=yes')", "window.open('../CMDB/UpdateCMDB.aspx','popupwindow','width=650,height=400,left=380,top=230,Scrollbars=yes');", true);
                    string myScript;
                    myScript = "<script language=javascript>javascript:window.open('../CMDB/UpdateCMDB.aspx','popupwindow','width=650,height=400,left=380,top=230,Scrollbars=yes');</script>";
                    Page.RegisterClientScriptBlock("MyScript", myScript);

                }
                else
                {
                    FunctionUpdate();

                }
            }
            else { FunctionUpdate(); }

        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
    protected void lnkNewchange_Click(object sender, EventArgs e)
    {
        /////Add Exception handilng try catch change by vishal 21-05-2012
        try
        {

            Incident_To_Change Objincidenttochange = new Incident_To_Change();
            Objincidenttochange = Objincidenttochange.Get_By_Incidentid(Convert.ToInt32(Request.QueryString[0]));
            if (Objincidenttochange.Incidentid == 0)
            {
                Session["incidentid"] = Convert.ToInt32(Request.QueryString[0]);
                string myScript;
                Session["RequestFromProblem"] = "True";
                myScript = "<script language=javascript>javascript:window.open('../Change/CreateChangefromIncident.aspx','popupwindow2','width=950,height=640,left=200,top=250,Scrollbars=yes');</script>";
                Page.RegisterClientScriptBlock("MyScript", myScript);
            }
            else
            {
                string myScript;
                Session["RequestFromProblem"] = "True";
                myScript = "<script language=javascript>javascript:alert('Change request is already opened for this ticket');</script>";
                Page.RegisterClientScriptBlock("MyScript", myScript);
            }
        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
    protected void FindProblemToChangeAttach()
    {
        int incidentid = Convert.ToInt32(Session["incidentid"].ToString());
        foreach (GridViewRow gv in grdvwChange.Rows)
        {
            string gvIDs;
            // Declare local variable deleteChkBxItem of Checkbox type to get the Checkbox Instance of Grid Row
            CheckBox deleteChkBxItem = (CheckBox)gv.FindControl("deleteRec");
            // If deleteChkBxItem is Checked then ,mapped Current site to this user

            int chanid;

            gvIDs = ((Label)gv.FindControl("Changeid")).Text.ToString();
            chanid = Convert.ToInt32(gvIDs);
            // Check if gvIDs is not null
            if (gvIDs != "")
            {

                ObjincidentToChange = ObjincidentToChange.Get_By_id(incidentid, chanid);

                if (ObjincidentToChange.Changeid != 0)
                {
                    deleteChkBxItem.Checked = true;
                }

            }

        }
    }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        Incident_To_Change Objincidenttochange = new Incident_To_Change();
        Objincidenttochange = Objincidenttochange.Get_By_Incidentid(Convert.ToInt16(Request.QueryString[0]));
        if (Objincidenttochange.Incidentid != 0)
        {

            string statusOnClose = Resources.MessageResource.strStatusClose.ToString();
            int statusidOnClose = objStatus.Get_By_StatusName(statusOnClose);
            if (Convert.ToInt16(drpStatus.SelectedValue) == statusidOnClose)
            {
                Session["drpStatus.SelectedValue"] = drpStatus.SelectedValue;
                Session["drpMode.SelectedValue"] = drpMode.SelectedValue;
                Session["drpCategory.SelectedValue"] = drpCategory.SelectedValue;
                Session["drpSubcategory.SelectedValue"] = drpSubcategory.SelectedValue;
                Session["Incidentidforchange"] = Convert.ToInt16(Request.QueryString[0]);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "window.open('../CMDB/UpdateCMDB.aspx','popupwindow','width=650,height=400,left=380,top=230,Scrollbars=yes')", "window.open('../CMDB/UpdateCMDB.aspx','popupwindow','width=650,height=400,left=380,top=230,Scrollbars=yes');", true);
                string myScript;
                myScript = "<script language=javascript>javascript:window.open('../CMDB/UpdateCMDB.aspx','popupwindow','width=650,height=400,left=380,top=230,Scrollbars=yes');</script>";
                Page.RegisterClientScriptBlock("MyScript", myScript);

            }
            else
            {
                FunctionUpdate();

            }
        }
        else { FunctionUpdate(); }
    }
    protected void btnupdate_Click(object sender, EventArgs e)
    {
        TextBox txtp1 = (TextBox)PlaceHolderParams.FindControl("txtparam1Id");
        TextBox txtp2 = (TextBox)PlaceHolderParams.FindControl("txtparam2Id");
        TextBox txtp3 = (TextBox)PlaceHolderParams.FindControl("txtparam3Id");
        TextBox txtp4 = (TextBox)PlaceHolderParams.FindControl("txtparam4Id");
        TextBox txtp5 = (TextBox)PlaceHolderParams.FindControl("txtparam5Id");
        TextBox txtp6 = (TextBox)PlaceHolderParams.FindControl("txtparam6Id");
        TextBox txtp7 = (TextBox)PlaceHolderParams.FindControl("txtparam7Id");
        TextBox txtp8 = (TextBox)PlaceHolderParams.FindControl("txtparam8Id");
        TextBox txtp9 = (TextBox)PlaceHolderParams.FindControl("txtparam9Id");
        TextBox txtp10 = (TextBox)PlaceHolderParams.FindControl("txtparam10Id");
        int Incidentidforchange = Convert.ToInt16(Session["Incidentidforchange"]);
        ObjIncidentochange = ObjIncidentochange.Get_By_Incidentid(Incidentidforchange);
        int changeid = Convert.ToInt16(ObjIncidentochange.Changeid);
        Objincludeasset = Objincludeasset.Get_By_Changeid(changeid);
        int Assetid = Convert.ToInt16(Objincludeasset.Assetid);
        ObjConfiguration = ObjConfiguration.Get_By_id(Assetid);

        int itemid = Convert.ToInt16(ObjConfiguration.Itemid);
        ObjConfigurableitem = ObjConfigurableitem.Get_By_id(itemid);
        ObjCMDB = ObjCMDB.Get_By_id(Assetid);
        //ObjCMDB.Assetid = ObjConfiguration.Assetid;
        CMDB objcmdb = new CMDB();
        objcmdb.Assetid = ObjConfiguration.Assetid;
        if (ObjConfigurableitem.Param1 != "")
        {

            if (txtp1.Text == ObjCMDB.Param1)
            {
                objcmdb.Param1 = txtp1.Text.ToString();
            }
            else
            {
                objcmdb.Param1 = txtp1.Text.ToString();
                Objcmdbtrans.Currentvalue = txtp1.Text.ToString();
                Objcmdbtrans.Previousvalue = ObjCMDB.Param1;
                Objcmdbtrans.Assetid = ObjConfiguration.Assetid;
                Objcmdbtrans.Parametername = ObjConfigurableitem.Param1;
                Objcmdbtrans.Insert();
            }

        }
        else
        {
            objcmdb.Param1 = ObjCMDB.Param1;
        }

        if (ObjConfigurableitem.Param2 != "")
        {

            if (txtp2.Text == ObjCMDB.Param2)
            {
                objcmdb.Param2 = txtp2.Text.ToString();
            }
            else
            {
                objcmdb.Param2 = txtp2.Text.ToString();
                Objcmdbtrans.Currentvalue = txtp2.Text.ToString();
                Objcmdbtrans.Previousvalue = ObjCMDB.Param2;
                Objcmdbtrans.Assetid = ObjConfiguration.Assetid;
                Objcmdbtrans.Parametername = ObjConfigurableitem.Param2;
                Objcmdbtrans.Insert();
            }
        }
        else
        {
            objcmdb.Param2 = ObjCMDB.Param2;
        }

        if (ObjConfigurableitem.Param3 != "")
        {

            if (txtp3.Text == ObjCMDB.Param3)
            {
                objcmdb.Param3 = txtp3.Text.ToString();
            }
            else
            {
                objcmdb.Param3 = txtp3.Text.ToString();
                Objcmdbtrans.Currentvalue = txtp3.Text.ToString();
                Objcmdbtrans.Previousvalue = ObjCMDB.Param3;
                Objcmdbtrans.Assetid = ObjConfiguration.Assetid;
                Objcmdbtrans.Parametername = ObjConfigurableitem.Param3;
                Objcmdbtrans.Insert();
            }

        }
        else
        {
            objcmdb.Param3 = ObjCMDB.Param3;
        }
        if (ObjConfigurableitem.Param4 != "")
        {

            if (txtp4.Text == ObjCMDB.Param4)
            {
                objcmdb.Param4 = txtp4.Text.ToString();
            }
            else
            {
                objcmdb.Param4 = txtp4.Text.ToString();
                Objcmdbtrans.Currentvalue = txtp4.Text.ToString();
                Objcmdbtrans.Previousvalue = ObjCMDB.Param4;
                Objcmdbtrans.Assetid = ObjConfiguration.Assetid;
                Objcmdbtrans.Parametername = ObjConfigurableitem.Param4;
                Objcmdbtrans.Insert();
            }

        }
        else
        {
            objcmdb.Param4 = ObjCMDB.Param4;
        }
        if (ObjConfigurableitem.Param5 != "")
        {

            if (txtp5.Text == ObjCMDB.Param5)
            {
                objcmdb.Param5 = txtp5.Text.ToString();
            }
            else
            {
                objcmdb.Param5 = txtp5.Text.ToString();
                Objcmdbtrans.Currentvalue = txtp5.Text.ToString();
                Objcmdbtrans.Previousvalue = ObjCMDB.Param5;
                Objcmdbtrans.Assetid = ObjConfiguration.Assetid;
                Objcmdbtrans.Parametername = ObjConfigurableitem.Param5;
                Objcmdbtrans.Insert();
            }
        }
        else
        {
            objcmdb.Param5 = ObjCMDB.Param5;
        }

        if (ObjConfigurableitem.Param6 != "")
        {

            if (txtp6.Text == ObjCMDB.Param6)
            {
                objcmdb.Param6 = txtp6.Text.ToString();
            }
            else
            {
                objcmdb.Param6 = txtp6.Text.ToString();
                Objcmdbtrans.Currentvalue = txtp6.Text.ToString();
                Objcmdbtrans.Previousvalue = ObjCMDB.Param6;
                Objcmdbtrans.Assetid = ObjConfiguration.Assetid;
                Objcmdbtrans.Parametername = ObjConfigurableitem.Param6;
                Objcmdbtrans.Insert();
            }
        }
        else
        {
            objcmdb.Param6 = ObjCMDB.Param6;
        }
        if (ObjConfigurableitem.Param7 != "")
        {

            if (txtp7.Text == ObjCMDB.Param7)
            {
                objcmdb.Param7 = txtp7.Text.ToString();
            }
            else
            {
                objcmdb.Param7 = txtp7.Text.ToString();
                Objcmdbtrans.Currentvalue = txtp7.Text.ToString();
                Objcmdbtrans.Previousvalue = ObjCMDB.Param7;
                Objcmdbtrans.Assetid = ObjConfiguration.Assetid;
                Objcmdbtrans.Parametername = ObjConfigurableitem.Param7;
                Objcmdbtrans.Insert();
            }
        }
        else
        {
            objcmdb.Param7 = ObjCMDB.Param7;
        }
        if (ObjConfigurableitem.Param8 != "")
        {

            if (txtp8.Text == ObjCMDB.Param8)
            {
                objcmdb.Param8 = txtp8.Text.ToString();
            }
            else
            {
                objcmdb.Param8 = txtp8.Text.ToString();
                Objcmdbtrans.Currentvalue = txtp8.Text.ToString();
                Objcmdbtrans.Previousvalue = ObjCMDB.Param8;
                Objcmdbtrans.Assetid = ObjConfiguration.Assetid;
                Objcmdbtrans.Parametername = ObjConfigurableitem.Param8;
                Objcmdbtrans.Insert();
            }
        }
        else
        {
            objcmdb.Param8 = ObjCMDB.Param8;
        }
        if (ObjConfigurableitem.Param9 != "")
        {

            if (txtp8.Text == ObjCMDB.Param9)
            {
                objcmdb.Param9 = txtp9.Text.ToString();
            }
            else
            {
                objcmdb.Param9 = txtp9.Text.ToString();
                Objcmdbtrans.Currentvalue = txtp9.Text.ToString();
                Objcmdbtrans.Previousvalue = ObjCMDB.Param9;
                Objcmdbtrans.Assetid = ObjConfiguration.Assetid;
                Objcmdbtrans.Parametername = ObjConfigurableitem.Param9;
                Objcmdbtrans.Insert();
            }
        }
        else
        {
            objcmdb.Param9 = ObjCMDB.Param9;
        }
        if (ObjConfigurableitem.Param10 != "")
        {

            if (txtp10.Text == ObjCMDB.Param10)
            {
                objcmdb.Param10 = txtp10.Text.ToString();
            }
            else
            {
                objcmdb.Param10 = txtp10.Text.ToString();
                Objcmdbtrans.Currentvalue = txtp10.Text.ToString();
                Objcmdbtrans.Previousvalue = ObjCMDB.Param10;
                Objcmdbtrans.Assetid = ObjConfiguration.Assetid;
                Objcmdbtrans.Parametername = ObjConfigurableitem.Param10;
                Objcmdbtrans.Insert();
            }
        }
        else
        {
            objcmdb.Param10 = ObjCMDB.Param10;
        }

        objcmdb.Update();
        Configuration_mst obj = new Configuration_mst();
        obj.Assetid = ObjConfiguration.Assetid;
        obj.Vendorid = ObjConfiguration.Vendorid;
        obj.Itemid = ObjConfiguration.Itemid;
        obj.Serialno = ObjConfiguration.Serialno;
        int versionno = ObjConfiguration.Version;
        versionno = versionno + 1;
        obj.Version = versionno;
        obj.Siteid = ObjConfiguration.Siteid;
        obj.Severity = ObjConfiguration.Severity;
        obj.Purchasedate = ObjConfiguration.Purchasedate;
        obj.Update();
        Session["CMDBUpdate"] = "true";

        string myScript;
        //myScript = "<script language=javascript>javascript:window.close();</script>";
        ScriptManager.RegisterStartupScript(this, this.GetType(), "refreshParent();", "refreshParent();", true);
          //  Page.RegisterClientScriptBlock("MyScript", myScript);
    }
 public int Update_Incident_To_Change_By_id(Incident_To_Change objIncident_To_Change)
 {
     return (int)ExecuteNonQuery(Sp_Incident_To_Change_Update, new object[] { objIncident_To_Change.Changeid, objIncident_To_Change.Incidentid });
 }
 public int Insert_Incident_To_Change(Incident_To_Change objIncident_To_Change)
 {
     return (int)ExecuteNonQuery(Sp_Incident_To_Change_Insert, new object[] { objIncident_To_Change.Changeid, objIncident_To_Change.Incidentid });
 }
    public object GenerateIncidet_to_change_incidentid_mstObject(ref IDataReader returnData)
    {
        Incident_To_Change Obj = new Incident_To_Change();
        while (returnData.Read())
        {
            Obj.Changeid = (int)returnData["Changeid"];
            Obj.Incidentid = (int)returnData["Incidentid"];

        }
        returnData.Close();
        returnData.Dispose();
        return Obj;
    }
    public CollectionBase GenerateIncident_To_Change_mstCollection(ref IDataReader returnData)
    {
        BLLCollection<Incident_To_Change> col = new BLLCollection<Incident_To_Change>();
        while (returnData.Read())
        {

            Incident_To_Change obj = new Incident_To_Change();
            obj.Incidentid = (int)returnData["Incidentid"];
            obj.Changeid = (int)returnData["Changeid"];

            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return col;
    }
Exemple #15
0
    protected void showCMDBValues()
    {
        panalupdatecmdb.Visible = true;

        int Incidentidforchange = Convert.ToInt32(Session["Incidentidforchange"]);

        ObjIncidentochange = ObjIncidentochange.Get_By_Incidentid(Incidentidforchange);
        int changeid = Convert.ToInt32(ObjIncidentochange.Changeid);

        Objincludeasset = Objincludeasset.Get_By_Changeid(changeid);
        int Assetid = Convert.ToInt32(Objincludeasset.Assetid);

        ObjConfiguration = ObjConfiguration.Get_By_id(Assetid);

        int itemid = Convert.ToInt32(ObjConfiguration.Itemid);

        ObjConfigurableitem = ObjConfigurableitem.Get_By_id(itemid);
        ObjCMDB             = ObjCMDB.Get_By_id(Assetid);
        Objchange           = Objchange.Get_By_id(changeid);
        int categoryid = Convert.ToInt32(Objchange.Categoryid);

        Objcategory = Objcategory.Get_By_id(categoryid);
        if (categoryid != 0)
        {
            lblcategory.Text = Objcategory.CategoryName.ToString();
        }

        int Subcategoryid = Convert.ToInt32(Objchange.Subcategoryid);

        Objsubcategory = Objsubcategory.Get_By_id(Subcategoryid);
        if (Subcategoryid != 0)
        {
            lblsubcategory.Text = Objsubcategory.Subcategoryname.ToString();
        }

        lblassetid.Text = ObjConfiguration.Assetid.ToString();
        int itemid1 = Convert.ToInt32(ObjConfiguration.Itemid);

        Objcategory      = Objcategory.Get_By_id(itemid1);
        lblitemname.Text = Objcategory.CategoryName.ToString();
        Objvendor        = Objvendor.Get_By_id(ObjConfiguration.Vendorid);
        lblvendor.Text   = Objvendor.Vendorname.ToString();
        lblchangeid.Text = Objchange.Changeid.ToString();
        lblserialno.Text = ObjConfiguration.Serialno.ToString();
        int changetypid = Convert.ToInt32(Objchange.Changetype);

        Objchangetype      = Objchangetype.Get_By_id(changetypid);
        lblchangetype.Text = Objchangetype.Changetypename.ToString();
        lbltitle.Text      = Objchange.Title.ToString();
        if (ObjConfigurableitem.Param1 != "")
        {
            txtparam1.Visible = true;
            lblparam1.Text    = ObjConfigurableitem.Param1.ToString();
            txtparam1.Text    = ObjCMDB.Param1.ToString();
        }
        if (ObjConfigurableitem.Param2 != "")
        {
            txtparam2.Visible = true;
            lblparam2.Text    = ObjConfigurableitem.Param2.ToString();
            txtparam2.Text    = ObjCMDB.Param2.ToString();
        }

        if (ObjConfigurableitem.Param3 != "")
        {
            txtparam3.Visible = true;
            lblparam3.Text    = ObjConfigurableitem.Param3.ToString();
            txtparam3.Text    = ObjCMDB.Param3.ToString();
        }

        if (ObjConfigurableitem.Param4 != "")
        {
            txtparam4.Visible = true;
            lblparam4.Text    = ObjConfigurableitem.Param4.ToString();
            txtparam4.Text    = ObjCMDB.Param4.ToString();
        }

        if (ObjConfigurableitem.Param5 != "")
        {
            txtparam5.Visible = true;
            lblparam5.Text    = ObjConfigurableitem.Param5.ToString();
            txtparam5.Text    = ObjCMDB.Param5.ToString();
        }

        if (ObjConfigurableitem.Param6 != "")
        {
            txtparam6.Visible = true;
            lblparam6.Text    = ObjConfigurableitem.Param6.ToString();
            txtparam6.Text    = ObjCMDB.Param6.ToString();
        }
        if (ObjConfigurableitem.Param7 != "")
        {
            txtparam7.Visible = true;
            lblparam7.Text    = ObjConfigurableitem.Param7.ToString();
            txtparam7.Text    = ObjCMDB.Param7.ToString();
        }

        if (ObjConfigurableitem.Param8 != "")
        {
            txtparam8.Visible = true;
            lblparam8.Text    = ObjConfigurableitem.Param8.ToString();
            txtparam8.Text    = ObjCMDB.Param8.ToString();
        }

        if (ObjConfigurableitem.Param9 != "")
        {
            txtparam9.Visible = true;
            lblparam9.Text    = ObjConfigurableitem.Param9.ToString();
            txtparam9.Text    = ObjCMDB.Param9.ToString();
        }
        if (ObjConfigurableitem.Param10 != "")
        {
            txtparam10.Visible = true;
            lblparam10.Text    = ObjConfigurableitem.Param10.ToString();
            txtparam10.Text    = ObjCMDB.Param10.ToString();
        }
    }
Exemple #16
0
    protected void btnupdate_Click(object sender, EventArgs e)
    {///Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            TextBox txtp1  = (TextBox)PlaceHolderParams.FindControl("txtparam1Id");
            TextBox txtp2  = (TextBox)PlaceHolderParams.FindControl("txtparam2Id");
            TextBox txtp3  = (TextBox)PlaceHolderParams.FindControl("txtparam3Id");
            TextBox txtp4  = (TextBox)PlaceHolderParams.FindControl("txtparam4Id");
            TextBox txtp5  = (TextBox)PlaceHolderParams.FindControl("txtparam5Id");
            TextBox txtp6  = (TextBox)PlaceHolderParams.FindControl("txtparam6Id");
            TextBox txtp7  = (TextBox)PlaceHolderParams.FindControl("txtparam7Id");
            TextBox txtp8  = (TextBox)PlaceHolderParams.FindControl("txtparam8Id");
            TextBox txtp9  = (TextBox)PlaceHolderParams.FindControl("txtparam9Id");
            TextBox txtp10 = (TextBox)PlaceHolderParams.FindControl("txtparam10Id");
            int     Incidentidforchange = Convert.ToInt32(Session["Incidentidforchange"]);
            ObjIncidentochange = ObjIncidentochange.Get_By_Incidentid(Incidentidforchange);
            int changeid = Convert.ToInt32(ObjIncidentochange.Changeid);
            Objincludeasset = Objincludeasset.Get_By_Changeid(changeid);
            int Assetid = Convert.ToInt32(Objincludeasset.Assetid);
            ObjConfiguration = ObjConfiguration.Get_By_id(Assetid);

            int itemid = Convert.ToInt32(ObjConfiguration.Itemid);
            ObjConfigurableitem = ObjConfigurableitem.Get_By_id(itemid);
            ObjCMDB             = ObjCMDB.Get_By_id(Assetid);
            //ObjCMDB.Assetid = ObjConfiguration.Assetid;
            CMDB objcmdb = new CMDB();
            objcmdb.Assetid = ObjConfiguration.Assetid;
            if (ObjConfigurableitem.Param1 != "")
            {
                if (txtp1.Text == ObjCMDB.Param1)
                {
                    objcmdb.Param1 = txtp1.Text.ToString();
                }
                else
                {
                    objcmdb.Param1             = txtp1.Text.ToString();
                    Objcmdbtrans.Currentvalue  = txtp1.Text.ToString();
                    Objcmdbtrans.Previousvalue = ObjCMDB.Param1;
                    Objcmdbtrans.Assetid       = ObjConfiguration.Assetid;
                    Objcmdbtrans.Parametername = ObjConfigurableitem.Param1;
                    Objcmdbtrans.Insert();
                }
            }
            else
            {
                objcmdb.Param1 = ObjCMDB.Param1;
            }

            if (ObjConfigurableitem.Param2 != "")
            {
                if (txtp2.Text == ObjCMDB.Param2)
                {
                    objcmdb.Param2 = txtp2.Text.ToString();
                }
                else
                {
                    objcmdb.Param2             = txtp2.Text.ToString();
                    Objcmdbtrans.Currentvalue  = txtp2.Text.ToString();
                    Objcmdbtrans.Previousvalue = ObjCMDB.Param2;
                    Objcmdbtrans.Assetid       = ObjConfiguration.Assetid;
                    Objcmdbtrans.Parametername = ObjConfigurableitem.Param2;
                    Objcmdbtrans.Insert();
                }
            }
            else
            {
                objcmdb.Param2 = ObjCMDB.Param2;
            }

            if (ObjConfigurableitem.Param3 != "")
            {
                if (txtp3.Text == ObjCMDB.Param3)
                {
                    objcmdb.Param3 = txtp3.Text.ToString();
                }
                else
                {
                    objcmdb.Param3             = txtp3.Text.ToString();
                    Objcmdbtrans.Currentvalue  = txtp3.Text.ToString();
                    Objcmdbtrans.Previousvalue = ObjCMDB.Param3;
                    Objcmdbtrans.Assetid       = ObjConfiguration.Assetid;
                    Objcmdbtrans.Parametername = ObjConfigurableitem.Param3;
                    Objcmdbtrans.Insert();
                }
            }
            else
            {
                objcmdb.Param3 = ObjCMDB.Param3;
            }
            if (ObjConfigurableitem.Param4 != "")
            {
                if (txtp4.Text == ObjCMDB.Param4)
                {
                    objcmdb.Param4 = txtp4.Text.ToString();
                }
                else
                {
                    objcmdb.Param4             = txtp4.Text.ToString();
                    Objcmdbtrans.Currentvalue  = txtp4.Text.ToString();
                    Objcmdbtrans.Previousvalue = ObjCMDB.Param4;
                    Objcmdbtrans.Assetid       = ObjConfiguration.Assetid;
                    Objcmdbtrans.Parametername = ObjConfigurableitem.Param4;
                    Objcmdbtrans.Insert();
                }
            }
            else
            {
                objcmdb.Param4 = ObjCMDB.Param4;
            }
            if (ObjConfigurableitem.Param5 != "")
            {
                if (txtp5.Text == ObjCMDB.Param5)
                {
                    objcmdb.Param5 = txtp5.Text.ToString();
                }
                else
                {
                    objcmdb.Param5             = txtp5.Text.ToString();
                    Objcmdbtrans.Currentvalue  = txtp5.Text.ToString();
                    Objcmdbtrans.Previousvalue = ObjCMDB.Param5;
                    Objcmdbtrans.Assetid       = ObjConfiguration.Assetid;
                    Objcmdbtrans.Parametername = ObjConfigurableitem.Param5;
                    Objcmdbtrans.Insert();
                }
            }
            else
            {
                objcmdb.Param5 = ObjCMDB.Param5;
            }

            if (ObjConfigurableitem.Param6 != "")
            {
                if (txtp6.Text == ObjCMDB.Param6)
                {
                    objcmdb.Param6 = txtp6.Text.ToString();
                }
                else
                {
                    objcmdb.Param6             = txtp6.Text.ToString();
                    Objcmdbtrans.Currentvalue  = txtp6.Text.ToString();
                    Objcmdbtrans.Previousvalue = ObjCMDB.Param6;
                    Objcmdbtrans.Assetid       = ObjConfiguration.Assetid;
                    Objcmdbtrans.Parametername = ObjConfigurableitem.Param6;
                    Objcmdbtrans.Insert();
                }
            }
            else
            {
                objcmdb.Param6 = ObjCMDB.Param6;
            }
            if (ObjConfigurableitem.Param7 != "")
            {
                if (txtp7.Text == ObjCMDB.Param7)
                {
                    objcmdb.Param7 = txtp7.Text.ToString();
                }
                else
                {
                    objcmdb.Param7             = txtp7.Text.ToString();
                    Objcmdbtrans.Currentvalue  = txtp7.Text.ToString();
                    Objcmdbtrans.Previousvalue = ObjCMDB.Param7;
                    Objcmdbtrans.Assetid       = ObjConfiguration.Assetid;
                    Objcmdbtrans.Parametername = ObjConfigurableitem.Param7;
                    Objcmdbtrans.Insert();
                }
            }
            else
            {
                objcmdb.Param7 = ObjCMDB.Param7;
            }
            if (ObjConfigurableitem.Param8 != "")
            {
                if (txtp8.Text == ObjCMDB.Param8)
                {
                    objcmdb.Param8 = txtp8.Text.ToString();
                }
                else
                {
                    objcmdb.Param8             = txtp8.Text.ToString();
                    Objcmdbtrans.Currentvalue  = txtp8.Text.ToString();
                    Objcmdbtrans.Previousvalue = ObjCMDB.Param8;
                    Objcmdbtrans.Assetid       = ObjConfiguration.Assetid;
                    Objcmdbtrans.Parametername = ObjConfigurableitem.Param8;
                    Objcmdbtrans.Insert();
                }
            }
            else
            {
                objcmdb.Param8 = ObjCMDB.Param8;
            }
            if (ObjConfigurableitem.Param9 != "")
            {
                if (txtp8.Text == ObjCMDB.Param9)
                {
                    objcmdb.Param9 = txtp9.Text.ToString();
                }
                else
                {
                    objcmdb.Param9             = txtp9.Text.ToString();
                    Objcmdbtrans.Currentvalue  = txtp9.Text.ToString();
                    Objcmdbtrans.Previousvalue = ObjCMDB.Param9;
                    Objcmdbtrans.Assetid       = ObjConfiguration.Assetid;
                    Objcmdbtrans.Parametername = ObjConfigurableitem.Param9;
                    Objcmdbtrans.Insert();
                }
            }
            else
            {
                objcmdb.Param9 = ObjCMDB.Param9;
            }
            if (ObjConfigurableitem.Param10 != "")
            {
                if (txtp10.Text == ObjCMDB.Param10)
                {
                    objcmdb.Param10 = txtp10.Text.ToString();
                }
                else
                {
                    objcmdb.Param10            = txtp10.Text.ToString();
                    Objcmdbtrans.Currentvalue  = txtp10.Text.ToString();
                    Objcmdbtrans.Previousvalue = ObjCMDB.Param10;
                    Objcmdbtrans.Assetid       = ObjConfiguration.Assetid;
                    Objcmdbtrans.Parametername = ObjConfigurableitem.Param10;
                    Objcmdbtrans.Insert();
                }
            }
            else
            {
                objcmdb.Param10 = ObjCMDB.Param10;
            }

            objcmdb.Update();
            Configuration_mst obj = new Configuration_mst();
            obj.Assetid  = ObjConfiguration.Assetid;
            obj.Vendorid = ObjConfiguration.Vendorid;
            obj.Itemid   = ObjConfiguration.Itemid;
            obj.Serialno = ObjConfiguration.Serialno;
            int versionno = ObjConfiguration.Version;
            versionno        = versionno + 1;
            obj.Version      = versionno;
            obj.Siteid       = ObjConfiguration.Siteid;
            obj.Severity     = ObjConfiguration.Severity;
            obj.Purchasedate = ObjConfiguration.Purchasedate;
            obj.Update();
            Session["CMDBUpdate"] = "true";

            string myScript;
            //myScript = "<script language=javascript>javascript:window.close();</script>";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "refreshParent();", "refreshParent();", true);
            //  Page.RegisterClientScriptBlock("MyScript", myScript);
        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
    protected void showCMDBValues()
    {
        panalupdatecmdb.Visible = true;

        int Incidentidforchange = Convert.ToInt16(Session["Incidentidforchange"]);
        ObjIncidentochange = ObjIncidentochange.Get_By_Incidentid(Incidentidforchange);
        int changeid = Convert.ToInt16(ObjIncidentochange.Changeid);
        Objincludeasset = Objincludeasset.Get_By_Changeid(changeid);
        int Assetid = Convert.ToInt16(Objincludeasset.Assetid);
        ObjConfiguration = ObjConfiguration.Get_By_id(Assetid);

        int itemid = Convert.ToInt16(ObjConfiguration.Itemid);
        ObjConfigurableitem = ObjConfigurableitem.Get_By_id(itemid);
        ObjCMDB = ObjCMDB.Get_By_id(Assetid);
        Objchange = Objchange.Get_By_id(changeid);
        int categoryid = Convert.ToInt16(Objchange.Categoryid);
        Objcategory = Objcategory.Get_By_id(categoryid);
        if (categoryid != 0)
        {
            lblcategory.Text = Objcategory.CategoryName.ToString();
        }

        int Subcategoryid = Convert.ToInt16(Objchange.Subcategoryid);
        Objsubcategory = Objsubcategory.Get_By_id(Subcategoryid);
        if (Subcategoryid != 0)
        {
            lblsubcategory.Text = Objsubcategory.Subcategoryname.ToString();
        }

        lblassetid.Text = ObjConfiguration.Assetid.ToString();
        int itemid1=Convert.ToInt16(ObjConfiguration.Itemid);
        Objcategory = Objcategory.Get_By_id(itemid1);
        lblitemname.Text = Objcategory.CategoryName.ToString();
        Objvendor = Objvendor.Get_By_id(ObjConfiguration.Vendorid);
        lblvendor.Text = Objvendor.Vendorname.ToString();
        lblchangeid.Text = Objchange.Changeid.ToString();
        lblserialno.Text = ObjConfiguration.Serialno.ToString();
        int changetypid=Convert.ToInt16(Objchange.Changetype);
        Objchangetype = Objchangetype.Get_By_id(changetypid);
        lblchangetype.Text = Objchangetype.Changetypename.ToString();
        lbltitle.Text = Objchange.Title.ToString();
        if (ObjConfigurableitem.Param1 != "")
        {
            txtparam1.Visible = true;
            lblparam1.Text = ObjConfigurableitem.Param1.ToString();
            txtparam1.Text = ObjCMDB.Param1.ToString();

        }
        if (ObjConfigurableitem.Param2 != "")
        {
            txtparam2.Visible = true;
            lblparam2.Text = ObjConfigurableitem.Param2.ToString();
            txtparam2.Text = ObjCMDB.Param2.ToString();

        }

        if (ObjConfigurableitem.Param3 != "")
        {
            txtparam3.Visible = true;
            lblparam3.Text = ObjConfigurableitem.Param3.ToString();
            txtparam3.Text = ObjCMDB.Param3.ToString();

        }

        if (ObjConfigurableitem.Param4 != "")
        {
            txtparam4.Visible = true;
            lblparam4.Text = ObjConfigurableitem.Param4.ToString();
            txtparam4.Text = ObjCMDB.Param4.ToString();
        }

        if (ObjConfigurableitem.Param5 != "")
        {
            txtparam5.Visible = true;
            lblparam5.Text = ObjConfigurableitem.Param5.ToString();
            txtparam5.Text = ObjCMDB.Param5.ToString();
        }

        if (ObjConfigurableitem.Param6 != "")
        {
            txtparam6.Visible = true;
            lblparam6.Text = ObjConfigurableitem.Param6.ToString();
            txtparam6.Text = ObjCMDB.Param6.ToString();
        }
        if (ObjConfigurableitem.Param7 != "")
        {
            txtparam7.Visible = true;
            lblparam7.Text = ObjConfigurableitem.Param7.ToString();
            txtparam7.Text = ObjCMDB.Param7.ToString();
        }

        if (ObjConfigurableitem.Param8 != "")
        {
            txtparam8.Visible = true;
            lblparam8.Text = ObjConfigurableitem.Param8.ToString();
            txtparam8.Text = ObjCMDB.Param8.ToString();
        }

        if (ObjConfigurableitem.Param9 != "")
        {
            txtparam9.Visible = true;
            lblparam9.Text = ObjConfigurableitem.Param9.ToString();
            txtparam9.Text = ObjCMDB.Param9.ToString();
        }
        if (ObjConfigurableitem.Param10 != "")
        {
            txtparam10.Visible = true;
            lblparam10.Text = ObjConfigurableitem.Param10.ToString();
            txtparam10.Text = ObjCMDB.Param10.ToString();
        }
    }