Exemplo n.º 1
0
        public ActionResult AddLabourChargeTypeIndex()
        {
            LabourChargeTypeModel model = new LabourChargeTypeModel();
            string mode           = Request.QueryString["mode"] != null ? Request.QueryString["mode"].ToString() : string.Empty;
            var    LabourChargeId = Request.QueryString["labourchargeid"] != null ? Request.QueryString["labourchargeid"] : null;

            try
            {
                LCTClient = new LabourChargeTypeServiceClient();
                if (mode == "edit")
                {
                    FormMode = mode;
                    LabourChargeTypeDto labourchargedto = LCTClient.GetById(LabourChargeId != null ? Convert.ToInt32(LabourChargeId) : 0);
                    Id = labourchargedto.LabourChargeId;
                    model.LabourCharge = labourchargedto.LabourCharge;
                }
            }
            catch (Exception ex)
            {
                return(View("ErrorPage"));
            }
            finally
            {
                if (LCTClient != null)
                {
                    LCTClient.Close();
                }
            }
            return(View("AddLabourChargeType", model));
        }
Exemplo n.º 2
0
        public ActionResult GetLabourChargeTypeView()
        {
            LabourChargeTypeModel model = new LabourChargeTypeModel();
            var LabourChargeId          = Request.QueryString["labourchargeid"];

            try
            {
                LCTClient = new LabourChargeTypeServiceClient();
                LabourChargeTypeDto LCTdto = LCTClient.GetById(LabourChargeId != null ? Convert.ToInt32(LabourChargeId) : 0);
                model.LabourChargeId = LCTdto.LabourChargeId;
                model.LabourCharge   = LCTdto.LabourCharge;
            }
            catch (Exception ex)
            {
                return(View("ErrorPage"));
            }
            finally
            {
                if (LCTClient != null)
                {
                    LCTClient.Close();
                }
            }
            return(View("LabourChargeTypeView", model));
        }