/// <summary>
 /// Initializes a channel with the specified data.
 /// </summary>
 public Teamspeak3Channel(Teamspeak3Group info = null)
 {
     Basic    = new BasicInfo();
     Normal   = new NormalInfo();
     Advanced = new AdvancedInfo();
     Update(info);
 }
예제 #2
0
 public ReportedSong(BasicInfo Reporter, SongInfo Song, string ReportDate, 
     string ReportType, string Comment)
 {
     this.Reporter = Reporter;
     this.Song = Song;
     this.ReportDate = ReportDate;
     this.ReportType = ReportType;
     this.Comment = Comment;
 }
예제 #3
0
 public ShoutboxEntry(int MessageId, BasicInfo Sender, string SendDate, string Title, string Body)
 {
     this.MessageId = MessageId;
     this.Sender = Sender;
     this.SendDate = SendDate;
     this.Title = Title;
     this.Body = Body;
     this.Receiver = new BasicInfo(-1, "", "", "");
 }
예제 #4
0
 internal static bool IsISOModified(CameraStatus status, BasicInfo<string> latest)
 {
     if (latest == null)
     {
         return false;
     }
     var previous = status.ISOSpeedRate;
     status.ISOSpeedRate = latest;
     return IsModified(previous, latest);
 }
예제 #5
0
 internal static bool IsExposureModeInfoModified(CameraStatus status, BasicInfo<string> latest)
 {
     if (latest == null)
     {
         return false;
     }
     var previous = status.ExposureMode;
     status.ExposureMode = latest;
     return IsModified(previous, latest);
 }
예제 #6
0
 internal static bool IsFNumberModified(CameraStatus status, BasicInfo<string> latest)
 {
     if (latest == null)
     {
         return false;
     }
     var previous = status.FNumber;
     status.FNumber = latest;
     return IsModified(previous, latest);
 }
예제 #7
0
 public static int GetSelectedIndex(BasicInfo<int> info)
 {
     if (info == null || info.candidates == null || info.candidates.Length == 0)
     {
         return 0;
     }
     for (int i = 0; i < info.candidates.Length; i++)
     {
         if (info.candidates[i] == info.current)
         {
             return i;
         }
     }
     return 0;
 }
예제 #8
0
 public static BasicInfo<string> FromPostViewSize(BasicInfo<string> info)
 {
     if (info == null || info.candidates == null || info.candidates.Length == 0)
     {
         return new BasicInfo<string>
         {
             candidates = new string[] { Resources.AppResources.Disabled },
             current = Resources.AppResources.Disabled
         };
     }
     var mCandidates = new string[info.candidates.Length];
     for (int i = 0; i < info.candidates.Length; i++)
     {
         mCandidates[i] = FromPostViewSize(info.candidates[i]);
     }
     return new BasicInfo<string>
     {
         current = FromPostViewSize(info.current),
         candidates = mCandidates
     };
 }
예제 #9
0
    public override BasicInfo GetBasicInfo(string filename)
    {
        BasicInfo info = new BasicInfo();

        try
        {
            var format = HgtFormat.Get(filename);
            info.bounds   = Hgt.GetBounds(filename);
            info.isRaster = true;
            // Substract 1 to width/height to avoid overlaps
            info.width              = info.height = format.RowsAndColumns - 1;
            info.degreesPerPixel    = format.GetDegreesPerPixel();
            info.suggestedLayerName = SuggestedLayerName;
            info.suggestedUnits     = SuggestedUnits;
        }
        catch (Exception e)
        {
            Debug.LogException(e);
            return(null);
        }
        return(info);
    }
예제 #10
0
        /// <summary>
        /// 判断是否登录
        /// </summary>
        protected bool checkLogin()
        {
            string str = Commons.Helper.Security.GetCookie();

            if (String.IsNullOrWhiteSpace(str))
            {
                return(false);
            }
            JavaScriptSerializer serializer = new JavaScriptSerializer();

            //string cookieDate = serializer.Serialize(model); //JSON序列化
            UserModel = serializer.Deserialize <BasicInfo>(str);
            if (UserModel == null)
            {
                return(false);
            }
            else
            {
                ViewBag.User = UserModel;
            }
            return(true);
        }
예제 #11
0
        public ActionResult Login(BasicInfo user)
        {
            var obj = db.BasicInfoes.FirstOrDefault(a => a.AdminEmail == user.AdminEmail);

            if (obj != null)
            {
                if (string.Compare(Crypto.Hash(user.AdminPassword), obj.AdminPassword) == 0)
                {
                    Session["AdminLogged"] = true;
                    return(RedirectToAction("Index", "Home"));
                }
                else
                {
                    ViewBag.AdminLoginError = "Email or Password is wrong!";
                }
            }
            else
            {
                ViewBag.AdminLoginError = "Email or Password cannot be empty!";
            }
            return(View());
        }
