Ejemplo n.º 1
0
        public void VideoBreak_Click(object sender, EventArgs e)
        {
            if (sender == breakNone)
            {
                breakNone.Checked = true;
                breakMiss.Checked = false;
                breakAll.Checked  = false;
                breakVideo        = FrameState.frameMiss;
            }
            if (sender == breakMiss)
            {
                breakNone.Checked = false;
                breakMiss.Checked = true;
                breakAll.Checked  = false;
                breakVideo        = FrameState.frameMiss;
            }
            if (sender == breakAll)
            {
                breakNone.Checked = true;
                breakMiss.Checked = false;
                breakAll.Checked  = false;
                breakVideo        = FrameState.frameNone;
            }
            Cog cog = Chip.GetCog(HostID);

            cog.VideoBreak = breakVideo;
        }
Ejemplo n.º 2
0
        public VideoGenerator(PropellerCPU chip, Cog owner)
        {
            // Clear our phase accumulator
            PhaseAccumulator = 0;
            Chip             = chip;
            cog = owner;

            // Scale is dirty
            ScaleDirty = true;
        }
 protected override void SetCog(Cog value)
 {
     if (value is T)
     {
         typeSafeCog = (T)value;
     }
     else
     {
         throw new Exception("type error!");
     }
 }
Ejemplo n.º 4
0
 public string AddPhone(Cog.MLIAD.BusinessLogic.Associate.Phone phone, string AssociateID)
 {
     try
     {
         MLIADService.SetNoCache();
         return repository.AddPhone(phone, AssociateID);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 5
0
 public string AddFirewall(Cog.MLIAD.BusinessLogic.Associate.FirewallRequest firewall)
 {
     try
     {
         MLIADService.SetNoCache();
         return repository.AddFirewall(firewall);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 6
0
 public string AddCategory(Cog.MLIAD.BusinessLogic.Associate.Category category)
 {
     try
     {
         MLIADService.SetNoCache();
         return repository.AddCategory(category);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 /// @brief Create a new Watch for a Main memory location.
 /// @param chip Reference to %PropellerCPU to inspect its memory.
 /// @param name Name to associate the Watch.
 /// @param address Memory address to inspect.
 public MemWatcher(PropellerCPU chip, string name, uint address)
 {
     IsCogBased    = false;
     _chip         = chip;
     _cog          = null;
     Addr          = address; //this assignment validate the value or throw an exception
     Name          = name;
     Value         = chip.ReadLong(Addr);
     ComparedValue = 0;
     isStoppedBy   = false;
     Mode          = StopMode.none;
 }
Ejemplo n.º 8
0
        private void AssemblyView_Paint(object sender, PaintEventArgs e)
        {
            Cog host = Chip?.GetCog(HostID);

            if (host is NativeCog)
            {
                PaintNative(e.Graphics, (NativeCog)host);
            }
            else if (host is InterpretedCog)
            {
                PaintInterpreted(e.Graphics, (InterpretedCog)host);
            }
        }
        public string AddAssociate(Cog.MLIAD.BusinessLogic.Associate.Associate associate)
        {
            using (AssociateConnDataContext asscon = new AssociateConnDataContext())
            {
                try
                {
                    int retasct = 0;
                    retasct = asscon.Add_Associate(associate.AssociateID, associate.FirstName, associate.LastName, associate.Mobile, associate.email, associate.DirectReportID, associate.IsApproved, associate.ProjectID, associate.LocationID, associate.DesignationID, associate.DOJ, associate.DOB, associate.IsActive, associate.UserID, associate.Password, associate.GroupID);
                    if (!(retasct == 0))
                    {
                        BusinessLogic.Associate.Associate approver = (from a in asscon.get_AdminByGroup(associate.GroupID)
                                                                      select new Cog.MLIAD.BusinessLogic.Associate.Associate()
                                                                      {
                                                                          AssociateID = a.AssociateID,
                                                                          FirstName = (a.FirstName == null) ? "" : a.FirstName,
                                                                          LastName = (a.LastName == null) ? "" : a.LastName,
                                                                          Mobile = (a.Mobile == null) ? "" : a.Mobile,
                                                                          email = (a.email == null) ? "" : a.email,
                                                                          UserID = (a.UserId == null) ? "" : a.UserId
                                                                      }).SingleOrDefault<Cog.MLIAD.BusinessLogic.Associate.Associate>();

                        string sendSubject = "Pending Request";
                        string mailbody = "<html><body>Dear " + approver.FirstName + ",<br /> You have pending request to approve for " + associate.FirstName + " " + associate.LastName + ".<br / >Please login to www.AssociateConnect.com to approve the request.<br / ><br />Regards,<br />AssociateConnect Admin Team<body><html>";
                        SendEmail(sendSubject, mailbody, associate.email, approver.email,true);
                        sendSubject = "Request Summited";
                        mailbody = "<html><body>Dear " + associate.FirstName + ",<br /> your request is successfully submitted to" + approver.FirstName + " " + approver.LastName + " for approval.<br / >You will get confirmation mail once your request gets appreved.<br / ><br />Regards,<br />AssociateConnect Admin Team<body><html>";
                        SendEmail(sendSubject, mailbody, approver.email, associate.email,true);

                        BusinessLogic.Associate.SMS sms = new SMS();
                        sms.smsBody = "You have pending request to approve for " + associate.FirstName + " " + associate.LastName + ".";
                        sms.toList = approver.Mobile;
                        SendSMS(sms);
                        sms.smsBody = "your request is successfully submitted to" + approver.FirstName + " " + approver.LastName + " for approval.";
                        sms.toList = associate.Mobile;
                        SendSMS(sms);

                        return "success";
                    }
                    else
                        return "failure";
                }
                catch (Exception ex)
                {
                    throw ex;
                }

            }
        }
Ejemplo n.º 10
0
        /// @todo Document Gear.GUI.Emulator.stepInstruction_Click()
        ///
        private void stepInstruction_Click(object sender, EventArgs e)
        {
            if (documentsTab.SelectedTab != null)
            {
                Control c = documentsTab.SelectedTab.GetNextControl(null, true);

                if (c != null && c is CogView)
                {
                    Cog cog = ((CogView)c).GetViewCog();

                    if (cog != null)
                    {
                        cog.StepInstruction();
                    }
                }
            }

            RepaintViews();
        }
Ejemplo n.º 11
0
        private void assemblyPanel_MouseDown(object sender, MouseEventArgs e)
        {
            int bp = 0;

            if ((e.Button & MouseButtons.Left) == MouseButtons.Left)
            {
                //Make sure it's a valid breakpoint environment
                if (Chip == null)
                {
                    return;
                }
                Cog Host = Chip.GetCog(HostID);
                if (Host == null)
                {
                    return;
                }
                //Find the line that was clicked on
                bp = (assemblyPanel.PointToClient(MousePosition).Y / MonoFont.Height);
                //What type of cog?
                if (Host is NativeCog)
                {
                    bp += positionScroll.Value;
                }
                else if (Host is InterpretedCog)
                {
                    bp = (int)InterpAddress[bp + 1];
                }
                //Toggle/move the breakpoint
                if (bp == Host.BreakPoint)
                {
                    Host.BreakPoint = -1;
                }
                else
                {
                    Host.BreakPoint = bp;
                }
                //Show the user what happened
                Repaint(false);
            }
        }
Ejemplo n.º 12
0
 /// @brief Create a new Watch for a %Cog memory location.
 /// @param cog Reference to %Cog to inspect its memory.
 /// @param name Name to associate the Watch.
 /// @param address Memory address to inspect.
 public MemWatcher(Cog cog, string name, uint address)
 {
     IsCogBased = true;
     _chip      = null;
     _cog       = cog;
     Addr       = address; //this assignment validate the value or throw an exception
     //CogSpecialAddress tmp;
     //if (Enum.IsDefined(typeof(CogSpecialAddress), Addr) &&
     //    Enum.TryParse(Addr, out tmp))
     //{
     //    specialAddr = tmp;
     //    Name = specialAddr.ToString();
     //}
     Name = name;
     if (string.IsNullOrEmpty(Name))
     {
         Name = name;
     }
     Value         = cog.ReadLong(Addr);
     ComparedValue = 0;
     isStoppedBy   = false;
     Mode          = StopMode.none;
 }
Ejemplo n.º 13
0
 public string AddAssociate(Cog.MLIAD.BusinessLogic.Associate.Associate associate)
 {
     try
     {
         MLIADMobileService.SetNoCache();
         var result = repository.AddMobileAssociate(associate);
         //if(result == "success")
         //{
         //    string smstext = "Thanks " + associate.FirstName + " " + associate.LastName + ". Your registration is successful. Your username is: '" + associate .AssociateID+ "'. You password is: 'password'. Please login to https://massociatecon.cognizant.com/mobile/login.htm";
         //    try
         //    {
         //        SendSMS(smstext, "91" + associate.Mobile);
         //    }
         //    catch (Exception ex)
         //    {
         //    }
         //    finally
         //    {
         //        //try
         //        //{
         //        //    repository.SendEmail("Registration Successful!", smstext, associate.email, associate.email, true);
         //        //}
         //        //catch (Exception ex) { }
         //        //finally
         //        //{
         //        //    //return result;
         //        //}
         //    }
         //    return result;
         //}
         return result;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 14
0
    void Update()
    {
        if (recreate)
        {
            recreate = false;

            for (int i = transform.childCount - 1; i >= 0; i--)
            {
                Transform child = transform.GetChild(i);
                if (child.gameObject.name == cogName)
                {
                    child.parent = null;
                    DestroyImmediate(child.gameObject);
                }
            }

            Cog cog = new Cog(cogCount);

            for (int i = 0; i < cogCount; i++)
            {
                GameObject   cogObj   = new GameObject();
                MeshFilter   filter   = cogObj.transform.gameObject.AddComponent <MeshFilter>();
                MeshCollider collider = cogObj.transform.gameObject.AddComponent <MeshCollider>();
                MeshRenderer renderer = cogObj.transform.gameObject.AddComponent <MeshRenderer>();
                filter.sharedMesh   = cog.Mesh;
                collider.sharedMesh = filter.sharedMesh;
                if (material != null)
                {
                    renderer.material = material;
                }
                cogObj.transform.rotation = Quaternion.Euler(0, 0, i * 360 / cogCount);
                cogObj.transform.parent   = transform;
                cogObj.name = cogName;
            }
        }
    }
Ejemplo n.º 15
0
 public void OnDetatch()
 {
     AttachedCog = null;
     HasCog      = false;
 }
Ejemplo n.º 16
0
        /// @brief Repaint the Cog state and data.
        /// @param force
        public override void Repaint(bool force)
        {
            if (Chip == null)
            {
                return;
            }

            Cog Host = Chip.GetCog(HostID);

            if (Host == null)
            {
                processorStateLabel.Text = "CPU State: Cog is stopped.";
                programCounterLabel.Text = "";
                zeroFlagLabel.Text       = "";
                carryFlagLabel.Text      = "";
                return;
            }

            positionScroll.Minimum = 0;

            if (Host is InterpretedCog)
            {
                positionScroll.Maximum = 0xFFFF;
            }
            else if (Host is NativeCog)
            {
                positionScroll.Maximum = 0x200;
            }

            positionScroll.LargeChange = 10;
            positionScroll.SmallChange = 1;

            if (positionScroll.Maximum < positionScroll.Value)
            {
                positionScroll.Value = positionScroll.Maximum;
            }

            if (followPCButton.Checked)
            {
                uint topLine, bottomLine;
                topLine    = 5;
                bottomLine = (uint)((ClientRectangle.Height / MonoFont.Height) - 5);
                if (Host is NativeCog)
                {
                    if (Host.ProgramCursor < topLine)
                    {
                        positionScroll.Value = 0;
                    }
                    else if (Host.ProgramCursor - positionScroll.Value >= bottomLine - 1)
                    {
                        positionScroll.Value = (int)Host.ProgramCursor - (int)topLine;
                    }
                    else if (Host.ProgramCursor - positionScroll.Value < topLine)
                    {
                        positionScroll.Value = (int)Host.ProgramCursor - (int)topLine;
                    }
                }
                else
                {
                    positionScroll.Value = (int)Host.ProgramCursor;
                }
            }

            if (Host is NativeCog)
            {
                Repaint(force, (NativeCog)Host);
            }
            else if (Host is InterpretedCog)
            {
                Repaint(force, (InterpretedCog)Host);
            }

            programCounterLabel.Text = "PC: " + String.Format("{0:X8}", Host.ProgramCursor);
            processorStateLabel.Text = "CPU State: " + Host.CogState;

            assemblyPanel.CreateGraphics().DrawImageUnscaled(BackBuffer, 0, 0);
        }
Ejemplo n.º 17
0
 public string EditSoftware(Cog.MLIAD.BusinessLogic.Associate.SoftwareRequest software)
 {
     try
     {
         MLIADService.SetNoCache();
         string retval = "failure";
         if (software.oper == "edit")
             retval = repository.EditSoftware(software);
         else if (software.oper == "delete")
             retval = repository.DeleteSoftware(software.id);
         return retval;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 18
0
 public int ReplyToPostTopic(Cog.MLIAD.BusinessLogic.Associate.Discussion replytopic)
 {
     int retVal = 0;
     try
     {
         MLIADMobileService.SetNoCache();
         retVal = repository.ReplyToPostTopic(replytopic);
     }
     catch (Exception e)
     {
         throw e;
     }
     return retVal;
 }
Ejemplo n.º 19
0
        /// @brief Repaint the Cog state and data.
        /// @param force
        public override void UpdateGui()
        {
            assemblyPanel.Invalidate();

            Cog host = Chip?.GetCog(HostID);

            if (host == null)
            {
                processorStateLabel.Text = "CPU State: Cog is stopped.";
                programCounterLabel.Text = "";
                zeroFlagLabel.Text       = "";
                carryFlagLabel.Text      = "";
                return;
            }

            positionScroll.Minimum = 0;

            if (host is InterpretedCog)
            {
                positionScroll.Maximum = PropellerCPU.TOTAL_MEMORY - 1;
            }
            else if (host is NativeCog)
            {
                positionScroll.Maximum = 0x200;
            }

            positionScroll.LargeChange = 10;
            positionScroll.SmallChange = 1;

            if (positionScroll.Maximum < positionScroll.Value)
            {
                positionScroll.Value = positionScroll.Maximum;
            }

            if (followPCButton.Checked)
            {
                uint topLine, bottomLine;
                topLine    = 5;
                bottomLine = (uint)((ClientRectangle.Height / MonoFont.Height) - 5);
                if (host is NativeCog)
                {
                    if (host.ProgramCursor < topLine)
                    {
                        positionScroll.Value = 0;
                    }
                    else if (host.ProgramCursor - positionScroll.Value >= bottomLine - 1)
                    {
                        positionScroll.Value = (int)host.ProgramCursor - (int)topLine;
                    }
                    else if (host.ProgramCursor - positionScroll.Value < topLine)
                    {
                        positionScroll.Value = (int)host.ProgramCursor - (int)topLine;
                    }
                }
                else
                {
                    positionScroll.Value = (int)host.ProgramCursor;
                }
            }

            if (host is NativeCog)
            {
                NativeCog nativeHost = (NativeCog)host;

                OpcodeSize.Visible   = false;
                DisplayUnits.Visible = false;
                zeroFlagLabel.Text   = "Zero: " + (nativeHost.ZeroFlag ? "True" : "False");
                carryFlagLabel.Text  = "Carry: " + (nativeHost.CarryFlag ? "True" : "False");
            }
            else if (host is InterpretedCog)
            {
                zeroFlagLabel.Text   = "";
                carryFlagLabel.Text  = "";
                OpcodeSize.Visible   = true;
                DisplayUnits.Visible = true;
            }

            programCounterLabel.Text = "PC: " + String.Format("{0:X8}", host.ProgramCursor);
            processorStateLabel.Text = "CPU State: " + host.CogState;
        }
 protected abstract void SetCog(Cog value);
Ejemplo n.º 21
0
 public string EditFirewall(Cog.MLIAD.BusinessLogic.Associate.FirewallRequest firewall)
 {
     try
     {
         MLIADService.SetNoCache();
         string retval = "failure";
         if (firewall.oper == "edit")
             retval = repository.EditFirewall(firewall);
         else if (firewall.oper == "delete")
             retval = repository.DeleteFirewall(firewall.id);
         return retval;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public int ReplyToPostTopic(Cog.MLIAD.BusinessLogic.Associate.Discussion replytopic)
 {
     int retVal = 0;
     try
     {
         using (AssociateConnDataContext asscon = new AssociateConnDataContext())
         {
             retVal = asscon.Post_ReplyToTopic(replytopic.TopicID, replytopic.CreatedBy, replytopic.TopicDesc);
         }
     }
     catch (Exception e)
     {
         throw e;
     }
     return retVal;
 }
Ejemplo n.º 23
0
 public string BroadCastSMS(Cog.MLIAD.BusinessLogic.Associate.SMS newSMS)
 {
     try
     {
         MLIADService.SetNoCache();
         string retval = repository.SendSMS(newSMS);
         return retval;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public string AddSoftware(Cog.MLIAD.BusinessLogic.Associate.SoftwareRequest software)
 {
     using (AssociateConnDataContext asscon = new AssociateConnDataContext())
     {
         try
         {
             int retval = asscon.Add_Software(software.SoftResourceID, software.SoftCategoryID, software.SoftVersionID, software.ProjectID);
             if (retval == 1)
                 return "sucess";
             else
                 return "failure";
         }
         catch (Exception ex)
         {
             throw ex;
         }
     }
 }
        public string AddMobileAssociate(Cog.MLIAD.BusinessLogic.Associate.Associate associate)
        {
            using (AssociateConnDataContext asscon = new AssociateConnDataContext())
            {
                try
                {
                    int retasct = 0;
                    retasct = asscon.Add_MobileAssociate(associate.AssociateID, associate.FirstName, associate.LastName, associate.Mobile, associate.email,true, associate.Password,associate.Gender);
                    if (!(retasct == 0))
                    {
                        return "success";
                    }
                    else
                        return "failure";
                }
                catch (Exception ex)
                {
                    throw ex;
                }

            }
        }
Ejemplo n.º 26
0
        public override void PhysicsUpdate(Cog.Modules.EventHost.PhysicsUpdateEvent ev)
        {
            sc.Scale = Size;
            var player = ((MainScene)Scene).Player;
            if (!player.DoRemove)
            {
                if (player.BoundingBox.Intersects(BoundingBox))
                {
                    player.Remove();

                    Program.EnemyHit.Play();
                    Engine.InvokeTimed(1f, offset =>
                    {
                        Engine.SceneHost.Pop();
                        Engine.SceneHost.Push(Engine.SceneHost.CreateGlobal<MainScene>());
                    });
                }

            }
            else
                player = null;

            if (player != null && player.Enabled)
            {
                if (!activated)
                {
                    if ((WorldCoord - player.WorldCoord).Length < 400f)
                    {
                        activated = true;
                    }
                }
                else
                {
                    timeSinceJump += ev.DeltaTime;

                    if (timeSinceJump >= 1f)
                    {
                        if (IsOnGround)
                        {
                            if (player.WorldCoord.X < WorldCoord.X)
                            {
                                Speed.X = -200f;
                                Speed.Y = -300f;
                            }
                            else
                            {
                                Speed.X = 200f;
                                Speed.Y = -300f;
                            }
                            timeSinceJump = 0f;
                        }
                    }
                }

                if (!IsOnGround)
                {
                    if (Mathf.Abs(player.WorldCoord.X - WorldCoord.X) < 16f)
                    {
                        Speed.X *= Mathf.Max(0f, 1f - ev.DeltaTime * 20f);
                    }
                }
            }

            base.PhysicsUpdate(ev);
        }
Ejemplo n.º 27
0
        public Pager<Cog.MLIAD.BusinessLogic.Associate.SoftwareRequest> SearchSoftware(Cog.MLIAD.BusinessLogic.Associate.SoftwareRequest software, string page, string row, string totalcount)
        {
            try
            {
                int? count = 0;
                int pageIndex = Convert.ToInt32(page);
                int pageSize = Convert.ToInt32(row);
                Pager<Cog.MLIAD.BusinessLogic.Associate.SoftwareRequest> pager = new Pager<Cog.MLIAD.BusinessLogic.Associate.SoftwareRequest>();
                MLIADService.SetNoCache();
                List<Cog.MLIAD.BusinessLogic.Associate.SoftwareRequest> softwares = repository.SearchSoftware(software, (pageIndex - 1), pageSize, ref count);

                pager.Items = softwares;
                pager.Page = pageIndex;
                pager.ItemCount = (count == null) ? 0 : Convert.ToInt32(count);
                pager.PageTotal = ((pager.ItemCount + pageSize - 1) / pageSize);
                pager.PageSize = pageSize;
                return pager;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public int PostTopic(Cog.MLIAD.BusinessLogic.Associate.Discussion newtopic)
 {
     int retVal = 0;
     try
     {
         using (AssociateConnDataContext asscon = new AssociateConnDataContext())
         {
             retVal = asscon.Post_NewTopic(newtopic.TopicHeader, newtopic.IsParent, newtopic.CreatedBy, newtopic.GroupID, newtopic.TopicDesc, newtopic.Category.CategoryID);
         }
     }
     catch (Exception e)
     {
         throw e;
     }
     return retVal;
 }
Ejemplo n.º 29
0
        public void Tick(ulong pins)
        {
            switch (CtrMode)
            {
            case CounterMode.DISABLED:
            case CounterMode.PLL_INTERNAL:
            case CounterMode.PLL_SINGLE_ENDED:
            case CounterMode.PLL_DIFFERENTIAL:
                break;

            case CounterMode.NCO_SINGLE_ENDED:
                PHS += FRQ;
                OutA = (PHS & 0x80000000) != 0;
                break;

            case CounterMode.NCO_DIFFERENTIAL:
                PHS += FRQ;
                OutA = (PHS & 0x80000000) != 0;
                OutB = !OutA;
                break;

            case CounterMode.DUTY_SINGLE_ENDED:
            {
                long o = (long)PHS + (long)FRQ;

                PHS  = (uint)o;
                OutA = o > 0xFFFFFFFF;
            }
            break;

            case CounterMode.DUTY_DIFFERENTIAL:
            {
                long o = (long)PHS + (long)FRQ;

                PHS  = (uint)o;
                OutA = o > 0xFFFFFFFF;
                OutB = !OutA;
            }
            break;

            case CounterMode.POS_DETECTOR:
                if (PinA)
                {
                    PHS += FRQ;
                }
                break;

            case CounterMode.POS_DETECTOR_FEEDBACK:
                if (PinA)
                {
                    PHS += FRQ;
                }
                OutB = !PinA;
                break;

            case CounterMode.POSEDGE_DETECTOR:
                if (PinA && !PinA_)
                {
                    PHS += FRQ;
                }
                break;

            case CounterMode.POSEDGE_DETECTOR_FEEDBACK:
                if (PinA && !PinA_)
                {
                    PHS += FRQ;
                }
                OutB = !PinA;
                break;

            case CounterMode.NEG_DETECTOR:
                if (!PinA)
                {
                    PHS += FRQ;
                }
                break;

            case CounterMode.NEG_DETECTOR_FEEDBACK:
                if (!PinA)
                {
                    PHS += FRQ;
                }
                OutB = !PinA;
                break;

            case CounterMode.NEGEDGE_DETECTOR:
                if (!PinA && PinA_)
                {
                    PHS += FRQ;
                }
                break;

            case CounterMode.NEGEDGE_DETECTOR_FEEDBACK:
                if (!PinA && PinA_)
                {
                    PHS += FRQ;
                }
                OutB = !PinA;
                break;

            default:
                // changed to NOT ConditionCompare(.) to repair Logic Modes Counter
                if (!Cog.ConditionCompare((CogConditionCodes)((int)CtrMode - 16), PinA, PinB))
                {
                    PHS += FRQ;
                }
                break;
            }

            // Cycle in our previous pin states

            ulong Input = Host.IN;

            PinA_ = PinA;   // Delay by 2
            PinA  = (Input & PinAMask) != 0;
            PinB  = (Input & PinBMask) != 0;
        }
        public string AddFirewall(Cog.MLIAD.BusinessLogic.Associate.FirewallRequest firewall)
        {
            using (AssociateConnDataContext asscon = new AssociateConnDataContext())
            {
                try
                {
                    int retval = asscon.Add_Firewall(firewall.FirewallRequestDesc, firewall.Destination, firewall.Source, firewall.Port, firewall.ProjectID);
                    if (retval == 1)
                        return "sucess";
                    else
                        return "failure";

                }
                catch (Exception ex)
                {
                    throw ex;
                }

            }
        }
Ejemplo n.º 31
0
 public string EditCategory(Cog.MLIAD.BusinessLogic.Associate.Category category)
 {
     try
     {
         MLIADService.SetNoCache();
         string retval = "failure";
         retval = repository.EditCategory(category);
         return retval;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public string SendSMS(Cog.MLIAD.BusinessLogic.Associate.SMS newSMS)
        {
            string retVal = "Sent failed..";
            //string status;
            //newSMS.userID = "8961540630";
            //newSMS.password = "******";

            //CookieContainer cookie = SMSClientLib.Login.Connect(newSMS.userID, newSMS.password, out status);
            //if (status.ToLower() == "connected")
            //{
            //    string[] smsTextList = CreateSMSText(newSMS.smsBody, 140);
            //    string[] siteParameters = SMSClientLib.Login.GetSiteParameters(cookie);
            //    string messgeSentResult = "";

            //    for (int i = 0; i < smsTextList.Length; i++)
            //    {
            //        messgeSentResult = SMSClientLib.SendSMS.Send_Processing(newSMS.toList, smsTextList[i], cookie, siteParameters);
            //    }

            //    retVal = "Sent Successfully..";
            //}

            WebRequest request;
            WebResponse response;
            StreamReader reader;
            string url = "";
            string urlText = "";
            string[] mobileNumber = newSMS.toList.Split(';');

            for (int i = 0; i < mobileNumber.Length; i++)
            {
                // sample url: "http://203.92.40.186:8181/Sun3/Send_SMS2x?user=cogniz&password=cogniz123&PhoneNumber=91<MobileNumber>&sender=COGNIZ&text=<SMS text>"
                url = "http://203.92.40.186:8181/Sun3/Send_SMS2x?user=cogniz&password=cogniz123&PhoneNumber=" + mobileNumber[i] + "&sender=COGNIZ&text=" + newSMS.smsBody;
                request = HttpWebRequest.Create(url);
                response = request.GetResponse();
                reader = new StreamReader(response.GetResponseStream());
                urlText = reader.ReadToEnd();
                retVal = (urlText == "Message has been accepted.") ? "Sent Successfully.." : "Sent failed..";
            }

            return retVal;
        }
Ejemplo n.º 33
0
 public string AddSoftware(Cog.MLIAD.BusinessLogic.Associate.SoftwareRequest software)
 {
     try
     {
         MLIADService.SetNoCache();
         return repository.AddSoftware(software);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public string ChangePassword(Cog.MLIAD.BusinessLogic.Associate.ChangePassword obj)
        {
            string returnValue = string.Empty;
                try
                {
                    using (AssociateConnDataContext asscon = new AssociateConnDataContext())
                    {
                        int? output = 0;
                        var retVal = asscon.sp_ChangePassword(obj.AssociateID, obj.CurrentPassword, obj.NewPassword, ref output);
                        if (output != null)
                        {
                            returnValue = Convert.ToString(output);
                        }
                        else
                        {
                            returnValue = "3";
                        }

                    }

                }
                catch (Exception ex)
                {
                    returnValue = "3";
                    throw ex;
                }
                return returnValue;
        }
Ejemplo n.º 35
0
 public void OnAttach(Cog cog)
 {
     AttachedCog = cog;
     HasCog      = true;
 }
        public string AddCategory(Cog.MLIAD.BusinessLogic.Associate.Category category)
        {
            using (AssociateConnDataContext asscon = new AssociateConnDataContext())
            {
                try
                {
                    int retasct = 0;
                    retasct = asscon.Add_Category(category.CategoryDesc, category.IsActive);
                    if (!(retasct == 0))
                        return "success";
                    else
                        return "failure";
                }
                catch (Exception ex)
                {
                    throw ex;
                }

            }
        }
Ejemplo n.º 37
0
 public string ChangePassword(Cog.MLIAD.BusinessLogic.Associate.ChangePassword obj)
 {
     try
     {
         MLIADMobileService.SetNoCache();
         return repository.ChangePassword(obj);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }