public ActionResult CampaignMainFrame(ACM.Model.CampaignMainFrame cmpMainfram)
        {
            ACM.Model.CampaignMainFrame campaign = new ACM.Model.CampaignMainFrame();
            campaign.CampaignId = Convert.ToInt32(cmpMainfram.CampaignId);

            var campaignMainframe = campaignServiceClient.CampaignMainframeInq(campaign);

            var cardTypeList = campaignServiceClient.GetMasterDropDownDataforMasterTables("CardTypeId", "CardDescription", "CardType");

            ViewBag.cardTypeList = new SelectList(cardTypeList, "ID", "Name");

            var customerTypeList = campaignServiceClient.GetMasterDropDownDataforMasterTables("CustomerTypeId", "CustomerTypeDesc", "CustomerType");

            ViewBag.customerTypeList = new SelectList(customerTypeList, "ID", "Name");

            var specialProcessList = campaignServiceClient.GetMasterDropDownDataforMasterTables("SpecialProcessTypeId", "SpecialProcessTypeDesc", "SpecialProcessType");

            ViewBag.specialProcessList = new SelectList(specialProcessList, "ID", "Name");

            if (campaignMainframe == null)
            {
                campaignMainframe = new Model.CampaignMainFrame();
            }

            return(PartialView(campaignMainframe));
        }
        public JsonResult SaveCampaignMainFrame(ACM.Model.CampaignMainFrame cmpMainfram)
        {
            //  RedirectToAction("CampaignView");

            CampaignMainFrame campaignMainFrame = new CampaignMainFrame();

            campaignMainFrame = campaignServiceClient.CampaignMainframeInq(cmpMainfram);

            if (ModelState.IsValid)
            {
                if (campaignMainFrame == null)
                {
                    campaignServiceClient.CampaignMainFrameAdd(cmpMainfram);
                    return(Json(cmpMainfram));
                }
                else
                {
                    campaignServiceClient.CampaignMainFrameMod(cmpMainfram);
                    return(Json(cmpMainfram));
                }
            }
            else
            {
                IEnumerable <ModelError> errors = ModelState.Values.SelectMany(v => v.Errors);
                ViewBag.error = "Error in the form";
                return(Json(cmpMainfram, ViewBag.error));
            }
        }
 public string CampaignMainFrameAdd(CampaignMainFrame request)
 {
     try
     {
         using (ACM_Redesign2014Context ctx = new ACM_Redesign2014Context())
         {
             ctx.CampaignMainFrames.Add(request);
             ctx.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         Error.WriteException(TraceEventType.Error, ex.Message.ToString(), "CampaignMainFrameAdd");
         throw;
     }
     return "Successfully added";
 }
 public CampaignMainFrame CampaignMainFrameInq(CampaignMainFrame request)
 {
     CampaignMainFrame response = new CampaignMainFrame();
     try
     {
         using (ACM_Redesign2014Context ctx = new ACM_Redesign2014Context())
         {
             ctx.Configuration.ProxyCreationEnabled = false;
             if (request != null)
             {
                 response = ctx.CampaignMainFrames.Find(request.CampaignId);
             }
             ctx.Configuration.ProxyCreationEnabled = true;
         }
     }
     catch (Exception ex)
     {
         Error.WriteException(TraceEventType.Error, ex.Message.ToString(), "CampaignMainFrameInq");
         throw;
     }
     return response;
 }
 public List<CampaignMainFrame> CampaignMainFrameInfo(CampaignMainFrame request)
 {
     List<CampaignMainFrame> response = new List<CampaignMainFrame>();
     try
     {
         using (ACM_Redesign2014Context ctx = new ACM_Redesign2014Context())
         {
             if (request != null && request.CampaignId != 0)
             {
                 response = (from campaignMainFrame in ctx.CampaignMainFrames
                             where campaignMainFrame.CampaignId == request.CampaignId
                             select campaignMainFrame).ToList();
             }
         }
     }
     catch (Exception ex)
     {
         Error.WriteException(TraceEventType.Error, ex.Message.ToString(), "CampaignMainFrameInfo");
         throw;
     }
     return response;
 }
        public string CampaignMainFrameDel(CampaignMainFrame request)
        {
            try
            {
                using (ACM_Redesign2014Context ctx = new ACM_Redesign2014Context())
                {
                    ctx.Configuration.ProxyCreationEnabled = false;

                    CampaignMainFrame campaign = ctx.CampaignMainFrames.Find(request.CampaignId);

                    ctx.CampaignMainFrames.Remove(campaign);
                    ctx.SaveChanges();
                    ctx.Configuration.ProxyCreationEnabled = true;

                }
            }
            catch (Exception ex)
            {
                Error.WriteException(TraceEventType.Error, ex.Message.ToString(), "CampaignMainFrameDel");
                throw;
            }
            return "Successfully deleted";
        }
Ejemplo n.º 7
0
 public string CampaignMainFrameMod(CampaignMainFrame request)
 {
     return campaignMainFrameDAO.CampaignMainFrameMod(request);
 }
Ejemplo n.º 8
0
 public CampaignMainFrame CampaignMainframeInq(CampaignMainFrame request)
 {
     return campaignMainFrameDAO.CampaignMainFrameInq(request);
 }
Ejemplo n.º 9
0
 public List<CampaignMainFrame> CampaignMainFrameInfo(CampaignMainFrame request)
 {
     return campaignMainFrameDAO.CampaignMainFrameInfo(request);
 }
Ejemplo n.º 10
0
 public string CampaignMainFrameMod(CampaignMainFrame request)
 {
     try
     {
         using (ACM_Redesign2014Context ctx = new ACM_Redesign2014Context())
         {
             ctx.Entry(request).State = EntityState.Modified;
             ctx.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         Error.WriteException(TraceEventType.Error, ex.Message.ToString(), "CampaignMainFrameMod");
         throw;
     }
     return "Successfully updated";
 }
        public JsonResult SaveCampaignMainFrame(ACM.Model.CampaignMainFrame cmpMainfram)
        {
            //  RedirectToAction("CampaignView");

            CampaignMainFrame campaignMainFrame = new CampaignMainFrame();
            campaignMainFrame = campaignServiceClient.CampaignMainframeInq(cmpMainfram);

            if (ModelState.IsValid)
            {
                if (campaignMainFrame == null)
                {

                    campaignServiceClient.CampaignMainFrameAdd(cmpMainfram);
                    return Json(cmpMainfram);

                }
                else
                {

                    campaignServiceClient.CampaignMainFrameMod(cmpMainfram);
                    return Json(cmpMainfram);
                }
            }
            else
            {

                IEnumerable<ModelError> errors = ModelState.Values.SelectMany(v => v.Errors);
                ViewBag.error = "Error in the form";
                return Json(cmpMainfram, ViewBag.error);

            }
        }
        public ActionResult CampaignMainFrame(ACM.Model.CampaignMainFrame cmpMainfram)
        {
            ACM.Model.CampaignMainFrame campaign = new ACM.Model.CampaignMainFrame();
            campaign.CampaignId = Convert.ToInt32(cmpMainfram.CampaignId);

            var campaignMainframe = campaignServiceClient.CampaignMainframeInq(campaign);

            var cardTypeList = campaignServiceClient.GetMasterDropDownDataforMasterTables("CardTypeId", "CardDescription", "CardType");
            ViewBag.cardTypeList = new SelectList(cardTypeList, "ID", "Name");

            var customerTypeList = campaignServiceClient.GetMasterDropDownDataforMasterTables("CustomerTypeId", "CustomerTypeDesc", "CustomerType");
            ViewBag.customerTypeList = new SelectList(customerTypeList, "ID", "Name");

            var specialProcessList = campaignServiceClient.GetMasterDropDownDataforMasterTables("SpecialProcessTypeId", "SpecialProcessTypeDesc", "SpecialProcessType");
            ViewBag.specialProcessList = new SelectList(specialProcessList, "ID", "Name");

            if (campaignMainframe == null)
                campaignMainframe = new Model.CampaignMainFrame();

            return PartialView(campaignMainframe);
        }
Ejemplo n.º 13
0
        public string CampaignMainFrameMod(CampaignMainFrame request)
        {
            try
            {

                return campaignProxy.CampaignMainFrameMod(request);
            }
            catch (Exception exp)
            {
                WCFFaultException.GetClientException(exp, "CampaignMainFrameMod");
                throw new Exception(exp.ToString());
            }
        }