예제 #12
0
    private string getPersonalCheckIn(int year, int month)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);
        CheckIn   ci   = CheckIn.GetPersonalCheckInByMonth(year, month, info.StaffName);

        StringBuilder buff = new StringBuilder();

        buff.Append("<tr>");
        buff.Append("<td>应出勤天数</td>");
        buff.Append("<td>实际出勤天数</td>");
        buff.Append("<td>10分钟以内</td>");
        buff.Append("<td>10到30分钟</td>");
        buff.Append("<td>30分钟以上</td>");
        buff.Append("<td>迟到/早退次数</td>");

        buff.Append("<td>丧假</td>");
        buff.Append("<td>病假</td>");
        buff.Append("<td>事假</td>");
        buff.Append("<td>考勤绩效加减分</td>");


        buff.Append("<td>年末结余假</td>");
        buff.Append("<td>本月加班</td>");
        buff.Append("<td>本月调休</td>");
        buff.Append("<td>本月结余假</td>");
        buff.Append("</tr>");

        buff.Append("<tr>");

        buff.Append(string.Format("<td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{4}</td><td>{5}</td>", ci.ShouldBe, ci.ActualBe, ci.InnterTen, ci.InnerThirty, ci.OverThirty, ci.Late));

        buff.Append(string.Format("<td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td>", ci.Funneral, ci.Matter, ci.Sick, ci.Performance));

        buff.Append(string.Format("<td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td>", ci.Remaining, ci.OverTime, ci.Shift, ci.AllRemaining));
        buff.Append("</tr>");

        return(buff.ToString());
    }
예제 #13
0
        public RatingDataContainer GetRatings(BasicInfo entityInfo, bool outputResults)
        {
            if (!(entityInfo is T convertedInfo))
            {
                throw new ArgumentException(
                          $"Element \"{entityInfo.Title}\" (ID = {entityInfo.ThingId.ToString()}) " +
                          $"type \"{entityInfo.GetType().FullName}\" is invalid for appraiser with " +
                          $"type \"{TypeId.FullName}\"."
                          );
            }

            double ratingValue = _appraisal.CalculateRating(convertedInfo);

            var resultInfo = new RatingDataContainer(entityInfo, ratingValue, RatingId);

            if (outputResults)
            {
                GlobalMessageHandler.OutputMessage(resultInfo.ToString());
            }

            return(resultInfo);
        }
예제 #14
0
        public List <BasicInfo> GetBasicInfoFromBarcodeFile(string barcodeFilePath)
        {
            List <BasicInfo> list = new List <BasicInfo>();

            using (StreamReader sr = new StreamReader(barcodeFilePath))
            {
                string line = string.Empty;
                while ((line = sr.ReadLine()) != null)
                {
                    if (line.StartsWith("#"))
                    {
                        continue;
                    }

                    if (line == string.Empty)
                    {
                        continue;
                    }

                    string[] s = line.Split(',');

                    BasicInfo item = new BasicInfo();
                    item.ProgramName     = s[0].Trim();
                    item.ZipFile         = s[1].Trim();
                    item.ProgramFolder   = s[2].Trim();
                    item.TestFlow        = s[3].Trim();
                    item.TesterOSVersion = s[4].Trim();
                    item.ModeCode        = s[5].Trim();
                    if (s.Length != 6)
                    {
                        continue;
                    }
                    list.Add(item);
                }
                sr.Close();
            }

            return(list);
        }
예제 #15
0
    /// <summary>
    /// 根据当前审批人,获取下一审批人职位
    /// </summary>
    /// <param name="info"></param>
    /// <returns></returns>
    private string getNextApprover(BasicInfo info)
    {
        string result = null;

        switch (info.Position.Trim())
        {
        case "项目经理": result = Department.GetDepartmentByName(department.Text).ResponsiblePerson; break;

        case "部门经理":  result = "财务主管"; break;

        case "财务主管": result = Department.GetDepartmentByName(department.Text).BULeader; break;

        case "机构负责人": result = "会计"; break;

        case "会计": result = "出纳"; break;

        case "出纳": result = staffName.Text; break;

        default: break;
        }
        return(result);
    }
예제 #16
0
        internal ComTypeTreeNode(BasicInfo basicInfo,
                                 String progId) : base(basicInfo)
        {
            _progId = progId;

            // We only allow classes to be dragged
            if (_memberInfo._typeKind == TYPEKIND.TKIND_COCLASS)
            {
                _isDragSource = true;
            }

            _onDesignSurface = true;

            if (_memberInfo.PresInfo != null)
            {
                _intermediateNodeTypes = new ArrayList();
                _intermediateNodeTypes.Add
                    (_memberInfo.PresInfo._intermediateNodeType);
            }

            PostConstructor();
        }
예제 #17
0
        private void populateOptions()
        {
            try
            {
                buildOptions = BasicInfo.LoadOptions();
            }
            catch (XmlException ex)
            {
                Dialogs.ErrorMessage(ex.Message);
                return;
            }

            optionsToControl = new Dictionary <string, UserControl>()
            {
                { "General", new GeneralControl(buildOptions) }
            };

            foreach (string option in buildOptions.options)
            {
                listViewOptions.Items.Add(option);
            }
        }
