protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!HttpContext.Current.User.Identity.IsAuthenticated)
                {
                    Response.Redirect("~/MainLogout.aspx");
                }
                if (!IsPostBack)
                {
                    LoadBrand();
                    if (HttpContext.Current.User.IsInRole(Entity.HR.Utility.CUSTOMER_LIST_SHOW_ALL))
                    {
                        GetAllCustomer();
                    }
                    else
                    {
                        Customer_GetByAssignEngineerId();
                    }
                    LoadProduct();
                    LoadEmployee();
                    LoadContractType();
                    Message.Show = false;

                    //Direct link from dashboard lists
                    if (Request.QueryString["customerId"] != null && Request.QueryString["source"] != null && Request.QueryString["contractId"] != null)
                    {
                        if (Request.QueryString["source"].ToString() == "dashboard" || Request.QueryString["source"].ToString() == "contractStatus")
                        {
                            CustomerMasterId       = int.Parse(Request.QueryString["customerId"].ToString());
                            popupHeader2.InnerHtml = objCustomer.CustomerPurchase_GetByCustomerId(CustomerMasterId).Rows[0]["CustomerName"].ToString();
                            LoadCustomerPurchaseListForContract();
                            LoadContractList();
                            ClearControlForContract();
                            LoadContractDetail(int.Parse(Request.QueryString["contractId"].ToString()));
                            ModalPopupExtender2.Show();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ex.WriteException();

                Message.IsSuccess = false;
                Message.Text      = ex.Message;
                Message.Show      = true;
            }
        }
 protected void LoadCustomerPurchaseList()
 {
     Business.Customer.Customer objCustomerMaster = new Business.Customer.Customer();
     Entity.Customer.Customer   customerMaster    = new Entity.Customer.Customer();
     gvMachineList.DataSource = objCustomerMaster.CustomerPurchase_GetByCustomerId(CustomerMasterId);
     gvMachineList.DataBind();
 }
示例#3
0
 protected void LoadCustomerPurchaseList()
 {
     Business.Customer.Customer objCustomerMaster = new Business.Customer.Customer();
     Entity.Customer.Customer   customerMaster    = new Entity.Customer.Customer();
     gvPurchase.DataSource = objCustomerMaster.CustomerPurchase_GetByCustomerId(int.Parse(HttpContext.Current.User.Identity.Name.Split('|')[(int)Constants.Customer.ID]));
     gvPurchase.DataBind();
 }
        protected void LoadPieChart()
        {
            decimal upTime = 100;

            Business.Customer.Customer objCustomerMaster = new Business.Customer.Customer();
            DataTable dt = objCustomerMaster.CustomerPurchase_GetByCustomerId(CustomerMasterId);

            if (dt.Rows.Count > 0)
            {
                upTime = Convert.ToDecimal(dt.AsEnumerable().Average(row => row.Field <decimal>("UpTime")));
            }

            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "script", "PieData(" + upTime.ToString() + "," + (100 - upTime).ToString() + ")", true);
        }
示例#5
0
        public List <MachineResponseTime> ColumnChartData()
        {
            Business.Customer.Customer objCustomerMaster = new Business.Customer.Customer();
            int       customerMasterId = int.Parse(HttpContext.Current.User.Identity.Name.Split('|')[(int)Constants.Customer.ID]);
            DataTable dt = objCustomerMaster.CustomerPurchase_GetByCustomerId(customerMasterId);
            List <MachineResponseTime> chartList = new List <MachineResponseTime>();

            foreach (DataRow dr in dt.Rows)
            {
                chartList.Add(new MachineResponseTime {
                    MachineId = dr["MachineId"].ToString(), Avg_Response_Time = Convert.ToDecimal(dr["AVG_Response_Time"].ToString())
                });
            }
            return(chartList);
        }