Beispiel #1
0
 public void UpdateADGroupsForUser(int userId, ADInfo info)
 {
     //TODO: optimize this insert
     Update(UpdateADGroupsForUserQuery, Config.Get("mysql_db"), userId);
     foreach (var group in info.Groups)
     {
         Insert(UpdateADGroupsForUser2Query, Config.Get("mysql_db"), userId, E(group));
     }
 }
        public void UpdateComputerDescription()
        {
            bool descUpdated = ADManager.UpdateComputerDescription(Computer.Name, _view.DescriptionBox.Text);

            if (descUpdated)
            {
                _view.DisplayMessage("AD Description has been updated for " + Computer.Name, "");
            }
            _view.DescriptionLabel.Text = ADInfo.GetComputerDescription(Computer.Name);
            HideDescriptionBox();
        }
Beispiel #3
0
        internal static int AddClickInfo(ADInfo model)
        {
            using (var cn = new MySqlConnection(sqlconnectionString))
            {
                cn.Open();
                StringBuilder str = new StringBuilder();
                str.Append(@"" + database1 + @".sp_click_channel");
                cn.Query <ADInfo>(str.ToString(), param: new { V_IP = model.IP, V_Channel = model.ChannlID, V_URL = model.Url }, commandType: CommandType.StoredProcedure);

                return(1);
            }
        }
        public void Update(Computer computer)
        {
            Computer = computer;
            _view.ComputerNameLabel   = computer.Name;
            _view.Description         = computer.Description;
            _view.DescriptionBox.Text = _view.Description;
            HideDescriptionBox();
            _view.BitLockerRecoveryKey = ADInfo.GetBLRecoveryKey(computer.Name);
            _view.OrganizationalUnit   = ADInfo.GetComputerOU(computer.Name);
            bool isOnline = IsOnlineStatus();

            SetSystemInformation(isOnline);
            _view.ShowSystemInfo();
        }
Beispiel #5
0
 public void SaveAD(ADInfo info)
 {
     if (Path == null)
     {
         return;
     }
     if (ADFile == null)
     {
         ADFile = new PingFile(ProjectName, "ad");
         ADFile.SetPath(new DirectoryInfo(Path));
         ADFile.Create(info.PingNum);
         ADFile.Write(info.SavePackage());
         return;
     }
     if (ADFile.PingID != info.PingNum) //新的ping号
     {
         ADFile.Close();
         ADFile.Create(info.PingNum);
     }
     ADFile.Write(info.SavePackage());
 }
Beispiel #6
0
        public ActionResult UCTT()
        {
            string ispost = Request["ispost"];
            string ip     = Request.UserHostAddress;

            ADInfo info = new ADInfo()
            {
                ChannlID = 10025, IP = ip, Url = "/AD/UCTT"
            };

            ADBLL.Add(info);

            ADInfo info2 = new ADInfo()
            {
                ChannlID = 10025, IP = ip, Url = "/AD/UCTT"
            };

            ADBLL.AddClickInfo(info2);


            return(Redirect("https://itunes.apple.com/cn/app/id1066070758"));
        }
Beispiel #7
0
 private void OnAddClick(object sender, EventArgs e)
 {
     ValidateForm();
     if (errorInForm)
     {
         return;
     }
     else
     {
         var pathExists = ADInfo.DoesPathExist(OrgUnit);
         if (pathExists)
         {
             if (isWorkstationAdd)
             {
                 AddWorkstationOU();
             }
         }
         else
         {
             MessageBox.Show("Unable to locate path " + "\n" + OrgUnit + "\n" + "in the Directory for domain " + ADContext.DomainSimpleName + "." + "\n" + "Please enter a valid path.");
         }
     }
 }
Beispiel #8
0
 public static int AddClickInfo(ADInfo adInfo)
 {
     return(ADDAL.AddClickInfo(adInfo));
 }
Beispiel #9
0
 public static int Add(ADInfo adInfo)
 {
     return(ADDAL.Add(adInfo));
 }