예제 #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!PageAuthorityManage.hasAuthority(info, "出差总结"))
        {
            Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='../Account/ApplyListPage.aspx'</script>");
        }

        if (!IsPostBack)
        {//首次加载才需要绑定
            DataSet allPro = ProjectInfo.GetAllProjects();
            projectNameList.DataSource     = allPro.Tables[0].DefaultView;
            projectNameList.DataTextField  = "ProjectName";
            projectNameList.DataValueField = "ProjectName";
            projectNameList.DataBind();

            staffName.Text  = info.StaffName;
            department.Text = info.Department;
        }
    }
    /// <summary>
    /// 根据当前审批人,获取下一审批人职位
    /// </summary>
    /// <param name="info"></param>
    /// <returns></returns>
    private string getNextApprover(BasicInfo info)
    {
        string result = null;

        switch (info.Position.Trim())
        {
        case "项目经理": result = Department.GetDepartmentByName(department.Text).ResponsiblePerson; break;

        case "部门经理": result = "财务主管"; break;     //result = BasicInfo.GetDepartmentManager(info.StaffID);

        case "财务主管": result = judgeAdjust("财务主管", department.Text); break;

        case "机构负责人": result = "会计"; break;

        case "会计": result = judgeAdjust("会计", department.Text); break;

        case "出纳": result = staffName.Text; break;

        default: break;
        }
        return(result);
    }
예제 #20
0
        // GET: Resume
        public ActionResult Create()
        {
            getAllLists obj = new getAllLists();

            ViewBag.Cities     = obj.getCities();
            ViewBag.Countaries = obj.getCountaries();
            ViewBag.Degrees    = obj.getDegrees();
            ViewBag.Institutes = obj.getInstitutes();
            BasicInfo b  = new BasicInfo();
            ExpInfo   e1 = new ExpInfo();
            ExtraInfo e2 = new ExtraInfo();

            ViewBag.isBasicInfoExist = b.isBasicInfoFound(uid);
            ViewBag.isExpInfoExist   = e1.isExpInfoFound(uid);
            ViewBag.isExtraInfoExist = e2.isExtraInfoFound(uid);

            UserInfo u = new UserInfo();

            ViewBag.UserInfo = u.getUserInfo(uid);

            return(View());
        }
예제 #21
0
        // Used to get the basic info that is used by this type
        // of node
        protected override Object ProcessChild(RegistryKey key,
                                               String subKeyName)
        {
            BasicInfo info = new BasicInfo(key, subKeyName);

            foreach (String valueName in key.GetValueNames())
            {
                if (valueName != null &&
                    !valueName.Equals("") &&
                    info.Name == null)
                {
                    info.Name = (String)key.GetValue(valueName);
                }
            }
            if (info.Name == null)
            {
                info.Name      = subKeyName;
                info.PrintName = subKeyName + " (guid)";
            }
            info._infoType = "Category";
            return(info);
        }
        private async Task SplitQueue(BufferBlock <BasicInfo> rawDataQueue,
                                      IList <BufferBlock <BasicInfo> > consumers)
        {
            while (await rawDataQueue.OutputAvailableAsync())
            {
                BasicInfo entity = await rawDataQueue.ReceiveAsync();

                if (_outputResults)
                {
                    GlobalMessageHandler.OutputMessage($"Got {entity}");
                }

                await Task.WhenAll(
                    consumers.Select(async consumer => await consumer.SendAsync(entity))
                    );
            }

            foreach (BufferBlock <BasicInfo> consumer in consumers)
            {
                consumer.Complete();
            }
        }
예제 #23
0
        /// <summary>
        /// 更新基础物品
        /// </summary>
        /// <param name="planCost">要修改的记录</param>
        /// <param name="newPrice">新基础物品</param>
        /// <returns>返回更改后的记录</returns>
        private View_F_GoodsPlanCost UpdatePlanPrice(View_F_GoodsPlanCost planCost, decimal newPrice)
        {
            if (!BasicInfo.IsFuzzyContainsRoleName("库管理员") &&
                (planCost.录入员编码 != BasicInfo.LoginID || planCost.日期 != ServerTime.Time.Date))
            {
                return(planCost);
            }

            planCost.单价 = newPrice;

            if (cmbUnit.SelectedIndex < 0)
            {
                cmbUnit.SelectedValue = planCost.单位ID;
            }

            //if (!m_basicGoodsServer.UpdateGoodsPrice(planCost.序号, newPrice, (int)cmbUnit.SelectedValue, BasicInfo.LoginID, out m_error))
            //{
            //    MessageDialog.ShowErrorMessage(m_error);
            //}

            return(planCost);
        }
