Beispiel #1
0
        private static async Task RemoveSearchUserCollaboration(BoxClient auClient, BoxItem item, TimeLimiter throttle)
        {
            // フォルダのコラボレーションを一覧
            await throttle;
            var   collabs = await auClient.FoldersManager
                            .GetCollaborationsAsync(item.Id);

            var collab = collabs.Entries.SingleOrDefault(c => c.AccessibleBy.Id == Config.SearchUserId);

            if (collab != null)
            {
                // 検索用ユーザーのコラボレーションを外す
                await throttle;
                await auClient.CollaborationsManager.RemoveCollaborationAsync(id : collab.Id);
            }
        }
Beispiel #2
0
        private void DrawLines()
        {
            foreach (KeyValuePair <long, List <LineItem> > kvp in Communication.LineDict)
            {
                foreach (LineItem line in kvp.Value)
                {
                    if (Communication.FadeList.Any(x => x.Start == line.Start))
                    {
                        continue;
                    }

                    if (line.Pulse)
                    {
                        PulseLines(line);
                        continue;
                    }

                    line.LinePackets?.DrawPackets();

                    MySimpleObjectDraw.DrawLine(line.Start, line.End, MyStringId.GetOrCompute("ShipyardLaser"), ref line.Color, 0.4f);
                }
            }

            foreach (KeyValuePair <long, BoxItem> entry in BoxDict)
            {
                BoxItem box   = entry.Value;
                Vector4 color = new Color(box.PackedColor).ToVector4();
                foreach (LineItem line in box.Lines)
                {
                    MySimpleObjectDraw.DrawLine(line.Start, line.End, MyStringId.GetOrCompute("ShipyardGizmo"), ref color, 1f);
                }
            }

            foreach (ShipyardItem item in ProcessLocalYards.LocalYards)
            {
                Vector4 color = Color.White;
                if (item.YardType == ShipyardType.Disabled || item.YardType == ShipyardType.Invalid)
                {
                    continue;
                }

                foreach (LineItem line in item.BoxLines)
                {
                    MySimpleObjectDraw.DrawLine(line.Start, line.End, MyStringId.GetOrCompute("WeaponLaserIgnoreDepth"), ref color, 1f);
                }
            }
        }
Beispiel #3
0
        private void selectedFieldTextBox_TextChanged(object sender, EventArgs e)
        {
            BoxItem <LogType> selectedBoxItem = ((BoxItem <LogType>)logTypeComboBox.SelectedItem);

            if (selectedBoxItem != null)
            {
                ((BoxItem <string>)fieldsComboBox.SelectedItem).value = selectedFieldTextBox.Text;

                string key = ((BoxItem <string>)fieldsComboBox.SelectedItem).ToString();
                selectedBoxItem.value.additionalFields[key] =
                    selectedFieldTextBox.Text;
            }
            else
            {
                MessageBox.Show(this, "You must choose log type first.");
            }
        }
Beispiel #4
0
        public IHttpActionResult PostBoxItem(BoxItemsModel boxItem)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var dbBoxItem = new BoxItem();

            dbBoxItem.Update(boxItem);

            _boxItemRepository.Add(dbBoxItem);
            _unitOfWork.Commit();

            boxItem.BoxItemId = dbBoxItem.BoxItemId;

            return(CreatedAtRoute("DefaultApi", new { id = boxItem.BoxItemId }, boxItem));
        }
Beispiel #5
0
        public static async Task <BoxItem> GetFileByPath(this BoxClient api, string path)
        {
            var     parts = path.Split('/');
            BoxItem item  = null;

            foreach (var part in parts)
            {
                var items = await api.FoldersManager.GetFolderItemsAsync(item == null? "0" : item.Id, Limit);

                item = items.Entries.FirstOrDefault(_ => _.Name == part);

                if (item == null)
                {
                    return(null);
                }
            }

            return(item);
        }
Beispiel #6
0
        public static bool ToBoxItem(BoxItemDTO input, BoxItem output)
        {
            if (output == null || input == null)
            {
                return(false);
            }

            output.BoxItemId            = input.BoxItemId;
            output.OriginalItemVNum     = input.OriginalItemVNum;
            output.OriginalItemDesign   = input.OriginalItemDesign;
            output.ItemGeneratedAmount  = input.ItemGeneratedAmount;
            output.ItemGeneratedVNum    = input.ItemGeneratedVNum;
            output.ItemGeneratedDesign  = input.ItemGeneratedDesign;
            output.ItemGeneratedRare    = input.ItemGeneratedRare;
            output.ItemGeneratedUpgrade = input.ItemGeneratedUpgrade;
            output.Probability          = input.Probability;

            return(true);
        }