Beispiel #10
0
    //广告修改
    public void EditAD()
    {
        int      Ad_ID         = tools.CheckInt(Request.Form["Ad_ID"]);
        string   Ad_Title      = tools.CheckStr(Request.Form["Ad_Title"]);
        string   Ad_Kind       = tools.CheckStr(Request.Form["Ad_Kind"]);
        int      Ad_MediaKind  = tools.CheckInt(Request.Form["Ad_MediaKind"]);
        string   Ad_Media      = tools.CheckStr(Request.Form["Ad_Media"]);
        string   Ad_Mediacode  = Request.Form["Ad_Mediacode"];
        string   Ad_Link       = tools.CheckStr(Request.Form["Ad_Link"]);
        int      Ad_Show_Freq  = tools.CheckInt(Request.Form["Ad_Show_Freq"]);
        int      Ad_Show_times = tools.CheckInt(Request.Form["Ad_Show_times"]);
        int      Ad_Hits       = tools.CheckInt(Request.Form["Ad_Hits"]);
        DateTime Ad_StartDate  = tools.NullDate(Request.Form["Ad_StartDate"]);
        DateTime Ad_EndDate    = tools.NullDate(Request.Form["Ad_EndDate"]);
        int      Ad_IsContain  = tools.CheckInt(Request.Form["Ad_IsContain"]);
        string   Ad_Propertys  = tools.CheckStr(Request.Form["Ad_Propertys"]);
        int      Ad_Sort       = tools.CheckInt(Request.Form["Ad_Sort"]);
        int      Ad_IsActive   = tools.CheckInt(Request.Form["Ad_IsActive"]);
        string   Ad_Site       = Public.GetCurrentSite();
        int      U_Ad_Audit    = tools.CheckInt(Request.Form["U_Ad_Audit"]);

        if (Ad_MediaKind == 4)
        {
            Ad_Media = Ad_Mediacode;
        }
        if (Ad_MediaKind == 1)
        {
            Ad_Media = "";
        }

        if (Ad_Title == "")
        {
            Public.Msg("error", "错误信息", "请填写广告名称", false, "{back}");
        }
        if (Ad_Kind == "")
        {
            Public.Msg("error", "错误信息", "请选择广告位置", false, "{back}");
        }
        if (Request.Form["Ad_EndDate"] == "" || Request.Form["Ad_EndDate"] == "")
        {
            Public.Msg("error", "错误信息", "请选择广告起止时间", false, "{back}");
        }
        if ((Ad_MediaKind > 1) && Ad_Media == "")
        {
            Public.Msg("error", "错误信息", "请设置广告媒体", false, "{back}");
        }
        Ad_Propertys = "|" + Ad_Propertys + "|";

        ADInfo entity = GetADByID(Ad_ID);

        if (entity != null)
        {
            entity.Ad_ID         = Ad_ID;
            entity.Ad_Title      = Ad_Title;
            entity.Ad_Kind       = Ad_Kind;
            entity.Ad_MediaKind  = Ad_MediaKind;
            entity.Ad_Media      = Ad_Media;
            entity.Ad_Link       = Ad_Link;
            entity.Ad_Show_Freq  = Ad_Show_Freq;
            entity.Ad_Show_times = Ad_Show_times;
            entity.Ad_Hits       = Ad_Hits;
            entity.Ad_StartDate  = Ad_StartDate;
            entity.Ad_EndDate    = Ad_EndDate;
            entity.Ad_IsContain  = Ad_IsContain;
            entity.Ad_Propertys  = Ad_Propertys;
            entity.Ad_Sort       = Ad_Sort;
            entity.Ad_IsActive   = Ad_IsActive;
            entity.Ad_Site       = Ad_Site;



            if (MyAD.EditAD(entity, Public.GetUserPrivilege()))
            {
                Public.Msg("positive", "操作成功", "操作成功", true, "AD.aspx");
            }
            else
            {
                Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}");
            }
        }
        else
        {
            Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}");
        }
    }
 public void SaveAD(ADInfo adInfo)
 {
     TraceFile.Instance.SaveAD(adInfo);
 }