Exemplo n.º 1
0
    protected void UpdateSite()
    {
        int varFlagSiteExist;
        int Custid = 0;

        // To Check Whether Site Exist in Particular Region ,and assign status to field varFlagSiteExist
        varFlagSiteExist = objSite.Get_By_SiteName(txtSitename.Text.ToString().Trim(), Convert.ToInt32(drpRegion.SelectedValue));
        // Declare Local Variable siteid ,hold the Query String value passed from ViewSite.aspx page
        int siteid = Convert.ToInt32(Request.QueryString[0]);

        // Get the Instance of Site_mst Class and Assign to Object Variable objSite
        objSite = objSite.Get_By_id(siteid);
        // Check ,Instance Exist or Not
        if ((objSite.Siteid != 0) && (varFlagSiteExist == 0))
        {
            // Assign form fields values via object fields values
            txtSitename.Text         = objSite.Sitename.ToString().Trim();
            txtSitedesc.Text         = objSite.Description.ToString().Trim();
            drpRegion.SelectedValue  = Convert.ToString(objSite.Regionid);
            drpCountry.SelectedValue = Convert.ToString(objSite.Countryid);
            txtAddress.Text          = objSite.Address.ToString().Trim();
            txtCity.Text             = objSite.City.ToString().Trim();
            txtEmailId.Text          = objSite.Emailid.ToString().Trim();
            txtFaxNo.Text            = objSite.Faxno.ToString().Trim();
            txtMobileno.Text         = objSite.Mobileno.ToString().Trim();
            txtPersonName.Text       = objSite.Contactpersonname.ToString().Trim();
            txtPhoneNo.Text          = objSite.Phoneno.ToString().Trim();
            txtPostalCode.Text       = objSite.Postalcode.ToString().Trim();
            txtState.Text            = objSite.State.ToString().Trim();
            txtWebSiteUrl.Text       = objSite.Website.ToString().Trim();
            colCustToSite            = objCustToSite.Get_All_By_siteid(objSite.Siteid);

            foreach (CustomerToSiteMapping obj in colCustToSite)
            {
                Custid = obj.Custid;
            }
            ViewState["CustId"]       = Custid;
            drpCustomer.SelectedValue = Convert.ToString(Custid);

            if (objSite.Enable == true)
            {
                dropEnable.SelectedValue = "1";
            }
            else
            {
                dropEnable.SelectedValue = "0";
            }
        }
        else
        {
            // Show Message Site Already Exist
            lblErrorMsg.Text = Resources.MessageResource.errSiteExist.ToString();
        }
    }