예제 #24
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Alias,Email,Expertise,Team")] BasicInfo basicInfo)
        {
            if (id != basicInfo.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(basicInfo);
                    var blogs = from b in blgcontext.Blog
                                where b.AuthorEmail == basicInfo.Email
                                select b;
                    foreach (var blog in blogs)
                    {
                        blog.AuthorAlias = basicInfo.Alias;
                    }
                    await _context.SaveChangesAsync();

                    await blgcontext.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BasicInfoExists(basicInfo.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(basicInfo));
        }
예제 #25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!PageAuthorityManage.hasAuthority(info, "组织管理"))
        {
            Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='../Account/ApplyListPage.aspx'</script>");
        }
        if (!IsPostBack)
        {//初次加载
            DataSet allBU = BusinessUnit.GetAllBU();
            buList.DataSource     = allBU.Tables[0].DefaultView;
            buList.DataTextField  = "UnitName";
            buList.DataValueField = "UnitID";
            buList.DataBind();
        }
        else
        {
            if (Department.hasDepartmentInfo(Request["departmentName"].Trim()))
            {
                string name   = Request["departmentName"];
                string boss   = Request["boss"];
                string leader = Request["leader"];
                Session["tempName"]   = name;
                Session["tempBoss"]   = boss;
                Session["tempLeader"] = leader;
                Session["tempParent"] = buList.SelectedValue;

                Response.Write("<Script Language='JavaScript'>if ( window.confirm('部门已存在,确认更新?')) {window.location.href='DepartmentUpdate.aspx' } else {window.location.href='#' };</script>");
            }
            else
            {
                Department.SetDepartment(Request["departmentName"], Convert.ToInt32(buList.SelectedValue), Request["boss"], Request["leader"]);
                Response.Redirect("~/Account/BasicInfo.aspx");
            }
        }
    }
예제 #26
0
        public ActionResult EditBasicInfo(BasicInfoViewModel aBasicInfoViewModel)
        {
            BitBookContext db        = new BitBookContext();
            string         userEmail = "";

            userEmail = Session["email"].ToString();

            var user = db.Users.FirstOrDefault(x => x.Email.Equals(userEmail));
            //save new record in database
            BasicInfo aBasicInfo = new BasicInfo();

            aBasicInfo                = db.BasicInfos.SingleOrDefault(x => x.UserId == user.Id);
            aBasicInfo.About          = aBasicInfoViewModel.About;
            aBasicInfo.AreaOfInterest = aBasicInfoViewModel.AreaOfInterest;
            aBasicInfo.Location       = aBasicInfoViewModel.Location;
            aBasicInfo.Education      = aBasicInfoViewModel.Education;
            aBasicInfo.Experience     = aBasicInfoViewModel.Experience;
            //Save in db
            db.BasicInfos.AddOrUpdate(aBasicInfo);
            db.SaveChanges();

            return(RedirectToAction("UserProfile", "Registration"));
        }
예제 #27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!PageAuthorityManage.hasAuthority(info, "车辆使用登记"))
        {
            Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='ApplyListPage.aspx'</script>");
        }
        ScriptManager1.RegisterAsyncPostBackControl(addRow);
        if (ViewState["count"] != null)
        {
            for (int i = 0; i < Convert.ToInt16(ViewState["count"]); i++)
            {
                addNewRow();
            }
        }
        if (!IsPostBack)
        {
            staffName.Text  = info.StaffName;
            department.Text = info.Department;
        }
    }
예제 #28
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (basicInfoId != 0)//修改
         {
             btn_Add.Text = "确认修改";
             //回填
             try
             {
                 BasicInfo basic = BasicInfo.FindById(basicInfoId);
                 tb_name.Text  = basic.Name;
                 tb_phone.Text = basic.Phone;
                 tb_email.Text = basic.Email;
             }
             catch (Exception ex)
             {
                 text(ex.ToString());
                 Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "alert('数据加载错误,请重新再试!')", true);
             }
         }
     }
 }
예제 #29
0
        public GhostReplay(string file, string gameversion, bool usecache, string tempdir)
        {
            IsPBE = File.Exists(tempdir + @"\ISPBE");

            PlayerInfos    = new BasicInfo();
            Header         = new ReplayHeader();
            UseCache       = usecache;
            CacheDirectory = tempdir + @"\" + Path.GetFileNameWithoutExtension(file);
            GameVersion    = gameversion;

            Keys   = new List <GameData>();
            Chunks = new List <GameData>();

            FileName = file;
            if (UseCache)
            {
                if (!Directory.Exists(CacheDirectory))
                {
                    Directory.CreateDirectory(CacheDirectory);
                }
                RestoreFromCache();
            }
        }
예제 #30
0
        public void InitializeChromosome(Inputs _inputs)
        {
            Chromosome = new List <Gene> [_inputs.numberOfSatelites];
            // CollectionsInfo = new BasicInfo[_inputs.numberOfCollections];
            KeyValuePairs = new Dictionary <int, BasicInfo>(_inputs.numberOfCollections);
            // Loading = new Dictionary<int, int>(_inputs.numberOfSatelites);

            for (int i = 0; i < (_inputs.numberOfSatelites + Math.Abs(_inputs.numberOfSatelites - _inputs.numberOfCollections)); i++)
            {
                if (i < _inputs.numberOfSatelites)
                {
                    Chromosome[i] = new List <Gene>();
                    // Loading[i] = 0;
                }
                if (i < _inputs.numberOfCollections)
                {
                    BasicInfo basicInfo = new BasicInfo();
                    basicInfo.Worth       = _inputs.collections[i].V;
                    basicInfo.L           = _inputs.collections[i].L;
                    basicInfo.Photographs = new List <int>();
                    // CollectionsInfo[i] = basicInfo;
                    KeyValuePairs.Add(i, basicInfo);
                }
            }
            Fitness = 0;
            AverageCollectionWorth = 0;

            // test
            foreach (var collection in _inputs.collections.OrderByDescending(x => x.V))
            {
                Guide guide = new Guide();
                guide.LocationFrom = collection.Locations.First().Id;
                guide.LocationTo   = collection.Locations.Last().Id;
                guide.L            = collection.L;
                guide.Worth        = collection.V;
            }
        }
예제 #31
0
        public ActionResult CreateExtrainfo()
        {
            JobResumeExtra er = new JobResumeExtra();

            er.extraactivities = Request["extraact"];
            er.otherinterests  = Request["othrint"];
            er.namep1          = Request["refperson1"];
            er.affp1           = Request["affperson1"];
            er.php1            = Request["phref1"];
            er.emailp1         = Request["refemail1"];
            er.namep2          = Request["refperson2"];
            er.affp2           = Request["affperson2"];
            er.php2            = Request["phref2"];
            er.emailp2         = Request["refemail2"];
            er.userId          = uid;
            ExtraInfo obj = new ExtraInfo();

            obj.addExtraInfo(er);
            getAllLists obj3 = new getAllLists();

            ViewBag.Cities     = obj3.getCities();
            ViewBag.Countaries = obj3.getCountaries();
            ViewBag.Degrees    = obj3.getDegrees();
            ViewBag.Institutes = obj3.getInstitutes();
            BasicInfo b  = new BasicInfo();
            ExpInfo   e1 = new ExpInfo();
            ExtraInfo e2 = new ExtraInfo();

            ViewBag.isBasicInfoExist = b.isBasicInfoFound(uid);
            ViewBag.isExpInfoExist   = e1.isExpInfoFound(uid);
            ViewBag.isExtraInfoExist = e2.isExtraInfoFound(uid);

            UserInfo u = new UserInfo();

            ViewBag.UserInfo = u.getUserInfo(uid);
            return(View("Create"));
        }
예제 #32
0
        public string GetImageLink(BasicInfo data, ImageSize imageSize)
        {
            if (_serviceConfigurationInfo is null)
            {
                _serviceConfigurationInfo = TmdbServiceConfiguration.Configuration;
            }
            _serviceConfigurationInfo.ThrowIfNull(nameof(_serviceConfigurationInfo));

            if (!(data is TmdbMovieInfo movieInfo))
            {
                throw new ArgumentException("Data handler has invalid type.", nameof(data));
            }

            int sizeIndex = GetImageSizeIndex(imageSize,
                                              _serviceConfigurationInfo.PosterSizes.Count);

            string imageSizeValue = _serviceConfigurationInfo.PosterSizes[sizeIndex];


            string result = _serviceConfigurationInfo.SecureBaseUrl + imageSizeValue +
                            movieInfo.PosterPath;

            return(result);
        }
        private void getTreenode(TreeNode tn, string path)
        {
            tn.Nodes.Clear();
            ClovershellWrapper.FolderDetail fd = ClovershellWrapper.getInstance().GetFolderDetail(path);

            for (int x = 1; x < fd.Folders.Count(); x++)
            {
                string s = fd.Folders[x];
                if (s.ToLower().StartsWith("clv"))
                {
                    BasicInfo bi = getFolderName(path + s + "/" + s + ".desktop");
                    TreeNode  c  = new TreeNode(bi.name);


                    tn.Nodes.Add(c);
                    if (bi.exec.StartsWith("/bin/chmenu"))
                    {
                        c.Tag                = basepath + bi.exec.Replace("/bin/chmenu ", "").Trim() + "/";
                        c.ImageIndex         = 1;
                        c.SelectedImageIndex = 1;

                        /*    if (bi.name != "Back")
                         *  {
                         *      getTreenode(c, basepath + bi.exec.Replace("/bin/chmenu ", "").Trim() + "/");
                         *  }*/
                    }
                    else
                    {
                        c.Tag                = path + s;
                        c.ImageIndex         = 0;
                        c.SelectedImageIndex = 0;
                    }
                }
                //         ProcessTreeNode(c);
            }
        }
