Exemplo n.º 1
0
    private void loadData()
    {
        try
        {
            Service service = SB.GetService(serviceId);
            imgDisplay.ImageUrl        = WebHelper.Instance.GetImageURL(service.Service_Image, 128, 128, false);
            lblDisplayName.Text        = service.Service_Name;
            lblDisplayDescription.Text = service.Service_Description;
            String charge = SecurityHelper.Instance.DecryptCryptography(service.Service_Charge, true);
            lblDisplayCharge.Text = ToCurrency(Double.Parse(charge)) + " (per day/ per employee)";
            int number = SB.GetNumberCompanyUseService(serviceId);
            lblDisplayNumber.Text = number.ToString();

            hplnkDisplayModifyService.NavigateUrl = WebHelper.Instance.GetURL() + "ManageService/Service/Modify/" + serviceId.ToString();
        }
        catch (Exception ex)
        {
            if (Session["return"] == null)
            {
                Session.Add("return", "null");
            }
            else
            {
                Session["return"] = "null";
            }
            Response.Redirect(WebHelper.Instance.GetURL() + "ManageService/Service/Manage");
        }
    }
Exemplo n.º 2
0
    private void SelectServicesMode()
    {
        if (Session["listOrderDetail"] == null)
        {
            Session.Add("listOrderDetail", new List <OrderDetail>());
        }
        List <OrderDetail> listOrderDetail = (List <OrderDetail>)Session["listOrderDetail"];

        grvManage.DataSource = listOrderDetail;
        grvManage.DataBind();

        //Fix image
        if (ddlService.SelectedIndex != 0)
        {
            Service service = SB.GetService(ddlService.Text);
            imgAvatar.ImageUrl = WebHelper.Instance.GetImageURL(service.Service_Image, 128, 128, false);
        }
    }
Exemplo n.º 3
0
    protected void ddlService_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            if (ddlService.SelectedIndex == 0)
            {
                ResetPanel();
                SelectServicesMode();
            }
            else
            {
                Service service = SB.GetService(ddlService.Text);
                imgAvatar.ImageUrl  = WebHelper.Instance.GetImageURL(service.Service_Image, 128, 128, false);
                lblServiceName.Text = service.Service_Name;
                lblCharge.Text      = SecurityHelper.Instance.DecryptCryptography(service.Service_Charge, true);
                lblCharge.Text      = ToCurrency(Double.Parse(lblCharge.Text));
                lblDescription.Text = service.Service_Description;
                pnlInfo.Visible     = true;

                List <OrderDetail> listOrderDetail = (List <OrderDetail>)Session["listOrderDetailModify"];
                foreach (OrderDetail item in listOrderDetail)
                {
                    if (item.Service_Name.Equals(service.Service_Name))
                    {
                        btnAdd.Visible         = false;
                        btnRemove.Visible      = true;
                        txtFromDate.Text       = item.OrderOfServiceDetail_FromDate;
                        txtToDate.Text         = item.OrderOfServiceDetail_ToDate;
                        txtNumberEmployee.Text = item.OrderOfServiceDetail_NumberOfEmployee.ToString();
                        SelectServicesMode();
                        return;
                    }
                }
            }
            ResetForm();
        }
        catch (Exception ex)
        {
            pnlRed.Visible       = true;
            lblError.Text        = ex.Message;
            hplnkRed.Text        = "Please try again.";
            hplnkRed.NavigateUrl = "";
        }
    }
        public JsonResult Get(string idService)
        {
            var model = _serviceBusiness.GetService(idService, _protector, ApplicationUserCurrent.AccountId);

            LoadViewData(model.IdCustomer, model.Id.ToString());

            //SetSessionVariable("Sections", JSonConvertUtil.Convert(model.ServiceDetailList));

            return(Json(model));
        }
Exemplo n.º 5
0
    private void loadData()
    {
        try
        {
            Service service = SB.GetService(serviceId);

            imgService.ImageUrl = WebHelper.Instance.GetImageURL(service.Service_Image, 128, 128, false);
            txtServiceName.Text = service.Service_Name;
            txtCharge.Text      = SecurityHelper.Instance.DecryptCryptography(service.Service_Charge, true);
            txtDescription.Text = service.Service_Description;
        }
        catch (Exception ex)
        {
            if (Session["return"] == null)
            {
                Session.Add("return", "null");
            }
            else
            {
                Session["return"] = "null";
            }
            Response.Redirect(WebHelper.Instance.GetURL() + "ManageService/Service/Manage");
        }
    }