Exemplo n.º 2
0
    protected void grdvwRequest_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        System.Drawing.ColorConverter   colConvert = new ColorConverter();
        BLLCollection <ColorScheme_mst> colColor   = new BLLCollection <ColorScheme_mst>();

        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            #region Autogenerate Serial number
            Label lblSerial = (Label)e.Row.FindControl("lblSerial");
            lblSerial.Text = i.ToString();
            i++;
            #endregion

            int TotalTimeSpentonCall;
            int TotalResolutionTime;


            int    varIncidentid     = Convert.ToInt16(((Label)e.Row.FindControl("incidentid")).Text.ToString());
            string varCreateDatetime = e.Row.Cells[9].Text;
            string varStatusOpen     = Resources.MessageResource.strStatusOpen.ToString();
            string varStatusClose    = Resources.MessageResource.strStatusClose.ToString();
            string varStatusOnHold   = Resources.MessageResource.strStatusOnHold.ToString();
            string varStatusResolved = Resources.MessageResource.strStatusResolved.ToString();

            #region Bind Data Row at Run time with requesterid to Requester name
            int requesterid = Convert.ToInt16(e.Row.Cells[3].Text);
            objUser = objUser.Get_By_id(requesterid);

            if (objUser.Userid != 0)
            {
                e.Row.Cells[3].Text = objUser.Username.ToString();
            }
            else
            {
                e.Row.Cells[3].Text = "";
            }
            #endregion

            #region Bind Datarow at Run Time with Createdbyid to Created by name
            int createdbyid = Convert.ToInt16(e.Row.Cells[4].Text);
            objUser = objUser.Get_By_id(createdbyid);
            if (objUser.Userid != 0)
            {
                e.Row.Cells[4].Text = objUser.Username.ToString();
            }
            else
            {
                e.Row.Cells[4].Text = "";
            }
            #endregion

            #region Bind Datarow at Run Time with technicianid to technician name
            int technicianid = Convert.ToInt16(e.Row.Cells[5].Text);
            objUser = objUser.Get_By_id(technicianid);
            if (objUser.Userid != 0)
            {
                e.Row.Cells[5].Text = objUser.Username.ToString();
            }
            else
            {
                e.Row.Cells[5].Text = "";
            }
            #endregion

            #region Bind Datarow at run time with Statusid to Status
            int statusid = Convert.ToInt16(e.Row.Cells[6].Text);
            objStatus = objStatus.Get_By_id(statusid);
            if (objStatus.Statusid != 0)
            {
                e.Row.Cells[6].Text = objStatus.Statusname.ToString();
            }
            else
            {
                e.Row.Cells[6].Text = "";
            }
            #endregion

            #region Bind Datarow at run time with Priorityid to Priority
            int priorityid = Convert.ToInt16(e.Row.Cells[7].Text);
            objPriority = objPriority.Get_By_id(priorityid);
            if (objPriority.Priorityid != 0)
            {
                e.Row.Cells[7].Text = objPriority.Name.ToString();
            }
            else
            {
                e.Row.Cells[7].Text = "";
            }
            #endregion


            #region Bind Datarow at run time with Siteid to Site
            int siteid = Convert.ToInt16(e.Row.Cells[8].Text);
            objSite = objSite.Get_By_id(siteid);
            if (objSite.Siteid != 0)
            {
                string custSiteName;
                int    custid = 0;
                colCustToSite = objCustToSite.Get_All_By_siteid(objSite.Siteid);
                foreach (CustomerToSiteMapping objCuToSite in colCustToSite)
                {
                    custid = objCuToSite.Custid;
                }
                objCustomer = objCustomer.Get_By_id(custid);

                e.Row.Cells[8].Text = objCustomer.Customer_name + "/" + objSite.Sitename.ToString();
            }
            else
            {
                e.Row.Cells[8].Text = "";
            }
            #endregion

            #region Apply Color Coding to Open Calls,According to define SLA
            if (varStatusOpen.ToLower() == objStatus.Statusname.ToString().ToLower())
            {
                Incident_mst obj = new Incident_mst();
                obj = obj.Get_By_id(varIncidentid);
                if (obj.Incidentid != 0)
                {
                    if (obj.Slaid != 0)
                    {
                        #region Declare local variables,and objects of various classes
                        int percent;

                        ProcessEscalateEmail objPro = new ProcessEscalateEmail();
                        #endregion
                        #region Get Total Resolution time define for particular SLA and Time Spent on Request
                        TotalResolutionTime  = objPro.GetResolutionTimeInMins(obj.Slaid);
                        TotalTimeSpentonCall = objIncident.Get_TimeSpentonRequest(varIncidentid, siteid, varCreateDatetime, DateTime.Now.ToString());
                        if (TotalTimeSpentonCall < 0)
                        {
                            TotalTimeSpentonCall = 0;
                        }
                        #endregion
                        #region Calculate Percent
                        percent = (TotalTimeSpentonCall * 100) / TotalResolutionTime;

                        #endregion

                        ColorScheme_mst objColor = new ColorScheme_mst();
                        colColor = objColor.Get_All_By_CallStatus(varStatusOpen);


                        foreach (ColorScheme_mst objCol in colColor)
                        {
                            if (objCol.Percnt_to != 0)
                            {
                                if (percent >= objCol.Percnt && percent <= objCol.Percnt_to)
                                {
                                    e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(objCol.Colorname);
                                }
                            }
                            else
                            {
                                if (percent >= objCol.Percnt)
                                {
                                    e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(objCol.Colorname);
                                }
                            }
                        }
                    }
                    else
                    {
                        ColorScheme_mst objColor = new ColorScheme_mst();
                        colColor = objColor.Get_All_By_CallStatus("NonSLA");


                        foreach (ColorScheme_mst objCol in colColor)
                        {
                            e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(objCol.Colorname);
                        }
                    }
                }
            }
            #endregion

            #region Apply Color Coding to Close Calls
            if (varStatusClose.ToLower() == objStatus.Statusname.ToString().ToLower())
            {
                ColorScheme_mst objColor = new ColorScheme_mst();
                colColor = objColor.Get_All_By_CallStatus(varStatusClose);
                foreach (ColorScheme_mst obj in colColor)
                {
                    try { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(obj.Colorname); }
                    catch (Exception ex)
                    { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString("White"); }
                }
            }
            #endregion

            #region Apply Color Coding to On Hold Calls
            if (varStatusOnHold.ToLower() == objStatus.Statusname.ToString().ToLower())
            {
                ColorScheme_mst objColor = new ColorScheme_mst();
                colColor = objColor.Get_All_By_CallStatus(varStatusOnHold);
                foreach (ColorScheme_mst obj in colColor)
                {
                    e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(obj.Colorname);
                }
            }
            #endregion

            #region Apply Color Coding to Resolved Calls
            if (varStatusResolved.ToLower() == objStatus.Statusname.ToString().ToLower())
            {
                ColorScheme_mst objColor = new ColorScheme_mst();
                colColor = objColor.Get_All_By_CallStatus(varStatusResolved);
                foreach (ColorScheme_mst obj in colColor)
                {
                    e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(obj.Colorname);
                }
            }
            #endregion
        }
    }