예제 #34
0
파일: Form1.cs 프로젝트: mtyh/Analog
        private void Form1_Load(object sender, EventArgs e)
        {
            string    postData = "__VIEWSTATE=dDwtMTM2MTgxNTk4OTs7PkB6%2BSk5sY52cPSnKtSRXI8QsKFr&TextBox1=2011060701309&TextBox2=13434034377feiyu&ddl_js=%D1%A7%C9%FA&Button1=+%B5%C7+%C2%BC+";
            BasicInfo logInfo  = new BasicInfo("http://" + Service.Config.Host + "/default3.aspx", "post", postData, null);

            logInfo.Request();

            if (logInfo.Status)
            {
                Service.isLog(logInfo.PageBody);
                String s  = Service.Config.Scores;
                String s1 = Service.Config.Log;
                String s2 = Service.Config.Main;

                BasicInfo logInfo2 = new BasicInfo("http://" + Service.Config.Host + "/xscjcx.aspx?xh=2011060701309", "post", "", logInfo.Collection);
                logInfo2.Request();


                #region 分析网页html节点
                Lexer    lexer     = new Lexer(logInfo2.PageBody);
                Parser   parser    = new Parser(lexer);
                NodeList htmlNodes = parser.Parse(null);
                this.treeView1.Nodes.Clear();
                this.treeView1.Nodes.Add("root");

                IList list = new ArrayList();

                TreeNode treeRoot = this.treeView1.Nodes[0];
                for (int i = 0; i < htmlNodes.Count; i++)
                {
                    this.RecursionHtmlNode(list, treeRoot, htmlNodes[i], false);
                }

                #endregion
            }
        }
예제 #35
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int           recordID = Convert.ToInt32(Request["RecordID"]);
        int           applyID  = Convert.ToInt32(Request["ApplyID"]);
        bool          rejected = Convert.ToBoolean(Request["rejected"]);
        Apply         ap       = Apply.GetApplyByID(applyID);
        Reimbursement ri       = Reimbursement.GetReimbursementByID(recordID);

        if (!IsPostBack)
        {
            DataSet allPro = ProjectInfo.GetAllProjects();
            accountList.DataSource     = allPro.Tables[0].DefaultView;
            accountList.DataTextField  = "ProjectAccount";
            accountList.DataValueField = "ProjectAccount";
            accountList.DataBind();



            staffName.Text            = ri.StaffName;
            department.Text           = ri.Department;
            manager.Text              = ri.Manager;
            payee.Text                = ri.Payee;
            projectCode.Text          = ri.ProjectCode;
            accountList.SelectedValue = ri.ProjectAccount;
            happenDate.Text           = ri.HappenDate.ToShortDateString();
            reimburseDate.Text        = ri.ReimburestDate.ToShortDateString();
            payeeDate.Text            = ri.PayeeDate.ToShortDateString();
            bill.Text        = ri.Bill.ToString();
            allExpense.Text  = ri.AllExpense.ToString();
            expense.Text     = ri.Expense.ToString();
            capital.Text     = MoneyConvert.convertToCapital(ri.AllExpense.ToString());
            remark.Text      = ri.Remark;
            note.Text        = ri.Note;
            processShow.Text = ri.ApproveProcess;
        }
        //



        //用户权限相关显示功能
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!rejected && ap.NextApprover == ri.StaffName)
        {
            agreeButton.Visible    = false;
            disagreeButton.Visible = false;
            cashierButton.Visible  = false;
            rejectButton.Visible   = false;
            whyDisagree.Visible    = false;
            accountList.Enabled    = false;
            //可打印状态
            proManager.Text = "已签字";
            depManager.Text = "已签字";
            financial.Text  = "已签字";
            company.Text    = "已签字";
        }
        else if (info.StaffName.Trim() == ri.StaffName.Trim() || info.Position.Trim() == "出纳")
        {
            agreeButton.Visible    = false;
            disagreeButton.Visible = false;
            accountList.Enabled    = false;
            if (info.Position.Trim() != "出纳")
            {
                cashierButton.Visible = false;
                rejectButton.Visible  = false;
                whyDisagree.Visible   = false;
            }
        }
        else if (info.Position.Trim() == "会计")
        {
            accountList.Enabled   = true;
            cashierButton.Visible = false;
            rejectButton.Visible  = false;
        }
        else
        {
            accountList.Enabled   = false;
            cashierButton.Visible = false;
            rejectButton.Visible  = false;
        }
        //测试阶段保持处理流程可见,运行阶段记得去掉
        processShow.Visible = true;
    }
예제 #36
0
 internal ComTypeTreeNode(BasicInfo basicInfo) :
     this(basicInfo, null)
 {
 }
예제 #37
0
 public FriendRequest(BasicInfo Sender, string Status)
 {
     this.Sender = Sender;
     this.Status = Status;
 }