Beispiel #7
0
        private void QuickItem_Load(object sender, EventArgs e)
        {
            m_Preview.BackColor = Pandora.Profile.General.ArtBackground.Color;

            if (m_Item == null)
            {
                m_Item           = new BoxItem();
                m_Item.EmptyCtor = true;

                pGrid.SelectedObject = m_Item;

                m_Backup = new BoxItem();
            }
            else
            {
                m_Preview.ArtIndex = m_Item.Item.Art;
                m_Preview.Hue      = m_Item.Item.Hue;
            }
        }
Beispiel #8
0
    private void OnEnable()
    {
        items = Resources.LoadAll <ItemBase>("");

        lineHeight      = EditorGUIUtility.singleLineHeight;
        lineHeightSpace = lineHeight + 5;

        item          = target as ItemBase;
        _ID           = serializedObject.FindProperty("_ID");
        _Name         = serializedObject.FindProperty("_Name");
        itemType      = serializedObject.FindProperty("itemType");
        quality       = serializedObject.FindProperty("quality");
        weight        = serializedObject.FindProperty("weight");
        sellAble      = serializedObject.FindProperty("sellAble");
        sellPrice     = serializedObject.FindProperty("sellPrice");
        buyPrice      = serializedObject.FindProperty("buyPrice");
        icon          = serializedObject.FindProperty("icon");
        description   = serializedObject.FindProperty("description");
        stackAble     = serializedObject.FindProperty("stackAble");
        discardAble   = serializedObject.FindProperty("discardAble");
        lockAble      = serializedObject.FindProperty("lockAble");
        usable        = serializedObject.FindProperty("usable");
        inexhaustible = serializedObject.FindProperty("inexhaustible");
        maxDurability = serializedObject.FindProperty("maxDurability");
        materials     = serializedObject.FindProperty("materials");
        makingMethod  = serializedObject.FindProperty("makingMethod");
        minYield      = serializedObject.FindProperty("minYield");
        maxYield      = serializedObject.FindProperty("maxYield");
        HandlingMaterialItemList();

        box = target as BoxItem;
        if (box)
        {
            boxItems = serializedObject.FindProperty("itemsInBox");
            HandlingBoxItemList();
        }

        materialType = serializedObject.FindProperty("materialType");

        FixType();
    }
        private void updateUsedLogTypesCheckListBox()
        {
            usedLogTypesCheckListBox.Items.Clear();

            try {
                LogType[] logTypes = Program.logServiceClient.getLogTypes();

                foreach (LogType logType in logTypes)
                {
                    BoxItem <LogType> checkListBoxItem = new BoxItem <LogType> {
                        text  = logType.name,
                        value = logType
                    };

                    usedLogTypesCheckListBox.Items.Add(checkListBoxItem);
                }
            }
            catch {
                MessageBox.Show("Log type collecting failure.");
            }
        }
Beispiel #10
0
        private void CreateParamTypeList()
        {
            m_listParamType.Items.Clear();
            var _funcInfo = FileManager.ContentMgr.GetFuncInfo(m_curScreenplayID, m_curFuncIndex);

            if (_funcInfo == null)
            {
                return;
            }
            var func    = _funcInfo.ActInfo as FuncInfo;
            var funcCfg = FileManager.FuncCfgMgr.GetFuncCfg(func.Name);

            foreach (var type in funcCfg.GetParamList())
            {
                var     param = funcCfg.GetParamInfo(type);
                BoxItem item  = new BoxItem();
                item.Text  = type + param.DescribeSimple;
                item.Value = type;
                m_listParamType.Items.Add(item);
            }
        }
Beispiel #11
0
        private void randomizeAllFieldsButton_Click(object sender, EventArgs e)
        {
            BoxItem <LogType> selectedBoxItem = ((BoxItem <LogType>)logTypeComboBox.SelectedItem);

            if (selectedBoxItem != null)
            {
                LogType logType = selectedBoxItem.value;

                LogRecord randomLogRecord = RandomLogRecordGenerator.logRecord(logType);

                try {
                    Program.logServiceClient.insertLogRecord(randomLogRecord);
                }
                catch {
                    MessageBox.Show("Log type " + logType.name + " random record insertion failure.");
                }
            }
            else
            {
                MessageBox.Show(this, "You must choose log type first.");
            }
        }
