Example #1
0
        private void DeleteChargeCode(Context context, ref BaseActionResult bar)
        {
            string strChargeCode = CommonUtilitis.GetParameter("ChargeCode", context.Parameters);

            strChargeCode = CommonUtilitis.unescape(strChargeCode);

            chargeCodeService.DeleteChargeCode(strChargeCode);
            bar.Result = true;
        }
Example #2
0
        public override BaseActionResult Execute(Context context)
        {
            BaseActionResult bar = new BaseActionResult();

            try
            {
                string actionName = CommonUtilitis.GetParameter("ActionName", context.Parameters).ToUpper();

                switch (actionName)
                {
                case "GETALLCHARGECODE":
                    GetAllChargeCode(context, ref bar);
                    break;

                case "ADDCHARGECODE":
                    AddChargeCode(context, ref bar);
                    break;

                case "UPDATECHARGECODE":
                    UpdateChargeCode(context, ref bar);
                    break;

                case "DELETECHARGECODE":
                    DeleteChargeCode(context, ref bar);
                    break;

                default:
                    throw new Exception("OAM CharegeCode action mapping error!");
                }
                return(bar);
            }
            catch (Exception ex)
            {
                bar.Result        = false;
                bar.ReturnMessage = ex.Message;
                logger.Error((long)ModuleEnum.Oam_WS, ModuleInstanceName.Oam, 1, ex.Message, Application.StartupPath.ToString(),
                             (new System.Diagnostics.StackFrame(true)).GetFileName(),
                             Convert.ToInt32(new System.Diagnostics.StackFrame(true).GetFileLineNumber().ToString()));
            }
            return(bar);
        }