예제 #38
0
        // Gets the objects to iterate over to make the child nodes
        protected override ICollection GetChildren()
        {
            lock (_allClasses)
            {
                if (_allClasses.Count > 0)
                {
                    return(_allClasses.Values);
                }

                try
                {
                    IntPtr comObj;
                    int    result = NoGoop.Win32.ActiveX.CoCreateInstance
                                        (ref NoGoop.Win32.ActiveX.CategoriesMgrCLSID,
                                        (IntPtr)0,
                                        NoGoop.Win32.ActiveX.CLSCTX_INPROC_SERVER,
                                        ref NoGoop.Win32.ActiveX.IUnknownIID,
                                        out comObj);

                    TraceUtil.WriteLineInfo(this,
                                            "com create: 0x"
                                            + result.ToString("X")
                                            + " " + comObj);
                    if (result == 0)
                    {
                        ICatInformation catInfo = (ICatInformation)
                                                  Marshal.GetObjectForIUnknown(comObj);

                        // Get the CLSIDs associated with each category
                        Guid[] cats  = new Guid[1];
                        Guid[] cats1 = new Guid[0];
                        cats[0] = _catInfo._guid;
                        IEnumGUID enumClsIds;
                        catInfo.EnumClassesOfCategories(1,
                                                        cats,
                                                        0,
                                                        cats1,
                                                        out enumClsIds);

                        Guid clsId;
                        uint numRet;
                        while (true)
                        {
                            enumClsIds.Next(1, out clsId, out numRet);
                            if (numRet == 0)
                            {
                                break;
                            }

                            BasicInfo info = ComClassInfo.GetClassInfo(clsId);
                            if (info != null)
                            {
                                _allClasses.Add(info, info);
                            }
                        }

                        Marshal.ReleaseComObject(enumClsIds);
                        Marshal.ReleaseComObject(catInfo);
                    }
                }
                catch (Exception ex)
                {
                    TraceUtil.WriteLineIf(null, TraceLevel.Info,
                                          "Categories - failure to read: "
                                          + _catInfo._guid + " " + ex);
                }
                return(_allClasses.Values);
            }
        }
예제 #39
0
 internal static bool IsPostviewSizeInfoModified(CameraStatus status, BasicInfo<string> latest)
 {
     if (latest == null)
     {
         return false;
     }
     var previous = status.PostviewSizeInfo;
     status.PostviewSizeInfo = latest;
     return IsModified(previous, latest);
 }
예제 #40
0
 internal AddEnemy(BasicInfo info, bool isIntersting) : this(info.ID, info.NameEN, info.NameDE, info.GameArea, isIntersting)
 {
 }
예제 #41
0
 public ReportedMessage(BasicInfo Reporter, ShoutboxEntry Message, DateTime ReportDate)
 {
     this.Reporter = Reporter;
     this.Message = Message;
     this.ReportDate = ReportDate;
 }
예제 #42
0
 internal static bool IsSelftimerInfoModified(CameraStatus status, BasicInfo<int> latest)
 {
     if (latest == null)
     {
         return false;
     }
     var previous = status.SelfTimerInfo;
     status.SelfTimerInfo = latest;
     return IsModified(previous, latest);
 }
예제 #43
0
 internal static bool IsShutterSpeedModified(CameraStatus status, BasicInfo<string> latest)
 {
     if (latest == null)
     {
         return false;
     }
     var previous = status.ShutterSpeed;
     status.ShutterSpeed = latest;
     return IsModified(previous, latest);
 }
예제 #44
0
 public RecommendedSong(BasicInfo Sender, BasicInfo Receiver, SongInfo Song)
 {
     this.Sender = Sender;
     this.Receiver = Receiver;
     this.Song = Song;
 }
예제 #45
0
 private static bool IsModified(BasicInfo<int> previous, BasicInfo<int> latest)
 {
     if (previous == null ||
         previous.current != latest.current ||
         previous.candidates.Length != latest.candidates.Length)
     {
         return true;
     }
     foreach (var candidate in latest.candidates)
     {
         if (!previous.candidates.Contains(candidate))
         {
             return true;
         }
     }
     return false;
 }