Beispiel #12
0
        private void selectButton_Click(object sender, EventArgs e)
        {
            BoxItem <LogType> selectedBoxItem = ((BoxItem <LogType>)logTypeComboBox.SelectedItem);

            if (selectedBoxItem != null)
            {
                Query query = new Query {
                    logType  = selectedBoxItem.value,
                    clientId = clientIdTextBox.Text,
                    from     = fromDateTimePicker.Value,
                    to       = toDateTimePicker.Value
                };
                TableDialog tableDialog = new TableDialog {
                    query = query
                };
                tableDialog.Show(this);
            }
            else
            {
                MessageBox.Show(this, "You must choose log type first.");
            }
        }
Beispiel #13
0
        private void updateLogTypeComboBox()
        {
            logTypeComboBox.Items.Clear();

            try {
                LogType[] logTypes = Program.logServiceClient.getLogTypes();

                foreach (LogType logType in logTypes)
                {
                    BoxItem <LogType> comboBoxItem = new BoxItem <LogType> {
                        text  = logType.name,
                        value = logType
                    };

                    logTypeComboBox.Items.Add(comboBoxItem);
                }
            }
            catch {
                MessageBox.Show("Log type collecting failure.");
            }

            logTypeComboBox.Text = "<Select Log Type>";
        }