Exemplo n.º 3
0
    protected void UpdateUser()
    {
        int Custid = 0;
        int userid = Convert.ToInt32(Request.QueryString[0]);

        ObjUserLogin   = ObjUserLogin.Get_By_id(userid);
        ObjContactInfo = ObjContactInfo.Get_By_id(userid);

        if (ObjUserLogin.Userid != 0 && ObjContactInfo.Userid != 0)
        {
            txtUserName.Text = ObjUserLogin.Username.ToString().Trim();
            txtPassword.Attributes.Add("value", ObjUserLogin.Password.ToString());
            if (ObjUserLogin.City != null)
            {
                txtCity.Text = ObjUserLogin.City.ToString().Trim();
            }

            if (ObjUserLogin.Company != null)
            {
                txtCompany.Text = ObjUserLogin.Company.ToString().Trim();
            }

            txtRetypePassword.Attributes.Add("value", ObjUserLogin.Password.ToString());
            dropRole.SelectedValue = ObjUserLogin.Roleid.ToString().Trim();

            ViewState["Roleid"] = ObjUserLogin.Roleid;
            if (ObjUserLogin.ADEnable == true)
            {
                lblAdUser.Text = "Yes";
            }
            else
            {
                lblAdUser.Text = "No";
            }
            txtFname.Text = ObjContactInfo.Firstname.ToString().Trim();
            txtLname.Text = ObjContactInfo.Lastname.ToString().Trim();
            if (ObjContactInfo.Landline != null)
            {
                txtLandline.Text = ObjContactInfo.Landline.ToString().Trim();
            }
            if (ObjContactInfo.Emailid != null)
            {
                txtEmailId.Text = ObjContactInfo.Emailid.ToString().Trim();
            }
            if (ObjContactInfo.Empid != null)
            {
                txtEmpId.Text = ObjContactInfo.Empid.ToString().Trim();
            }
            if (ObjContactInfo.Emailid != null)
            {
                txtEmailId.Text = ObjContactInfo.Emailid.ToString();
            }
            if (ObjContactInfo.Mobile != null)
            {
                txtMobile.Text = ObjContactInfo.Mobile.ToString();
            }
            if (ObjContactInfo.Description != null)
            {
                txtDesc.Text = ObjContactInfo.Description.ToString();
            }


            colCustToSite = objCustToSite.Get_All_By_siteid(ObjContactInfo.Siteid);
            foreach (CustomerToSiteMapping obj in colCustToSite)
            {
                Custid = obj.Custid;
            }
            ViewState["CustId"]       = Custid;
            drpCustomer.SelectedValue = Convert.ToString(Custid);


            BindDrpsite();
            DrpSite.SelectedValue = ObjContactInfo.Siteid.ToString();
            //DrpOrg.SelectedValue = ObjUserLogin.Orgid.ToString();
            BindDrpDepartment();
            DrpDepartment.SelectedValue = ObjContactInfo.Deptid.ToString();

            if (ObjUserLogin.Enable == true)
            {
                DropEnable.SelectedValue = "1";
            }
            else
            {
                DropEnable.SelectedValue = "0";
            }
        }
    }
Exemplo n.º 4
0
    //Added by Lalit
    public void BindDropCustomer()
    {
        BLLCollection <Customer_mst> colCtS = new BLLCollection <Customer_mst>();
        string         userName             = "";
        MembershipUser User = Membership.GetUser();

        if (User != null)
        {
            userName = User.UserName.ToString();
        }
        if (userName != "")
        {
            int userid;
            int Flagcount = 0;
            objOrganization = objOrganization.Get_Organization();
            objUser         = objUser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid);
            if (objUser.Userid != 0)
            {
                userid        = objUser.Userid;
                colUserToSite = ObjUserToSite.Get_All_By_userid(userid);
                foreach (UserToSiteMapping obj in colUserToSite)
                {
                    int      siteid;
                    Site_mst objSite1 = new Site_mst();
                    siteid   = obj.Siteid;
                    objSite1 = objSite1.Get_By_id(siteid);
                    if (objSite1.Siteid != 0)
                    {
                        colCustToSite = objCustToSite.Get_All_By_siteid(objSite1.Siteid);


                        foreach (CustomerToSiteMapping objcts in colCustToSite)
                        {
                            Customer_mst objC       = new Customer_mst();
                            int          FlagStatus = 0;
                            objC = objC.Get_By_id(objcts.Custid);
                            if (Flagcount == 0)
                            {
                                colCtS.Add(objC);
                            }
                            else
                            {
                                foreach (Customer_mst objCus in colCtS)
                                {
                                    if (objC.Custid == objCus.Custid)
                                    {
                                        FlagStatus = 1;
                                    }
                                }
                                if (FlagStatus == 0)
                                {
                                    colCtS.Add(objC);
                                }
                            }
                            Flagcount = Flagcount + 1;
                        }
                    }
                }
            }
            //}

            //DdlStock.DataBind();
            //   DdlOwner.DataTextField = "Customer_Name";
            //  DdlOwner.DataValueField = "CustId";
            //  DdlOwner.DataSource = colCtS;
            //  DdlOwner.DataBind();

            //if (colCtS.Count == 0)
            //{
            ListItem item = new ListItem();
            item.Text = "Other";
            //item.Value = "1";
            //   DdlOwner.Items.Add(item);


            //}
        }
    }