예제 #46
0
        internal static void GetEvent(string jString, Action<int> error, GetEventHandler result)
        {
            var json = JObject.Parse(jString);
            if (BasicResultHandler.HandleError(json, error))
            {
                return;
            }

            var jResult = json["result"];

            var jApi = jResult[0];
            string[] apis = null;
            if (jApi.HasValues)
            {
                var apilist = new List<string>();
                foreach (var str in jApi["names"].Values<string>())
                {
                    apilist.Add(str);
                }
                apis = apilist.ToArray();
            }

            var jStatus = jResult[1];
            string status = null;
            if (jStatus.HasValues)
            {
                status = jStatus.Value<string>("cameraStatus");
            }

            var jZoom = jResult[2];
            ZoomInfo zoom = null;
            if (jZoom.HasValues)
            {
                zoom = new ZoomInfo
                {
                    position = jZoom.Value<int>("zoomPosition"),
                    number_of_boxes = jZoom.Value<int>("zoomNumberBox"),
                    current_box_index = jZoom.Value<int>("zoomIndexCurrentBox"),
                    position_in_current_box = jZoom.Value<int>("zoomPositionCurrentBox")
                };
            }

            var jLiveview = jResult[3];
            bool liveview_status = false;
            if (jLiveview.HasValues)
            {
                jLiveview.Value<bool>("liveviewStatus");
            }

            var jExposureMode = jResult[18];
            BasicInfo<string> exposure = null;
            if (jExposureMode.HasValues)
            {
                var modecandidates = new List<string>();
                foreach (var str in jExposureMode["exposureModeCandidates"].Values<string>())
                {
                    modecandidates.Add(str);
                }
                exposure = new BasicInfo<string>
                {
                    current = jExposureMode.Value<string>("currentExposureMode"),
                    candidates = modecandidates.ToArray()
                };
            }

            var jPostView = jResult[19];
            BasicInfo<string> postview = null;
            if (jPostView.HasValues)
            {
                var pvcandidates = new List<string>();
                foreach (var str in jPostView["postviewImageSizeCandidates"].Values<string>())
                {
                    pvcandidates.Add(str);
                }
                postview = new BasicInfo<string>
                {
                    current = jPostView.Value<string>("currentPostviewImageSize"),
                    candidates = pvcandidates.ToArray()
                };
            }

            var jSelfTimer = jResult[20];
            BasicInfo<int> selftimer = null;
            if (jSelfTimer.HasValues)
            {
                var stcandidates = new List<int>();
                foreach (var str in jSelfTimer["selfTimerCandidates"].Values<int>())
                {
                    stcandidates.Add(str);
                }
                selftimer = new BasicInfo<int>
                {
                    current = jSelfTimer.Value<int>("currentSelfTimer"),
                    candidates = stcandidates.ToArray()
                };
            }

            var jShootMode = jResult[21];
            BasicInfo<string> shootmode = null;
            if (jShootMode.HasValues)
            {
                var smcandidates = new List<string>();
                foreach (var str in jShootMode["shootModeCandidates"].Values<string>())
                {
                    smcandidates.Add(str);
                }
                shootmode = new BasicInfo<string>
                {
                    current = jShootMode.Value<string>("currentShootMode"),
                    candidates = smcandidates.ToArray()
                };
            }

            var jEV = jResult[25];
            EvInfo ev = null;
            if (jEV.HasValues)
            {
                ev = new EvInfo
                {
                    MaxIndex = jEV.Value<int>("maxExposureCompensation"),
                    MinIndex = jEV.Value<int>("minExposureCompensation"),
                    CurrentIndex = jEV.Value<int>("currentExposureCompensation"),
                    StepDefinition = jEV.Value<int>("stepIndexOfExposureCompensation")
                };
            }

            var jFN = jResult[27];
            BasicInfo<string> fn = null;
            if (jFN.HasValues)
            {
                var fncandidates = new List<string>();
                foreach (var str in jFN["fNumberCandidates"].Values<string>())
                {
                    fncandidates.Add(str);
                }
                fn = new BasicInfo<string>
                {
                    current = jFN.Value<string>("currentFNumber"),
                    candidates = fncandidates.ToArray()
                };
            }

            var jIso = jResult[29];
            BasicInfo<string> iso = null;
            if (jIso.HasValues)
            {
                var isocandidates = new List<string>();
                foreach (var str in jIso["isoSpeedRateCandidates"].Values<string>())
                {
                    isocandidates.Add(str);
                }
                iso = new BasicInfo<string>
                {
                    current = jIso.Value<string>("currentIsoSpeedRate"),
                    candidates = isocandidates.ToArray()
                };
            }

            var jPS = jResult[31];
            bool? ps = null;
            if (jPS.HasValues)
            {
                ps = jPS.Value<bool>("isShifted");
            }

            var jSS = jResult[32];
            BasicInfo<string> ss = null;
            if (jSS.HasValues)
            {
                var sscandidates = new List<string>();
                foreach (var str in jSS["shutterSpeedCandidates"].Values<string>())
                {
                    sscandidates.Add(str);
                }
                ss = new BasicInfo<string>
                {
                    current = jSS.Value<string>("currentShutterSpeed"),
                    candidates = sscandidates.ToArray()
                };
            }

            result.Invoke(new Event()
            {
                AvailableApis = apis,
                CameraStatus = status,
                ZoomInfo = zoom,
                LiveviewAvailable = liveview_status,
                PostviewSizeInfo = postview,
                SelfTimerInfo = selftimer,
                ShootModeInfo = shootmode,
                FNumber = fn,
                ISOSpeedRate = iso,
                ShutterSpeed = ss,
                EvInfo = ev,
                ExposureMode = exposure,
                ProgramShiftActivated = ps
            });
        }