Beispiel #14
0
        public IHttpActionResult PutBoxItem(int id, BoxItemsModel boxItem)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            BoxItem dbBoxItem = _boxItemRepository.GetFirstOrDefault(b => b.Box.PawzeUser.UserName == User.Identity.Name && b.BoxItemId == id);

            if (id != boxItem.BoxItemId)
            {
                return(BadRequest());
            }

            dbBoxItem.Update(boxItem);

            _boxItemRepository.Update(dbBoxItem);

            try
            {
                _unitOfWork.Commit();
            }
            catch (Exception)
            {
                if (!BoxItemExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
 public bool Equals(BoxItem obj)
 {
     return(obj != null && this.code == obj.code);
 }
Beispiel #16
0
 static ASDocumentation()
 {
     boxSimpleClose  = new BoxItem(TextHelper.GetString("Label.CompleteDocEmpty"));
     boxMethodParams = new BoxItem(TextHelper.GetString("Label.CompleteDocDetails"));
 }
		static ASDocumentation()
		{
			boxSimpleClose = new BoxItem("Empty");
			boxMethodParams = new BoxItem("Method details");
		}
Beispiel #18
0
 internal BoxItem(T value, BoxItem <T> next = null)
 {
     _value = value;
     Next   = next;
 }
Beispiel #19
0
        public Bitmap RealtimeBackInfoStat_TeacherGraphPrint(string getDept, PanelControl pControl)
        {
            using (RealtimeInfo_TeacherDataAccess realTimeInfo_TeacherDataAccess = new RealtimeInfo_TeacherDataAccess())
            {
                try
                {
                    DataSet dsDutyID = realTimeInfo_TeacherDataAccess.GetDutyID(DateTime.Now.ToString("HH:mm:ss"));
                    int     teaAttOnTimeNumbersInDuty      = 0;
                    int     teaAttNotOnTimeNumbersInDuty   = 0;
                    int     teaLeaveOnTimeNumbersInDuty    = 0;
                    int     teaLeaveNotOnTimeNumbersInDuty = 0;
                    int     teaShouldLeaveInDuty           = 0;

                    if (dsDutyID.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow dutyRow in dsDutyID.Tables[0].Rows)
                        {
                            //teaAttNumbersInDuty += realTimeInfo_TeacherDataAccess.GetTeaNumbers(DateTime.Now.DayOfWeek.ToString(),dutyRow[0].ToString(),getDept);
                            realTimeInfo_TeacherDataAccess.GetTeaWorkingNumbers(dutyRow[0].ToString(), ref teaAttOnTimeNumbersInDuty, ref teaAttNotOnTimeNumbersInDuty, getDept, DateTime.Now.Date);
                            realTimeInfo_TeacherDataAccess.GetTeaLeaveNumbers(dutyRow[0].ToString(), ref teaLeaveOnTimeNumbersInDuty, ref teaLeaveNotOnTimeNumbersInDuty, getDept, DateTime.Now.Date);
                        }
                    }

                    int noDutyTotal  = 0;
                    int noDutyAttend = 0;
                    int noDutyLeave  = 0;

                    realTimeInfo_TeacherDataAccess.GetTeacherRealTimeInfoWithNoDuty(getDept, DateTime.Now.DayOfWeek.ToString(), ref noDutyTotal, ref noDutyAttend, ref noDutyLeave);

                    teaLeaveOnTimeNumbersInDuty += noDutyLeave;
                    teaShouldLeaveInDuty         = teaAttOnTimeNumbersInDuty + teaAttNotOnTimeNumbersInDuty + noDutyAttend;


                    double onTimePer    = (double)teaLeaveOnTimeNumbersInDuty / (double)teaShouldLeaveInDuty;
                    double notOnTimePer = (double)teaLeaveNotOnTimeNumbersInDuty / (double)teaShouldLeaveInDuty;
                    double remainPer    = 1 - (((double)teaLeaveOnTimeNumbersInDuty + (double)teaLeaveNotOnTimeNumbersInDuty) / (double)teaShouldLeaveInDuty);

                    zedGraph_RealtimeMorningInfoStatTeacher = new ZedGraphControl();
                    pControl.Controls.Clear();
                    pControl.Controls.Add(zedGraph_RealtimeMorningInfoStatTeacher);
                    zedGraph_RealtimeMorningInfoStatTeacher.Dock = DockStyle.Fill;

                    GraphPane myPane = zedGraph_RealtimeMorningInfoStatTeacher.GraphPane;

                    if (getDept.Equals(""))
                    {
                        myPane.Title = new GardenInfoDataAccess().GetGardenInfo().Tables[0].Rows[0][1].ToString()
                                       + "全体教职工下班情况实时统计图\n" + "统计日期: " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    }
                    else
                    {
                        myPane.Title = new GardenInfoDataAccess().GetGardenInfo().Tables[0].Rows[0][1].ToString()
                                       + getDept + "部教师下班情况实时统计图\n" + "统计日期: " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    }

                    double[] statusVal   = { onTimePer, notOnTimePer, remainPer };
                    string[] statusLabel = { "离开", "早退", "剩余" };

                    myPane.PaneFill             = new Fill(Color.Cornsilk);
                    myPane.AxisFill             = new Fill(Color.Cornsilk);
                    myPane.Legend.Position      = LegendPos.Right;
                    myPane.Legend.FontSpec.Size = 12;

                    PieItem [] slices = new PieItem[statusVal.Length];
                    slices = myPane.AddPieSlices(statusVal, statusLabel);

                    ((PieItem)slices[0]).LabelType = PieLabelType.Percent;
                    ((PieItem)slices[0]).LabelDetail.FontSpec.Size = 14;
                    ((PieItem)slices[1]).LabelType = PieLabelType.Percent;
                    ((PieItem)slices[1]).LabelDetail.FontSpec.Size = 14;
                    ((PieItem)slices[2]).LabelType = PieLabelType.Percent;
                    ((PieItem)slices[2]).LabelDetail.FontSpec.Size = 14;
                    ((PieItem)slices[1]).Displacement = .1;

                    BoxItem box = new BoxItem(new RectangleF(0F, 0F, 1F, 1F),
                                              Color.Empty, Color.PeachPuff);
                    box.Location.CoordinateFrame = CoordType.AxisFraction;
                    box.Border.IsVisible         = false;
                    box.Location.AlignH          = AlignH.Left;
                    box.Location.AlignV          = AlignV.Top;
                    box.ZOrder = ZOrder.E_BehindAxis;

                    myPane.GraphItemList.Add(box);

                    zedGraph_RealtimeMorningInfoStatTeacher.IsShowContextMenu = false;
                    zedGraph_RealtimeMorningInfoStatTeacher.IsEnableZoom      = false;
                    zedGraph_RealtimeMorningInfoStatTeacher.AxisChange();

                    return(myPane.Image);
                }
                catch (Exception e)
                {
                    Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
                    return(null);
                }
            }
        }
 static ASDocumentation()
 {
     boxSimpleClose  = new BoxItem("Empty");
     boxMethodParams = new BoxItem("Method details");
 }
Beispiel #21
0
    void UseBox(ItemInfo MItemInfo)
    {
        BoxItem box = MItemInfo.item as BoxItem;

        LoseItem(MItemInfo, 1, box.ItemsInBox.ToArray());
    }
Beispiel #22
0
 public void removeItem(BoxItem item)
 {
     items.Remove(item);
 }
Beispiel #23
0
 public void addItem(BoxItem item)
 {
     items.Add(item);
 }
Beispiel #24
0
 static ASDocumentation()
 {
     boxSimpleClose = new BoxItem(TextHelper.GetString("Label.CompleteDocEmpty"));
     boxMethodParams = new BoxItem(TextHelper.GetString("Label.CompleteDocDetails"));
 }
Beispiel #25
0
        public async void ImportFiles(string basePath)
        {
            try
            {
                // Get Box Auth Token
                if (!string.IsNullOrEmpty(Settings.PrivateKey))
                {
                    Settings.PrivateKey = Settings.PrivateKey.Replace("\\n", "\n");
                }

                var boxConfig = new BoxConfig(
                    Settings.ClientID,
                    Settings.ClientSecret,
                    Settings.EnterpriceId,
                    Settings.PrivateKey,
                    Settings.JwtPrivateKeyPassword,
                    Settings.JwtPublicKeyId);

                var boxJWTAuth = new BoxJWTAuth(boxConfig);
                var adminToken = boxJWTAuth.AdminToken();
                var client     = boxJWTAuth.AdminClient(adminToken);
                boxManager = new BoxManager(adminToken);

                var enrolledServices = repositoryEnrolledService.GetServicesByImportMode(ServiceReportImportModes.BoxAPI);

                if (enrolledServices.Model == null || enrolledServices.Model.List.Count() == 0)
                {
                    return;
                }

                foreach (var listItem in enrolledServices.Model.List)
                {
                    string importPath = Path.Combine(basePath, listItem.BusinessId.ToString(), "Sales", listItem.ServiceName);

                    BoxItem sharedItemInServiceFolder = await client.SharedItemsManager.SharedItemsAsync(listItem.BoxUrl);

                    var sharedServiceEnties = await client.FoldersManager.GetFolderItemsAsync(sharedItemInServiceFolder.Id, 100, 0,
                                                                                              new List <string>
                    {
                        BoxFolder.FieldName,
                        BoxFolder.FieldPathCollection,
                        BoxFolder.FieldModifiedAt,
                        BoxFolder.FieldItemCollection
                    }
                                                                                              );

                    foreach (var sharedEntry in sharedServiceEnties.Entries)
                    {
                        if (sharedEntry.Type.ToLower() == "file")
                        {
                            bool isFileExists = new RepositorySales().IsSalesFileExists(sharedEntry.Name, listItem.BusinessId, listItem.Id) || File.Exists(Path.Combine(importPath, sharedEntry.Name));
                            if (isFileExists)
                            {
                                continue;
                            }

                            if (!Directory.Exists(importPath))
                            {
                                Directory.CreateDirectory(importPath);
                            }

                            using (FileStream fileStream = new FileStream(Path.Combine(importPath, sharedEntry.Name), FileMode.CreateNew, System.IO.FileAccess.Write))
                            {
                                using (Stream stream = await client.FilesManager.DownloadStreamAsync(sharedEntry.Id))
                                {
                                    int bytesRead;
                                    var buffer = new byte[8192];
                                    do
                                    {
                                        bytesRead = await stream.ReadAsync(buffer, 0, buffer.Length);

                                        await fileStream.WriteAsync(buffer, 0, bytesRead);
                                    } while (bytesRead > 0);
                                }
                            }

                            // Move download file to archive folder

                            var subfolder  = new BoxApi.V2.Model.Folder();
                            var folderInfo = await client.FoldersManager.GetInformationAsync(sharedItemInServiceFolder.Id);

                            if (folderInfo.ItemCollection.Entries.OfType <BoxFolder>().Count() > 0)
                            {
                                var foundFolder = folderInfo.ItemCollection.Entries.OfType <BoxFolder>().Any((f) => f.Name == "Archive");
                                // var foundFolder = entryItems.Parent.ItemCollection.Entries.OfType<BoxFolder>().First((a) => a.Name == "my subfolder");
                                if (foundFolder == false)
                                {
                                    subfolder = boxManager.CreateFolder(sharedItemInServiceFolder.Id, "Archive");
                                    boxManager.MoveFile(sharedEntry.Id, subfolder.Id);
                                }
                                // Move the file to the subfolder
                                var foundFolderDetails = folderInfo.ItemCollection.Entries.OfType <BoxFolder>().First((f) => f.Name == "Archive");
                                boxManager.MoveFile(sharedEntry.Id, foundFolderDetails.Id);
                                // getfolderDetails(folderItems.Id, path);
                            }
                            else
                            {
                                subfolder = boxManager.CreateFolder(sharedItemInServiceFolder.Id, "Archive");
                                boxManager.MoveFile(sharedEntry.Id, subfolder.Id);
                            }
                        }
                        //else case entry type is 'folder'
                    }
                }
            }
            catch (Exception ex)
            {
                ex.Log();
                throw ex;
            }
        }
 protected static string GetParentFolderId(BoxItem boxItem)
 {
     return(boxItem == null || boxItem.Parent == null
                ? null
                : boxItem.Parent.Id);
 }
Beispiel #27
0
 /// <summary>
 /// 构造预置体UI
 /// </summary>
 /// <param name="boxItem"></param>
 public PrefabItemUI(BoxItem boxItem)
     : this()
 {
     this.boxItem = boxItem;
     InitImage();
 }
Beispiel #28
0
        private void NdertoZedGrafik()
        {
            try
            {
                this.ZedBilanci.Refresh();
                GraphPane BilancPane = new GraphPane();
                BilancPane.Title       = "Bilanci, te ardhurat, shpenzimet dhe blerjet per vitin e zgjedhur";
                BilancPane.XAxis.Title = "Muajt";
                BilancPane.XAxis.TitleFontSpec.FontColor = Color.Chocolate;
                BilancPane.XAxis.TitleFontSpec.Family    = "Microsoft Sans Serif";
                BilancPane.XAxis.TitleFontSpec.Size      = 12;
                BilancPane.YAxis.Title = "Vlera";
                BilancPane.YAxis.TitleFontSpec.FontColor = Color.Chocolate;
                BilancPane.YAxis.TitleFontSpec.Family    = "Microsoft Sans Serif";
                BilancPane.YAxis.TitleFontSpec.Size      = 12;
                double[] bilanci         = new double[12];
                double[] xhiro           = new double[12];
                double[] shpenzime       = new double[12];
                double[] shpenzimeMujore = new double[12];
                double[] blerje          = new double[12];
                double[] maximum         = new double[12];
                double[] minimum         = new double[12];
                for (int i = 0; i < 12; i++)
                {
                    bilanci[i] = Convert.ToDouble(this.dsBilanci.Tables[0].Rows[i]["BILANCI"]);
                    maximum[i] = bilanci[i];
                    minimum[i] = bilanci[i];

                    xhiro[i] = Convert.ToDouble(this.dsBilanci.Tables[0].Rows[i]["XHIRO"]);
                    if (maximum[i] < xhiro[i])
                    {
                        maximum[i] = xhiro[i];
                    }
                    if (minimum[i] > xhiro[i])
                    {
                        minimum[i] = xhiro[i];
                    }

                    shpenzime[i] = Convert.ToDouble(this.dsBilanci.Tables[0].Rows[i]["SHPENZIMI_DITOR"]);
                    if (maximum[i] < shpenzime[i])
                    {
                        maximum[i] = shpenzime[i];
                    }
                    if (minimum[i] > shpenzime[i])
                    {
                        minimum[i] = shpenzime[i];
                    }

                    shpenzimeMujore[i] = Convert.ToDouble(this.dsBilanci.Tables[0].Rows[i]["SHPENZIMI_MUJOR"]);
                    if (maximum[i] < shpenzimeMujore[i])
                    {
                        maximum[i] = shpenzimeMujore[i];
                    }
                    if (minimum[i] > shpenzimeMujore[i])
                    {
                        minimum[i] = shpenzimeMujore[i];
                    }

                    blerje[i] = Convert.ToDouble(this.dsBilanci.Tables[0].Rows[i]["BLERJE"]);
                    if (maximum[i] < blerje[i])
                    {
                        maximum[i] = blerje[i];
                    }
                    if (minimum[i] > blerje[i])
                    {
                        minimum[i] = blerje[i];
                    }
                }
                string[] str = { "Janar",   "Shkurt", "Mars",   "Prill", "Maj", "Qershor", "Korrik", "Gusht",
                                 "Shtator", "Tetor",  "Nentor", "Dhjetor" };

                BarItem TeArdhuraVije = BilancPane.AddBar("Te ardhurat", null, xhiro, Color.AliceBlue);
                TeArdhuraVije.Bar.Fill             = new Fill(Color.White, System.Drawing.SystemColors.Desktop, 45.0f);
                TeArdhuraVije.Bar.Border.IsVisible = true;

                BarItem ShpenzimeMujoreVije = BilancPane.AddBar("Shpenzimet mujore", null, shpenzimeMujore, Color.AliceBlue);
                ShpenzimeMujoreVije.Bar.Fill             = new Fill(Color.White, Color.Salmon, 45.0f);
                ShpenzimeMujoreVije.Bar.Border.IsVisible = true;

                BarItem ShpenzimeVije = BilancPane.AddBar("Shpenzimet", null, shpenzime, Color.AliceBlue);
                ShpenzimeVije.Bar.Fill             = new Fill(Color.White, Color.Yellow, 45.0f);
                ShpenzimeVije.Bar.Border.IsVisible = true;

                BarItem BlerjeMaterialiVije = BilancPane.AddBar("Blerje Materialesh", null, blerje, Color.AliceBlue);
                BlerjeMaterialiVije.Bar.Fill             = new Fill(Color.White, Color.Violet, 45.0f);
                BlerjeMaterialiVije.Bar.Border.IsVisible = true;

                BarItem BilanciVije = BilancPane.AddBar("Bilanci", null, bilanci, Color.AliceBlue);
                BilanciVije.Bar.Fill             = new Fill(Color.White, Color.DarkSeaGreen, 45.0f);
                BilanciVije.Bar.Border.IsVisible = true;

                // Draw the X tics between the labels instead of at the labels
                BilancPane.XAxis.IsTicsBetweenLabels = false;

                // Set the XAxis labels
                BilancPane.XAxis.TextLabels = str;
                BilancPane.XAxis.StepAuto   = false;

                // Set the XAxis to Text type
                BilancPane.XAxis.Type = AxisType.Text;

                // Fill the axis background with a color gradient
                BilancPane.AxisFill = new Fill(Color.White, Color.LightSteelBlue, 45.0f);
                BilancPane.PaneFill = new Fill(Color.White, Color.Bisque, 45.0f);
                // enable the legend
                BilancPane.Legend.IsVisible = true;
                BilancPane.PaneRect         = new RectangleF(0, 0, 800, 400);
                // percakohet fonti i titullit
                BilancPane.FontSpec = new FontSpec("Microsoft Sans Serif", 12, Color.Chocolate, true, false, false);
                for (int i = 0; i < 12; i++)
                {
                    //Convert.ToInt32(maximum[i]+ 10)
                    BoxItem box = new BoxItem(new RectangleF(0.5f + i, Convert.ToInt32(maximum[i]), 1, Convert.ToInt32(maximum[i])), Color.MidnightBlue, Color.White, Color.Empty);
                    box.Location.CoordinateFrame = CoordType.AxisXYScale;
                    box.Location.AlignH          = AlignH.Left;
                    box.Location.AlignV          = AlignV.Top;
                    box.ZOrder = ZOrder.E_BehindAxis;
                    BilancPane.GraphItemList.Add(box);
                    if (minimum[i] < 0)
                    {
                        BoxItem box2 = new BoxItem(new RectangleF(0.5f + i, 0, 1, Convert.ToInt32(minimum[i])), Color.MidnightBlue, Color.White, Color.Empty);
                        box2.Location.CoordinateFrame = CoordType.AxisXYScale;
                        box2.Location.AlignH          = AlignH.Left;
                        box2.Location.AlignV          = AlignV.Top;
                        box2.ZOrder = ZOrder.E_BehindAxis;
                        BilancPane.GraphItemList.Add(box2);
                    }
                }

                ZedBilanci.MasterPane.PaneList.Clear();
                ZedBilanci.GraphPane           = BilancPane;
                ZedBilanci.GraphPane.MarginAll = 10;
                ZedBilanci.Anchor = AnchorStyles.Left | AnchorStyles.Top
                                    | AnchorStyles.Right | AnchorStyles.Bottom;
                ZedBilanci.Width  = 800;
                ZedBilanci.Height = 400;
                //ZedBilanci.Parent = this.groupBox1;
                ZedBilanci.Location = new Point(20, 50);
                this.ZedBilanci.AxisChange();
                this.ZedBilanci.Refresh();
            }
            catch (Exception ex)
            {
                return;
            }
        }
Beispiel #29
0
 private void AddInternal(BoxItem value)
 {
     m_Table[value.Name] = value;
 }
Beispiel #30
0
 public static FileSystemInfoContract ToFileSystemInfoContract(this BoxItem item) => item.Type == Constants.TypeFolder
         ? new DirectoryInfoContract(item.Id, item.Name, item.CreatedAt ?? DateTimeOffset.FromFileTime(0), item.ModifiedAt ?? DateTimeOffset.FromFileTime(0)) as FileSystemInfoContract
         : new FileInfoContract(item.Id, item.Name, item.CreatedAt ?? DateTimeOffset.FromFileTime(0), item.ModifiedAt ?? DateTimeOffset.FromFileTime(0), item.Size.Value, ((BoxFile)item).Sha1.ToLowerInvariant()) as FileSystemInfoContract;
Beispiel #31
0
 public void Add(BoxItem boxItem, RectRegion child)
 {
     child.Parent = this;
     Children.Add(child);
     m_boxItems.Add(boxItem);
 }
        public Bitmap Pie_BackInfoStat(string getGrade, string getClass, DateTime getDate, PanelControl pControl)
        {
            using (RealtimeInfoDataAccess realTimeInfoDataAccess = new RealtimeInfoDataAccess())
            {
                try
                {
                    int getHasGone    = 0;
                    int getHasnotGone = 0;
                    int getStuNumbers = 0;

                    realTimeInfoDataAccess.GetRealtimeBackInfo_Graphic(getGrade, getClass, getDate, ref getHasGone, ref getHasnotGone, ref getStuNumbers);

                    double hasGonePer    = (double)getHasGone / (double)getStuNumbers;
                    double hasnotGonePer = (double)getHasnotGone / (double)getStuNumbers;

                    zedGraph_RealTimeInfoStatStudent = new ZedGraphControl();
                    pControl.Controls.Clear();
                    pControl.Controls.Add(zedGraph_RealTimeInfoStatStudent);
                    zedGraph_RealTimeInfoStatStudent.Dock = DockStyle.Fill;

                    GraphPane myPane = zedGraph_RealTimeInfoStatStudent.GraphPane;

                    if (getGrade.Equals(""))
                    {
                        myPane.Title = new GardenInfoDataAccess().GetGardenInfo().Tables[0].Rows[0][1].ToString()
                                       + "全年级晚接信息统计图\n" + "统计日期: " + getDate.ToString("yyyy-MM-dd");
                    }

                    else if (getClass.Equals(""))
                    {
                        myPane.Title = new GardenInfoDataAccess().GetGardenInfo().Tables[0].Rows[0][1].ToString()
                                       + new StuInfoDataAccess().GetGradeList("", getGrade).Tables[0].Rows[0][1].ToString()
                                       + "晚接信息统计图\n" + "统计日期: " + getDate.ToString("yyyy-MM-dd");
                    }
                    else
                    {
                        myPane.Title = new GardenInfoDataAccess().GetGardenInfo().Tables[0].Rows[0][1].ToString()
                                       + new RealtimeInfoDataAccess().setClassList("", getClass, getGrade).Tables[0].Rows[0][1].ToString()
                                       + "晚接信息统计图\n" + "统计日期: " + getDate.ToString("yyyy-MM-dd");
                    }

                    double[] statusVal   = { hasGonePer, hasnotGonePer };
                    string[] statusLabel = { "已接走", "未接走" };

                    myPane.PaneFill             = new Fill(Color.Cornsilk);
                    myPane.AxisFill             = new Fill(Color.Cornsilk);
                    myPane.Legend.Position      = LegendPos.Right;
                    myPane.Legend.FontSpec.Size = 12;

                    PieItem [] slices = new PieItem[statusVal.Length];
                    slices = myPane.AddPieSlices(statusVal, statusLabel);

                    ((PieItem)slices[0]).LabelType = PieLabelType.Percent;
                    ((PieItem)slices[0]).LabelDetail.FontSpec.Size = 14;
                    ((PieItem)slices[1]).LabelType = PieLabelType.Percent;
                    ((PieItem)slices[1]).LabelDetail.FontSpec.Size = 14;
                    ((PieItem)slices[1]).Displacement = .1;

                    BoxItem box = new BoxItem(new RectangleF(0F, 0F, 1F, 1F),
                                              Color.Empty, Color.PeachPuff);
                    box.Location.CoordinateFrame = CoordType.AxisFraction;
                    box.Border.IsVisible         = false;
                    box.Location.AlignH          = AlignH.Left;
                    box.Location.AlignV          = AlignV.Top;
                    box.ZOrder = ZOrder.E_BehindAxis;

                    myPane.GraphItemList.Add(box);

                    zedGraph_RealTimeInfoStatStudent.IsShowContextMenu = false;
                    zedGraph_RealTimeInfoStatStudent.IsEnableZoom      = false;
                    zedGraph_RealTimeInfoStatStudent.AxisChange();

                    return(myPane.Image);
                }
                catch (Exception e)
                {
                    Util.WriteLog(e.Message, Util.EXCEPTION_LOG_TITLE);
                    return(null);
                }
            }
        }