public ResolutionAnalyzer(Files.LocatorFile file,
     int interpolationRange, int analyzedSamples)
 {         
     _file = file;
     _interpolationRange = interpolationRange;
     _analyzedSamples = analyzedSamples;
 }
        public IRestApiType GetFiles()
        {
            try
            {
                RestApiHelper client = new RestApiHelper()
                {
                    EndPoint = _GETUri,
                    Method = RestApiHelper.HttpVerb.GET,
                    GrantedToken = this.GrantedToken,
                    Parameters = "?list=true"
                };
                var json = client.SendRequest();
                var obj = JsonHelper.ParseJson<DropboxRestApiType.File>(json);

                // Convert DropboxRest File.Contents type to RestApi.Files type (IRestApiType)
                Files files = new Files();
                foreach (var f in obj.Contents)
                {
                    files.files.Add(
                        new RestApi.File()
                        {
                            id = f.Revision,
                            filename = f.Path.Replace("/", ""),
                            path = f.Path,
                            size = f.Size
                        }
                    );
                } 
                return files;
            }
            catch (Exception ex)
            {
                throw new Exception("Fail to get all documents, error: " + ExceptionHelper.ExtractAll(ex));
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                FilesBLL bll = new FilesBLL();
                Files f = new Files();
                int id;
                string filePath;
                string fileName;
                id = Convert.ToInt32(Request.QueryString["id"]);
                f.FUrl = bll.GetFileById(id).FUrl;
                f.FRName = bll.GetFileById(id).FRName;
                filePath = Server.MapPath(f.FUrl);//路径
                fileName = f.FRName;//客户端保存的文件名
                FileStream fs = new FileStream(filePath, FileMode.Open);
                byte[] bytes = new byte[(int)fs.Length];
                //以字符流的形式下载文件
                fs.Read(bytes, 0, bytes.Length);
                fs.Close();
                Response.ContentType = "application/octet-stream";
                //通知浏览器下载文件而不是打开
                Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
                Response.BinaryWrite(bytes);
                Response.Flush();
                Response.End();

            }
            catch (IOException)
            {

                throw;
            }
        }
 public override Behaviors.CrossAppCommunication.PointSharer.MulticastPointSharer Create(Files.LocatorFile file,
     Behaviors.CrossAppCommunication.ICrossAppExchange server, int guid)
 {
     var header = (Headers.Concrete.Rl8.Rl8Header)file.Header;
     return new Behaviors.CrossAppCommunication.PointSharer.MulticastPointSharer(server, guid,
         header.HeaderStruct.rlParams.sx, header.HeaderStruct.rlParams.sy);
 }
Exemple #5
0
 public Aligning(Files.LocatorFile file, PointSelector.CompressedPointSelectorWrapper selector,
     Behaviors.ImageAligning.IInterpolationProvider rcsProvider,
     Behaviors.ImageAligning.Surfaces.SurfaceType surfaceType, int baseRadius, int layers, double lambda)
 {
     _file = file;
     _selector = selector;
     _surface = Factories.Surface.SurfaceFactory.CreateSurface(_selector, rcsProvider, surfaceType, baseRadius, layers, lambda);
 }
        private static bool CheckBaExt(Files.LocatorFile file)
        {
            var rliInfo = file.Header.HeaderInfo.Where(x => x.HeaderName == "РГГ")
                .FirstOrDefault();

            string rhgName = rliInfo.Params.Where(x => x.Item1 == "Имя файла").FirstOrDefault().Item2;

            return Path.GetExtension(rhgName) == ".ba";
        }
        /// <summary>
        /// Checks if RLI has .ba RHG as its source
        /// </summary>
        /// <param name="rliFile">Rli to check</param>
        /// <returns></returns>
        public static bool HasBaRhgSource(Files.LocatorFile rliFile)
        {
            if (rliFile == null)
            {
                return false;
            }

            return CheckBaExt(rliFile);
        }
Exemple #8
0
        public StatisticsForm(Files.LocatorFile file, Behaviors.AreaSelector.AreaSelector areaSelector)
        {
            InitializeComponent();
         
            var dgv = FormsHelper.GetDataGrid(this, "Параметр", "Значение");
            this.Controls.Add(dgv);

            var statsInfo = GetStatistics(file, areaSelector);
            ShowInfo(statsInfo, dgv);
        }
        public static bool Open(Files file)
        {
            if (File.Exists(file.ToString() + ".pdf"))
            {
                Process.Start(file.ToString() + ".pdf");
                return true;
            }

            return false;
        }
        void CopyScript(string rootPath, Files.File scriptFile)
        {
            var target = rootPath + scriptFile;
            var script = scriptFile.ReadAllText();
				//File.ReadAllText(scriptFile);

            var dir = Path.GetDirectoryName(target);
            if (!Directory.Exists(dir))
                Directory.CreateDirectory(dir);

            File.WriteAllText(target, script, Encoding.ASCII);
        }
Exemple #11
0
 public static void AddLogMessage(DataType dataType, Files.FileOperationResult fileResult, bool isSave)
 {
     //自動バックアップを開始します
     //[読込]config : 成功 (2015/6/1 13:12:05)
     //[保存]config : 成功 (2015/6/1 13:12:07)
     //[保存]Material : 失敗 ErrorReason (2015/6/1 13:12:75)
     string mode = isSave ? "保存" : "読込";
     string issuccess = fileResult.IsSuccess ? "成功" : "失敗";
     string str = string.Format("[{0}]{1} : {2} {3} ({4})",
         mode, dataType.ToString(), issuccess,
         fileResult.ErrorReason, DateTime.Now.ToString());
     LogMessage.Add(str);
 }
Exemple #12
0
        public override byte[] ResampleImage(Files.LocatorFile file, System.Drawing.Rectangle area)
        {
            float[] image = new float[area.Width * area.Height];

            float[] imageArea = file.GetArea(area).ToArea<float>(file.Header.BytesPerSample);

            int toInclusiveX = area.Location.X + area.Width;
            toInclusiveX = toInclusiveX > file.Width ? file.Width : toInclusiveX;

            int toInclusiveY = area.Location.Y + area.Height;
            toInclusiveY = toInclusiveY > file.Height ? file.Height : toInclusiveY;
            int counter = 0;

            var rcsSolution = GetRcsSolution(area);
            var amplitudeSolution = GetAmplitudeSolution(area);

            Parallel.For(area.Location.X, toInclusiveX, (i, loopState) =>
            {
                for (int j = area.Location.Y; j < toInclusiveY; j++)
                {

                    var oldAmplVal = imageArea[(j - area.Y) * area.Width + (i - area.X)];
                    var newAmplVal = (float)amplitudeSolution[i - area.X, j - area.Y];
                    var newRcsVal = (float)rcsSolution[i - area.X, j - area.Y];
                    var diff = oldAmplVal / newAmplVal * newRcsVal;

                    diff = diff < 0 ? 0 : diff;
                    image[(j - area.Location.Y) * area.Width + (i - area.Location.X)] = diff;
                }

                System.Threading.Interlocked.Increment(ref counter);
                OnProgressReport((int)(counter / Math.Ceiling((double)(toInclusiveX - area.Location.X)) * 100));

                if (OnCancelWorker())
                {
                    loopState.Break();
                }

            });

            if (Cancelled)
            {
                return null;
            }

            byte[] imageB = new byte[image.Length * 4];

            Buffer.BlockCopy(image, 0, imageB, 0, imageB.Length);

            return imageB;
        }
 public static Behaviors.ImageMirroring.Abstract.ImageMirrorer Create(Files.LocatorFile sourceFile)
 {
     switch (sourceFile.Properties.Type)
     {
         case FileType.brl4:
             return new Behaviors.ImageMirroring.Concrete.Brl4ImageMirrorer(sourceFile);
         case FileType.rl4:
             return new Behaviors.ImageMirroring.Concrete.Rl4ImageMirrorer(sourceFile);
         case FileType.rl8:
             return new Behaviors.ImageMirroring.Concrete.Rl8ImageMirrorer(sourceFile);
         default:
             throw new NotImplementedException("Image mirrorer");
     }
 }
Exemple #14
0
        private IEnumerable<Tuple<string, string>> GetStatistics(Files.LocatorFile file, Behaviors.AreaSelector.AreaSelector areaSelector)
        {
            var maxSample = file.GetMaxSample(
                            new Rectangle(areaSelector.Area.Location.X, areaSelector.Area.Location.Y,
                            areaSelector.Area.Width, areaSelector.Area.Height));

            var minSample = file.GetMinSample(
                    new Rectangle(areaSelector.Area.Location.X, areaSelector.Area.Location.Y,
                    areaSelector.Area.Width, areaSelector.Area.Height));

            var maxSampleLoc = file.GetMaxSampleLocation(
                new Rectangle(areaSelector.Area.Location.X, areaSelector.Area.Location.Y,
                    areaSelector.Area.Width, areaSelector.Area.Height));

            var minSampleLoc = file.GetMinSampleLocation(
                new Rectangle(areaSelector.Area.Location.X, areaSelector.Area.Location.Y,
                    areaSelector.Area.Width, areaSelector.Area.Height));

            var avgSample = file.GetAvgSample(
                new Rectangle(areaSelector.Area.Location.X, areaSelector.Area.Location.Y,
                    areaSelector.Area.Width, areaSelector.Area.Height));


            List<Tuple<string, string>> statistics = new List<Tuple<string, string>>()
                {
                    new Tuple<string, string>("Имя файла", System.IO.Path.GetFileName(file.Properties.FilePath)),
                    new Tuple<string, string>("X1", areaSelector.Area.Location.X.ToString()),
                    new Tuple<string, string>("Y1", areaSelector.Area.Location.Y.ToString()),
                    new Tuple<string, string>("X2", (areaSelector.Area.Location.X + areaSelector.Area.Width).ToString()),
                    new Tuple<string, string>("Y2", (areaSelector.Area.Location.Y + areaSelector.Area.Height).ToString()),
                    new Tuple<string, string>("Ширина фрагмента", areaSelector.Area.Width.ToString()),
                    new Tuple<string, string>("Высота фрагмента", areaSelector.Area.Height.ToString()),
                    new Tuple<string, string>("Максимальная амплитуда", maxSample.ToString()),
                    new Tuple<string, string>("Xmax", maxSampleLoc.X.ToString()),
                    new Tuple<string, string>("Ymax", maxSampleLoc.Y.ToString()),
                    new Tuple<string, string>("Минимальная амплитуда", minSample.ToString()),
                    new Tuple<string, string>("Xmin", minSampleLoc.X.ToString()),
                    new Tuple<string, string>("Ymin", minSampleLoc.Y.ToString()),
                    new Tuple<string, string>("Средняя амплитуда", avgSample.ToString())
                };

            return statistics;
        }
 public static AreaSizeCalcFactory GetFactory(Files.FileProperties properties)
 {
     switch (properties.Type)
     {
         case FileType.brl4:
             return new Concrete.Brl4SizeCalcFactory();
         case FileType.rl4:
             return new Concrete.Rl4SizeCalcFactory();
         case FileType.raw:
             return new Concrete.RawSizeCalcFactory();
         case FileType.r:
             return new Concrete.RSizeCalcFactory();
         case FileType.k:
             return new Concrete.KSizeCalcFactory();
         case FileType.rl8:
             return new Concrete.Rl8SizeCalcFactory();
         default:
             throw new NotSupportedException("Unsupported file format");
     }
 }
        public LuceneSearch.FileToIndex AddFile(string name, int dis, string auth, string tags, string comm)
        {
            var file = new Files
            {
                Path = Repository.Path,
                Size = Repository.Size
            };
            db.Files.Add(file);
            db.SaveChanges();

            var work = new Work
            {
                Date = DateTime.Now,
                Descipline = dis + 1,
                Hashtags = tags,
                Documet = file.Id,
                Authors = auth,
                Uploader = Repository.User.Login,
                University = Repository.User.University,
                Name = name,
                Description = comm

            };
            db.Work.Add(work);
            db.SaveChanges();

            var disc = db.Discipline.Where(c => c.Id == dis + 1).Select(c => c.Name);

            return new LuceneSearch.FileToIndex
            {
                Id = work.Id,
                Text = GetDocText(Path.GetFullPath(file.Path)),
                Description = comm,
                Authors = auth,
                Title = name,
                Hashtags = tags,
                Discipline = disc.ToArray()[0]

            };
        }
        public string Create(string filePath, string fileName, int cID, int fileclass)
        {
            int fID = db.Files.AsEnumerable().Select(x => x.FileID).DefaultIfEmpty(0).Max(x => x) + 1;
            string ret = "false";
            try
            {
                Files file = new Files();
                file.CID = cID;
                file.Class = fileclass;
                file.FileID = fID;
                file.FileAddr = filePath;
                file.FileName = fileName;

                db.Files.Add(file);
                db.SaveChanges();
                ret = "true";
            }
            catch
            {
            }
            return ret;
        }
        public Stream GetFileStream(Files.Core.File file, long offset)
        {
            //NOTE: id here is not converted!
            var fileToDownload = GetFileById(file.ID);
            //Check length of the file
            if (fileToDownload == null)
                throw new ArgumentNullException("file", Web.Files.Resources.FilesCommonResource.ErrorMassage_FileNotFound);

            //if (fileToDownload.Length > SetupInfo.AvailableFileSize)
            //{
            //    throw FileSizeComment.FileSizeException;
            //}

            var fileStream = fileToDownload.GetDataTransferAccessor().GetDownloadStream();

            if (fileStream.CanSeek)
                file.ContentLength = fileStream.Length; // hack for google drive

            if (offset > 0)
                fileStream.Seek(offset, SeekOrigin.Begin);

            return fileStream;
        }
 //修改图片信息
 //protected void photos_save_Click(object sender, EventArgs e)
 //{
 //    PhotosBLL bll = new PhotosBLL();
 //    Photos photos = new Photos();
 //    photos.P_Info = photos_info.Text;
 //    photos.P_Url = Common.photoid;
 //    if (bll.Modify(photos))
 //    {
 //        Response.Redirect(HttpUtility.UrlDecode(Request.QueryString["url"].ToString()));
 //    }
 //    else
 //    {
 //        ClientScript.RegisterStartupScript(GetType(), "", "alert('修改失败');", true);
 //    }
 //}
 /// <summary>
 /// 上传文件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnfileload_Click(object sender, EventArgs e)
 {
     if (FileUpload.HasFile)
     {
         try
         {
             FilesBLL bll = new FilesBLL();
             Files file = new Files();
             string serverPath = Server.MapPath("/FileSave");
             if (!Directory.Exists(serverPath))
             {
                 Directory.CreateDirectory(serverPath);
             }
             string fileName = FileUpload.FileName;
             string newPath = serverPath + "\\" + fileName;
             file.FRName = fileName;
             FileUpload.SaveAs(newPath);
             file.FUrl = "FileSave/" + fileName;
             file.FSize = Convert.ToInt32(FileUpload.FileContent.Length / 1000);
             file.FUserId = Convert.ToInt32(cookieRead("id"));
             file.FName = file_info.Text;
             if (file.FName.Equals(""))
             {
                 file.FName = fileName;
             }
             bll.AddFiles(file);
             tagContent5.Style["display"] = "block";
             tagContent0.Style["display"] = "none";
             ClientScript.RegisterStartupScript(GetType(), "", "alert('上传成功');", true);
         }
         catch (Exception)
         {
             ClientScript.RegisterStartupScript(GetType(), "", "alert('上传失败');", true);
         }
     }
 }
        //Generic procedure to read and parse Standardization.DB (&others..soon)
        public int SQLAccess(string cmd)
        {
            //var DB_Path = txt_DBFolder.Text + "\\Files.mdb;";
            //Files[] files = new Files[10000];

            var MaximumSize = 0;

            //rtxt_StatisticsOnReadDLCs.Text += "\n  ee= ";
            try
            {
            MessageBox.Show(DB_Path);
            using (OleDbConnection cnn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.12.0;Data Source=" + DB_Path))
            {
                DataSet dus = new DataSet();
                OleDbDataAdapter dax = new OleDbDataAdapter(cmd, cnn); //WHERE id=253
                dax.Fill(dus, "Standardization");

                var i = 0;
                //rtxt_StatisticsOnReadDLCs.Text += "\n  54= " +dus.Tables[0].Rows.Count;
                MaximumSize = dus.Tables[0].Rows.Count;
                foreach (DataRow dataRow in dus.Tables[0].Rows)
                {
                    files[i] = new Files();

                    //rtxt_StatisticsOnReadDLCs.Text += "\n  a= " + i + MaximumSize+dataRow.ItemArray[0].ToString();
                    files[i].ID = dataRow.ItemArray[0].ToString();
                    files[i].Artist = dataRow.ItemArray[2].ToString();
                    files[i].Artist_Correction = dataRow.ItemArray[3].ToString();
                    files[i].Album = dataRow.ItemArray[4].ToString();
                    files[i].Album_Correction = dataRow.ItemArray[5].ToString();
                    files[i].AlbumArtPath_Correction = dataRow.ItemArray[6].ToString();
                    i++;
                }
                //Closing Connection
                dax.Dispose();
                cnn.Close();
                //rtxt_StatisticsOnReadDLCs.Text += i;
                //var ex = 0;
            }
            }
            catch (System.IO.FileNotFoundException ee)
            {
            MessageBox.Show(ee.Message + "Can not open Standardization DB connection ! ");
            //MessageBox.Show(ee.Message, MESSAGEBOX_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            //rtxt_StatisticsOnReadDLCs.Text += "\n  max rows" + MaximumSize;
            return MaximumSize;//files[10000];
        }
        //更新叫修單
        public String[] Update(WBSEventViewModel wBSEventViewModel)
        {
            String[] ret = new String[3];
            ret[0] = "false";
            ret[1] = wBSEventViewModel.C_ID.ToString();
            ret[2] = "";    //area

            int questionGrade = db.QuestionClass.AsEnumerable().Where(x => x.QuestionClassID == Int32.Parse(wBSEventViewModel.QuestionClass)).Select(x => x.QuestionGrade).First();
            int serviceHours = db.QuestionClass.AsEnumerable().Where(x => x.QuestionClassID == Int32.Parse(wBSEventViewModel.QuestionClass)).Select(x => x.QuestionServiceHours).First();
            String groupSW = db.Customer.AsEnumerable().Where(x => x.CustomerRef == wBSEventViewModel.CustomerRef).Select(x => x.GroupSW).First();

            if (wBSEventViewModel.ExpectArriveDTStr == null)
                wBSEventViewModel.ExpectArriveDTStr = "19000101 00:01";
            if (wBSEventViewModel.ExpectFinishDTStr == null)
                wBSEventViewModel.ExpectFinishDTStr = "19000101 00:01";
            wBSEventViewModel.ExpectArriveDT = DateTime.ParseExact(wBSEventViewModel.ExpectArriveDTStr, "yyyyMMdd HH:mm", CultureInfo.InvariantCulture);
            wBSEventViewModel.ExpectFinishDT = DateTime.ParseExact(wBSEventViewModel.ExpectFinishDTStr, "yyyyMMdd HH:mm", CultureInfo.InvariantCulture);
            ret[2] = GetCustomerArea(wBSEventViewModel.CustomerRef);


            try
            {
                //WBSEventM wBSEventM = new WBSEventM();
                WBSEventM wBSEventM = db.WBSEventM.Find(wBSEventViewModel.M_ID);
                
                //wBSEventM.CaseID = caseID;
                //wBSEventM.CaseClass = wBSEventViewModel.WBSCaseNumberM.Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries)[0];
                //wBSEventM.CaseClass = wBSEventViewModel.WBSCaseNumberM.Substring(0, 1);
                //wBSEventM.CaseClass = "C";
                //wBSEventM.CaseDate = wBSEventViewModel.WBSCaseNumberM.Substring(1, 8);
                //wBSEventM.CaseDate = DateTime.Now.ToString("yyyyMMdd");
                //wBSEventM.CaseCode = casecode;
                //wBSEventViewModel.WBSCaseNumberM = wBSEventM.CaseClass + wBSEventM.CaseDate;
                //if (wBSEventM.CaseCode < 10)
                //    wBSEventViewModel.WBSCaseNumberM += "0000" + wBSEventM.CaseCode.ToString();
                //else if (wBSEventM.CaseCode < 100 && wBSEventM.CaseCode >= 10)
                //    wBSEventViewModel.WBSCaseNumberM += "000" + wBSEventM.CaseCode.ToString();
                //else if (wBSEventM.CaseCode < 1000 && wBSEventM.CaseCode >= 100)
                //    wBSEventViewModel.WBSCaseNumberM += "00" + wBSEventM.CaseCode.ToString();
                //else if (wBSEventM.CaseCode < 10000 && wBSEventM.CaseCode >= 1000)
                //    wBSEventViewModel.WBSCaseNumberM += "0" + wBSEventM.CaseCode.ToString();
                //else
                //    wBSEventViewModel.WBSCaseNumberM += wBSEventM.CaseCode.ToString();
                //wBSEventM.RB_CasseDate = wBSEventViewModel.RB_CasseDate;
                //try
                //{
                //    wBSEventM.RB_CasseNumber = Int32.Parse(wBSEventViewModel.RB_CasseNumber);
                //}
                //catch
                //{
                //    wBSEventM.RB_CasseNumber = 0;
                //}
                wBSEventM.ProductID = wBSEventViewModel.ProductID;
                wBSEventM.CustomerRef = wBSEventViewModel.CustomerRef;
                wBSEventM.CustomerUserID = wBSEventViewModel.CustomerUserID;
                wBSEventM.CustomerUserName = wBSEventViewModel.CustomerUserName;
                wBSEventM.CustomerUserPhone1 = wBSEventViewModel.CustomerUserPhone1;
                wBSEventM.CustomerUserPhone2 = wBSEventViewModel.CustomerUserPhone2;
                wBSEventM.CustomerCaseNum = wBSEventViewModel.CustomerCaseNum;
                //20150811新增-Hsiuyang
                if (wBSEventViewModel.ChangeAddr != null)
                    if (wBSEventViewModel.ChangeAddr.Trim().Length > 0)
                        wBSEventM.CustomerAddr = wBSEventViewModel.ChangeAddr;
                wBSEventM.ModifyDT = DateTime.Now;
                wBSEventM.ModifyUserID = wBSEventViewModel.ModifyUserID;


                WBSEventC wBSEventC = db.WBSEventC.Find(wBSEventViewModel.C_ID);
                //wBSEventC.Num = num;
                //wBSEventC.MomCaseID = caseID;
                //wBSEventC.ChildCaseID = childCaseID;
                //wBSEventViewModel.WBSCaseNumberC = (wBSEventC.ChildCaseID < 10) ? ("0" + wBSEventC.ChildCaseID.ToString()) : wBSEventC.ChildCaseID.ToString();
                //wBSEventC.EventClass = "C01";
                wBSEventC.ProductClass = Int32.Parse(wBSEventViewModel.ProductClass);
                wBSEventC.ItemClass = Int32.Parse(wBSEventViewModel.ItemClass);
                wBSEventC.QuestionClass = Int32.Parse(wBSEventViewModel.QuestionClass);
                wBSEventC.QuestionGrade = questionGrade;
                wBSEventC.QuestionServiceHours = serviceHours;
                wBSEventC.QuestionDescription = wBSEventViewModel.QuestionDescription;                
                //wBSEventC.QuestionCreateUserID = wBSEventViewModel.QuestionCreateUserID;
                //wBSEventC.QuestionCreateDateTime = DateTime.Now;
                wBSEventC.ExpectArriveDateTime = wBSEventViewModel.ExpectArriveDT;
                wBSEventC.ExpectFinishDateTime = wBSEventViewModel.ExpectFinishDT;
                wBSEventC.ExpectArriveSW = wBSEventViewModel.ExpectArriveSW;
                //wBSEventC.DeleteMarkSW = wBSEventViewModel.DeleteMarkSW;
                //wBSEventC.DeleteReason = wBSEventViewModel.DeleteReason;
                //wBSEventC.DeleteMarkUserID = wBSEventViewModel.DeleteMarkUserID;
                //wBSEventC.DeleteMarkDateTime = wBSEventViewModel.DeleteMarkDT;
                //wBSEventC.CreateDateTime = DateTime.Now;
                //wBSEventC.CreateUserID = wBSEventViewModel.CreateUserID;
                wBSEventC.ModifyDateTime = DateTime.Now;
                wBSEventC.ModifyUserID = wBSEventViewModel.ModifyUserID;
                //20150811新增-Hsiuyang
                wBSEventC.SugProvideSpareMach = wBSEventViewModel.SugProvideSpareMach;
                wBSEventC.SugRetrieveSpareMach = wBSEventViewModel.SugRetrieveSpareMach;
                wBSEventC.SugRetrieveUserMach = wBSEventViewModel.SugRetrieveUserMach;
                wBSEventC.SugReturnUserMach = wBSEventViewModel.SugReturnUserMach;
                wBSEventC.SugMachMemo = wBSEventViewModel.SugMachMemo;   //建議備機說明
                //20150817新增-Hsiuyang
                if (wBSEventViewModel.Closed == "T") //線上處理結案影響
                {
                    wBSEventM.CaseMStatus = "9";    //9為問題已結案
                    wBSEventM.CloseDT = DateTime.Now;
                    wBSEventC.EventStatus = 50;     //50為任務已解決(維修附件上傳)
                    wBSEventC.QuestionFinishSW = "Y";
                    wBSEventC.QuestionFinishDT = DateTime.Now;
                    wBSEventC.QuestionFinishSysDT = DateTime.Now;
                    wBSEventC.ServiceReport = wBSEventViewModel.AssignDescription;  //當結案時解決方式即為服務報告
                }
                else
                {
                    //wBSEventM.CaseMStatus = "1";    //1為開立新問題
                    //wBSEventC.EventStatus = 11; //11為問題已開立
                    wBSEventC.QuestionFinishSW = null;
                    wBSEventC.QuestionFinishDT = null;
                    wBSEventC.QuestionFinishSysDT = null;
                    wBSEventC.ServiceReport = null;  //當結案時解決方式即為服務報告
                }
                wBSEventC.AssignDescription = wBSEventViewModel.AssignDescription;  //解決方式(派單)描述

                //刪除原子單建議零件
                var qryD = db.SugProduct.Where(x => x.CID == wBSEventC.Num && (x.Class == 1 || x.Class == 3));
                foreach (SugProduct d in qryD)
                {
                    db.SugProduct.Remove(d);
                }
                //刪除原子單解決方式知識庫附件
                var qryDK = db.Files.Where(x => x.CID == wBSEventC.Num && x.Class == 3);
                foreach (Files d in qryDK)
                {
                    db.Files.Remove(d);
                }
                //刪除原子單執行預先保養單
                var qryM = db.EventRelation.Where(x => x.CID == wBSEventC.Num);
                foreach (EventRelation d in qryM)
                {
                    db.EventRelation.Remove(d);
                }
                //刪除原子單建議參考網頁
                var qryDH = db.Files.Where(x => x.CID == wBSEventC.Num && x.Class == 9);
                foreach (Files d in qryDH)
                {
                    db.Files.Remove(d);
                }
                
                //20150817新增-Hsiuyang-SugProduct建議部分
                JArray SugProduct = JsonConvert.DeserializeObject<JArray>(wBSEventViewModel.MaterialJson);
                for (int i = 0; i < SugProduct.Count; i++)
                {
                    SugProduct sugProduct = new SugProduct();
                    sugProduct.CID = wBSEventC.Num;
                    sugProduct.Class = Int32.Parse(SugProduct[i]["Class"].ToString());                    
                    if (SugProduct[i]["ProductNum"].ToString() == "")
                        sugProduct.ProductName = SugProduct[i]["ProductName"].ToString();                    
                    else
                        sugProduct.ProductNum = Int32.Parse(SugProduct[i]["ProductNum"].ToString());
                    

                    db.SugProduct.Add(sugProduct);
                }
                //20150817新增-Hsiuyang-解決方式知識庫附件
                JArray KnowledgeData = JsonConvert.DeserializeObject<JArray>(wBSEventViewModel.KnowledgeJson);
                for (int i = 0; i < KnowledgeData.Count; i++)
                {
                    Files knowledgefile = new Files();
                    knowledgefile.CID = wBSEventC.Num;
                    knowledgefile.Class = 3;
                    knowledgefile.FileAddr = "";
                    knowledgefile.FileName = "";                    
                    knowledgefile.KnowledgeID = Int32.Parse(KnowledgeData[i]["KnowledgeID"].ToString());
                    db.Files.Add(knowledgefile);
                }
                //20150817新增-Hsiuyang-執行預先保養單
                JArray maintainCases = JsonConvert.DeserializeObject<JArray>(wBSEventViewModel.MaintainCaseJson);
                for (int i = 0; i < maintainCases.Count; i++)
                {
                    EventRelation maintainCase = new EventRelation();
                    maintainCase.CID = wBSEventC.Num;
                    maintainCase.RelationCID = Int32.Parse(maintainCases[i]["cID"].ToString());

                    db.EventRelation.Add(maintainCase);
                }

                //20151113新增-Hsiuyang-Hyperlink建議參考網頁(CLASS=9)
                JArray Hyperlink = JsonConvert.DeserializeObject<JArray>(wBSEventViewModel.HyperlinkJson);
                for (int i = 0; i < Hyperlink.Count; i++)
                {
                    Files hyperlink = new Files();
                    hyperlink.CID = wBSEventC.Num;
                    hyperlink.Class = 9;
                    hyperlink.FileAddr = Hyperlink[i]["Href"].ToString();
                    hyperlink.FileName = Hyperlink[i]["Name"].ToString();

                    db.Files.Add(hyperlink);
                }

                //db.WBSEventM.Add(wBSEventM);
                //db.WBSEventC.Add(wBSEventC);
                db.SaveChanges();
                //ret = "true";
                ret[0] = wBSEventViewModel.WBSCaseNumberM + "-" + wBSEventViewModel.WBSCaseNumberC;
            }
            catch
            {
            }

            return ret;
        }
        //電腦建立二次派工叫修單(20151221-增加自動派工)
        public String[] TwiceCreate(WBSEventViewModel wBSEventViewModel)
        {
            String[] ret = new String[4];
            ret[0] = "false";
            ret[1] = "";
            ret[2] = "";    //area
            ret[3] = "";    //auto assign user name
            int num = 0, childCaseID = 0;
            
            
            num = db.WBSEventC.AsEnumerable().Select(x => x.Num).DefaultIfEmpty(0).Max(x => x) + 1;
            childCaseID = db.WBSEventC.AsEnumerable().Where(x => x.MomCaseID == wBSEventViewModel.M_ID).Select(x => x.ChildCaseID).DefaultIfEmpty(0).Max(x => x) + 1;
            int questionGrade = db.QuestionClass.AsEnumerable().Where(x => x.QuestionClassID == Int32.Parse(wBSEventViewModel.QuestionClass)).Select(x => x.QuestionGrade).First();
            int serviceHours = db.QuestionClass.AsEnumerable().Where(x => x.QuestionClassID == Int32.Parse(wBSEventViewModel.QuestionClass)).Select(x => x.QuestionServiceHours).First();
            String groupSW = db.Customer.AsEnumerable().Where(x => x.CustomerRef == wBSEventViewModel.CustomerRef).Select(x => x.GroupSW).First();

            if (wBSEventViewModel.ExpectArriveDTStr == null)
                wBSEventViewModel.ExpectArriveDTStr = "19000101 00:01";
            if (wBSEventViewModel.ExpectFinishDTStr == null)
                wBSEventViewModel.ExpectFinishDTStr = "19000101 00:01";
            wBSEventViewModel.ExpectArriveDT = DateTime.ParseExact(wBSEventViewModel.ExpectArriveDTStr, "yyyyMMdd HH:mm", CultureInfo.InvariantCulture);
            wBSEventViewModel.ExpectFinishDT = DateTime.ParseExact(wBSEventViewModel.ExpectFinishDTStr, "yyyyMMdd HH:mm", CultureInfo.InvariantCulture);
            ret[2] = GetCustomerArea(wBSEventViewModel.CustomerRef);


            try
            {
                bool isMChg = false;
                WBSEventM wBSEventM = db.WBSEventM.Find(wBSEventViewModel.M_ID);
                //20150811新增-Hsiuyang
                if (wBSEventViewModel.ChangeAddr != null)
                    if (wBSEventViewModel.ChangeAddr.Trim().Length > 0)
                    {
                        wBSEventM.CustomerAddr = wBSEventViewModel.ChangeAddr;
                        isMChg = true;
                    }
                //wBSEventM.SpareMach = "R";      //預設無借出備機
                //wBSEventM.UserMach = "R";       //預設無取回客戶機器
                if (Int32.Parse(wBSEventM.CaseMStatus) < 4 && wBSEventM.CaseMStatus != "0")
                {
                    isMChg = true;
                    wBSEventM.CaseMStatus = "4";    //4為已分配(另開子單)
                }
                if (wBSEventM.CaseMStatus == "6")   //6為全部子單以解決需退回5
                {   
                    isMChg = true;
                    wBSEventM.CaseMStatus = "5";    //5為部分子單已解決
                }
                if (isMChg)
                {
                    wBSEventM.ModifyDT = DateTime.Now;
                    wBSEventM.ModifyUserID = wBSEventViewModel.CreateUserID;
                }

                WBSEventC wBSEventC = new WBSEventC();
                ret[1] = num.ToString();
                wBSEventC.Num = num;
                wBSEventC.MomCaseID = wBSEventViewModel.M_ID;
                wBSEventC.ChildCaseID = childCaseID;
                wBSEventViewModel.WBSCaseNumberC = (wBSEventC.ChildCaseID < 10) ? ("0" + wBSEventC.ChildCaseID.ToString()) : wBSEventC.ChildCaseID.ToString();
                wBSEventC.EventClass = wBSEventViewModel.EventClass;
                wBSEventC.ProductClass = Int32.Parse(wBSEventViewModel.ProductClass);
                wBSEventC.ItemClass = Int32.Parse(wBSEventViewModel.ItemClass);
                wBSEventC.QuestionClass = Int32.Parse(wBSEventViewModel.QuestionClass);
                wBSEventC.QuestionGrade = questionGrade;
                wBSEventC.QuestionServiceHours = serviceHours;
                wBSEventC.QuestionDescription = wBSEventViewModel.QuestionDescription;
                wBSEventC.QuestionCreateUserID = wBSEventViewModel.QuestionCreateUserID;
                wBSEventC.QuestionCreateDateTime = DateTime.Now;
                wBSEventC.ExpectArriveDateTime = wBSEventViewModel.ExpectArriveDT;
                wBSEventC.ExpectFinishDateTime = wBSEventViewModel.ExpectFinishDT;
                wBSEventC.ExpectArriveSW = wBSEventViewModel.ExpectArriveSW;
                wBSEventC.CreateDateTime = DateTime.Now;
                wBSEventC.CreateUserID = wBSEventViewModel.CreateUserID;
                wBSEventC.ModifyDateTime = DateTime.Now;
                wBSEventC.ModifyUserID = wBSEventViewModel.CreateUserID;
                //20150811新增-Hsiuyang
                wBSEventC.SugProvideSpareMach = wBSEventViewModel.SugProvideSpareMach;
                wBSEventC.SugRetrieveSpareMach = wBSEventViewModel.SugRetrieveSpareMach;
                wBSEventC.SugRetrieveUserMach = wBSEventViewModel.SugRetrieveUserMach;
                wBSEventC.SugReturnUserMach = wBSEventViewModel.SugReturnUserMach;
                wBSEventC.SugMachMemo = (wBSEventViewModel.SugMachMemo == null) ? "" : wBSEventViewModel.SugMachMemo;   //建議備機說明

                wBSEventC.EventStatus = 11; //11為問題已開立
                //20150813新增-Hsiuyang
                if (wBSEventViewModel.Closed == "T") //線上處理結案影響
                {
                    //wBSEventM.CaseMStatus = "9";    //9為問題已結案
                    //wBSEventM.CloseDT = DateTime.Now;
                    wBSEventC.EventStatus = 50;     //50為任務已解決(維修附件上傳)
                    wBSEventC.QuestionFinishSW = "Y";
                    wBSEventC.QuestionFinishDT = DateTime.Now;
                    wBSEventC.QuestionFinishSysDT = DateTime.Now;
                    wBSEventC.ServiceReport = wBSEventViewModel.AssignDescription;  //當結案時解決方式即為服務報告
                }
                wBSEventC.AssignDescription = wBSEventViewModel.AssignDescription;  //解決方式(派單)描述


                //20150812新增-Hsiuyang-SugProduct建議部分
                if (wBSEventViewModel.MaterialJson != null)
                {
                    JArray SugProduct = JsonConvert.DeserializeObject<JArray>(wBSEventViewModel.MaterialJson);
                    for (int i = 0; i < SugProduct.Count; i++)
                    {
                        SugProduct sugProduct = new SugProduct();
                        sugProduct.CID = wBSEventC.Num;
                        sugProduct.Class = Int32.Parse(SugProduct[i]["Class"].ToString());
                        //sugProduct.Class = Int32.Parse(SugProduct[i][0].ToString());
                        //if (SugProduct[i][1].ToString() == "")
                        if (SugProduct[i]["ProductNum"].ToString() == "")
                            sugProduct.ProductName = SugProduct[i]["ProductName"].ToString();
                        //sugProduct.ProductName = SugProduct[i][2].ToString();
                        else
                            sugProduct.ProductNum = Int32.Parse(SugProduct[i]["ProductNum"].ToString());
                        //sugProduct.ProductNum = Int32.Parse(SugProduct[i][1].ToString());

                        db.SugProduct.Add(sugProduct);
                    }
                }
                //20150813新增-Hsiuyang-解決方式知識庫附件
                if (wBSEventViewModel.KnowledgeJson != null)
                {
                    JArray KnowledgeData = JsonConvert.DeserializeObject<JArray>(wBSEventViewModel.KnowledgeJson);
                    for (int i = 0; i < KnowledgeData.Count; i++)
                    {
                        Files knowledgefile = new Files();
                        knowledgefile.CID = wBSEventC.Num;
                        knowledgefile.Class = 3;
                        knowledgefile.FileAddr = "";
                        knowledgefile.FileName = "";
                        //knowledgefile.KnowledgeID = Int32.Parse(KnowledgeData[i][0].ToString());
                        knowledgefile.KnowledgeID = Int32.Parse(KnowledgeData[i]["KnowledgeID"].ToString());
                        db.Files.Add(knowledgefile);
                    }
                }
                //20150814新增-Hsiuyang-執行預先保養單
                if (wBSEventViewModel.MaintainCaseJson != null)
                {
                    JArray maintainCases = JsonConvert.DeserializeObject<JArray>(wBSEventViewModel.MaintainCaseJson);
                    for (int i = 0; i < maintainCases.Count; i++)
                    {
                        EventRelation maintainCase = new EventRelation();
                        maintainCase.CID = wBSEventC.Num;
                        maintainCase.RelationCID = Int32.Parse(maintainCases[i]["cID"].ToString());

                        db.EventRelation.Add(maintainCase);
                    }
                }
                //20151113新增-Hsiuyang-Hyperlink建議參考網頁(CLASS=9)
                if (wBSEventViewModel.HyperlinkJson != null)
                {
                    JArray Hyperlink = JsonConvert.DeserializeObject<JArray>(wBSEventViewModel.HyperlinkJson);
                    for (int i = 0; i < Hyperlink.Count; i++)
                    {
                        Files hyperlink = new Files();
                        hyperlink.CID = wBSEventC.Num;
                        hyperlink.Class = 9;
                        hyperlink.FileAddr = Hyperlink[i]["Href"].ToString();
                        hyperlink.FileName = Hyperlink[i]["Name"].ToString();

                        db.Files.Add(hyperlink);
                    }
                }
                //20151221-自動派單 20160906改轉派工時選擇人派工
                if (wBSEventViewModel.ResponsibleID != "" && wBSEventViewModel.ResponsibleID != null)
                {
                    //String subAreaID = db.Customer.AsEnumerable().Where(x => x.CustomerRef == wBSEventM.CustomerRef).Select(x => x.RegionID).First();
                    //String AreaID = db.SubArea.AsEnumerable().Where(x => x.SubAreaID == subAreaID).Select(x => x.AreaID).First();
                    //int rID = 0;

                    //if (db.SystemSetting.Where(x => x.EventClass == wBSEventViewModel.EventClass && x.AutoAssign == true).Count() > 0) //事件個別指定
                    //{
                    //    if (db.SystemSetting.Where(x => x.EventClass == wBSEventViewModel.EventClass && x.AutoAssignUserType == 2).Count() > 0)
                    //        rID = db.SubArea.AsEnumerable().Where(x => x.SubAreaID == subAreaID).Select(x => x.ResponsibleID).First();
                    //    else
                    //    {
                    //        if (db.DefaultAssignSetting.Where(x => x.EventClass == wBSEventViewModel.EventClass && x.AreaID == AreaID).Count() > 0)
                    //            rID = db.DefaultAssignSetting.Where(x => x.EventClass == wBSEventViewModel.EventClass && x.AreaID == AreaID).Select(x => x.ResponsibleClassID).First();
                    //        else if (db.DefaultAssignSetting.Where(x => x.isSysDefault == true && x.AreaID == AreaID).Count() > 0)
                    //            rID = db.DefaultAssignSetting.Where(x => x.isSysDefault == true && x.AreaID == AreaID).Select(x => x.ResponsibleClassID).First();
                            
                    //    }
                    //}
                    //else //系統預設
                    //{
                    //    if (db.SystemSetting.Where(x => x.isSysDefault == true && x.AutoAssignUserType == 2).Count() > 0)
                    //        rID = db.SubArea.AsEnumerable().Where(x => x.SubAreaID == subAreaID).Select(x => x.ResponsibleID).First();
                    //    else
                    //    {
                    //        if (db.DefaultAssignSetting.Where(x => x.EventClass == wBSEventViewModel.EventClass && x.AreaID == AreaID).Count() > 0)
                    //            rID = db.DefaultAssignSetting.Where(x => x.EventClass == wBSEventViewModel.EventClass && x.AreaID == AreaID).Select(x => x.ResponsibleClassID).First();
                    //        else if (db.DefaultAssignSetting.Where(x => x.isSysDefault == true && x.AreaID == AreaID).Count() > 0)
                    //            rID = db.DefaultAssignSetting.Where(x => x.isSysDefault == true && x.AreaID == AreaID).Select(x => x.ResponsibleClassID).First();
                             
                    //    }

                    //}

                    //wBSEventC.ResponsibleID = rID;

                    wBSEventC.ResponsibleID = int.Parse(wBSEventViewModel.ResponsibleID);

                    wBSEventC.AssignCreateDT = DateTime.Now;
                    wBSEventC.AssignCreateUserID = wBSEventViewModel.CreateUserID;
                    wBSEventC.AssignDT = DateTime.Now;
                    wBSEventC.AssignUserID = wBSEventViewModel.CreateUserID;
                    wBSEventC.AssignModifyDT = DateTime.Now;
                    wBSEventC.AssignModifyUserID = wBSEventViewModel.CreateUserID;

                    wBSEventC.RespondSW = "Y";
                    wBSEventC.RespondDT = DateTime.Now;
                    wBSEventC.RespondReason = "";
                    //wBSEventC.ScheduleStartDT = wBSEventViewModel.ExpectArriveDT;
                    //wBSEventC.ScheduleEndDT = wBSEventViewModel.ExpectFinishDT;
                    //wBSEventC.ScheduleServiceHours = wBSEventC.QuestionServiceHours;
                    
                    wBSEventC.EventStatus = 30; //30任務已接受未排程

                    //String ExpectArriveSW, EventStatusStr;
                    //if (wBSEventC.ExpectArriveSW == "0")
                    //    ExpectArriveSW = "自行約定";
                    //else if (wBSEventC.ExpectArriveSW == "1")
                    //    ExpectArriveSW = "合約規定";
                    //else if (wBSEventC.ExpectArriveSW == "2")
                    //    ExpectArriveSW = "建議期望";
                    //else if (wBSEventC.ExpectArriveSW == "4")
                    //    ExpectArriveSW = "自派新單";
                    //else
                    //    ExpectArriveSW = "客戶指定";

                    //String ExpectArriveDTStr = wBSEventC.ExpectArriveDateTime.Value.ToString("yyyy/MM/dd HH:mm");
                    //if (wBSEventC.ExpectArriveSW == "0")
                    //    ExpectArriveDTStr = "自行約定";
                                        
                    //EventStatusStr = "已接受未排程";


                    //String UserID = db.ResponsibleClass.Where(x => x.ID == rID).Select(x => x.UserID).First();
                    //String UserName = db.ResponsibleClass.Where(x => x.ID == rID).Select(x => x.UserData2.UserName).First();
                    //ret[3] = db.ResponsibleClass.Where(x => x.ID == rID).Select(x => x.Name).First() + "-" + UserName;

                    //String url = "http://" + wBSEventViewModel.Url + "/Mobile/MobileCaseDetail?type=2&&mid=" + wBSEventC.MomCaseID + "&&cid=" + wBSEventC.Num;
                    //String title = "";      //[燈號]-[推播事件說明]
                    //String content = "";    //[被推播人員姓名]您好:案件-[客戶簡稱]-[到達約定選擇]:[應到達時間],[事件說明],請您盡速處理。
                    //title = "綠燈-執行人已接受未排程";
                    //content = UserName + "您好:案件-" + wBSEventM.Customer1.ShortName + "-" + ExpectArriveSW + ":" + ExpectArriveDTStr + "," + EventStatusStr + ",請您盡速處理。";

                    //messageRepository.AddMsgbyUser(UserID, title, content, url);
                }

                WBSEventC tmp = db.WBSEventC.Find(wBSEventViewModel.C_ID);
                if (tmp.EventStatus == 49)
                {
                    tmp.EventStatus = 50;
                }

                //db.WBSEventM.Add(wBSEventM);
                db.WBSEventC.Add(wBSEventC);
                db.SaveChanges();
                //ret = "true";
                ret[0] = wBSEventViewModel.WBSCaseNumberM + "-" + wBSEventViewModel.WBSCaseNumberC;
            }
            catch
            {
            }
            return ret;
        }
Exemple #23
0
 public RSaver(Files.LocatorFile file)
     : base(file)
 {
     _file = file as RlViewer.Files.Rli.Concrete.R;
     _head = _file.Header as RlViewer.Headers.Concrete.R.RHeader;
 }
Exemple #24
0
 public void SaveFileList()
 {
     try
     {
         if (FileList != null)
             lock (FileList)
             {
                 var fl = new Files {File = FileList.ToArray()};
                 string fn = MainForm.Conf.MediaDirectory + "video\\" +
                             Camobject.directory + "\\data.xml";
                 var s = new XmlSerializer(typeof (Files));
                 using (var fs = new FileStream(fn, FileMode.Create))
                 {
                     using (TextWriter writer = new StreamWriter(fs))
                     {
                         fs.Position = 0;
                         s.Serialize(writer, fl);
                         writer.Close();
                     }
                     fs.Close();
                 }
             }
     }
     catch (Exception ex)
     {
         Log.Error("",ex);//MainForm.LogExceptionToFile(ex);
     }
 }
Exemple #25
0
 public void SaveFileList()
 {
     try
     {
         if (_filelist != null)
         {
             var fl = new Files {File = _filelist.ToArray()};
             string dir = Dir.Entry + "audio\\" +
                          Micobject.directory + "\\";
             if (!Directory.Exists(dir))
                 Directory.CreateDirectory(dir);
             var s = new XmlSerializer(typeof (Files));
             using (var fs = new FileStream(dir + "data.xml", FileMode.Create))
             {
                 using (TextWriter writer = new StreamWriter(fs))
                 {
                     fs.Position = 0;
                     s.Serialize(writer, fl);
                     writer.Close();
                 }
                 fs.Close();
             }
         }
     }
     catch (Exception ex)
     {
         if (ErrorHandler != null)
             ErrorHandler(ex.Message);
     }
 }
Exemple #26
0
 public override Behaviors.Saving.Abstract.Saver Create(Files.LocatorFile file)
 {
     return new RlViewer.Behaviors.Saving.Concrete.RSaver(file);
 }
        //Generic procedure to read and parse Main.DB (&others..soon)
        public int SQLAccess(string cmd)
        {
            //var DB_Path = txt_DBFolder.Text + "\\Files.mdb;";
            //Files[] files = new Files[10000];

            var MaximumSize = 0;

            //rtxt_StatisticsOnReadDLCs.Text += "\n  ee= ";
            try
            {
                //MessageBox.Show(DB_Path);
                using (OleDbConnection cnn2 = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + DB_Path))
                {
                    DataSet dus = new DataSet();
                    OleDbDataAdapter dax = new OleDbDataAdapter(cmd, cnn2); //WHERE id=253
                    dax.Fill(dus, "Main");

                    var i = 0;
                    //rtxt_StatisticsOnReadDLCs.Text += "\n  54= " +dus.Tables[0].Rows.Count;
                    MaximumSize = dus.Tables[0].Rows.Count;
                    foreach (DataRow dataRow in dus.Tables[0].Rows)
                    {
                        files[i] = new Files();

                        //rtxt_StatisticsOnReadDLCs.Text += "\n  a= " + i + MaximumSize+dataRow.ItemArray[0].ToString();
                        files[i].ID = dataRow.ItemArray[0].ToString();
                        files[i].Song_Title = dataRow.ItemArray[1].ToString();
                        files[i].Song_Title_Sort = dataRow.ItemArray[2].ToString();
                        files[i].Album = dataRow.ItemArray[3].ToString();
                        files[i].Artist = dataRow.ItemArray[4].ToString();
                        files[i].Artist_Sort = dataRow.ItemArray[5].ToString();
                        files[i].Album_Year = dataRow.ItemArray[6].ToString();
                        files[i].AverageTempo = dataRow.ItemArray[7].ToString();
                        files[i].Volume = dataRow.ItemArray[8].ToString();
                        files[i].Preview_Volume = dataRow.ItemArray[9].ToString();
                        files[i].AlbumArtPath = dataRow.ItemArray[10].ToString();
                        files[i].AudioPath = dataRow.ItemArray[11].ToString();
                        files[i].audioPreviewPath = dataRow.ItemArray[12].ToString();
                        files[i].Track_No = dataRow.ItemArray[13].ToString();
                        files[i].Author = dataRow.ItemArray[14].ToString();
                        files[i].Version = dataRow.ItemArray[15].ToString();
                        files[i].DLC_Name = dataRow.ItemArray[16].ToString();
                        files[i].DLC_AppID = dataRow.ItemArray[17].ToString();
                        files[i].Current_FileName = dataRow.ItemArray[18].ToString();
                        files[i].Original_FileName = dataRow.ItemArray[19].ToString();
                        files[i].Import_Path = dataRow.ItemArray[20].ToString();
                        files[i].Import_Date = dataRow.ItemArray[21].ToString();
                        files[i].Folder_Name = dataRow.ItemArray[22].ToString();
                        files[i].File_Size = dataRow.ItemArray[23].ToString();
                        files[i].File_Hash = dataRow.ItemArray[24].ToString();
                        files[i].Original_File_Hash = dataRow.ItemArray[25].ToString();
                        files[i].Is_Original = dataRow.ItemArray[26].ToString();
                        files[i].Is_OLD = dataRow.ItemArray[27].ToString();
                        files[i].Is_Beta = dataRow.ItemArray[28].ToString();
                        files[i].Is_Alternate = dataRow.ItemArray[29].ToString();
                        files[i].Is_Multitrack = dataRow.ItemArray[30].ToString();
                        files[i].Is_Broken = dataRow.ItemArray[31].ToString();
                        files[i].MultiTrack_Version = dataRow.ItemArray[32].ToString();
                        files[i].Alternate_Version_No = dataRow.ItemArray[33].ToString();
                        files[i].DLC = dataRow.ItemArray[34].ToString();
                        files[i].Has_Bass = dataRow.ItemArray[35].ToString();
                        files[i].Has_Guitar = dataRow.ItemArray[36].ToString();
                        files[i].Has_Lead = dataRow.ItemArray[37].ToString();
                        files[i].Has_Rhythm = dataRow.ItemArray[38].ToString();
                        files[i].Has_Combo = dataRow.ItemArray[39].ToString();
                        files[i].Has_Vocals = dataRow.ItemArray[40].ToString();
                        files[i].Has_Sections = dataRow.ItemArray[41].ToString();
                        files[i].Has_Cover = dataRow.ItemArray[42].ToString();
                        files[i].Has_Preview = dataRow.ItemArray[43].ToString();
                        files[i].Has_Custom_Tone = dataRow.ItemArray[44].ToString();
                        files[i].Has_DD = dataRow.ItemArray[45].ToString();
                        files[i].Has_Version = dataRow.ItemArray[46].ToString();
                        files[i].Tunning = dataRow.ItemArray[47].ToString();
                        files[i].Bass_Picking = dataRow.ItemArray[48].ToString();
                        files[i].Tones = dataRow.ItemArray[49].ToString();
                        files[i].Groups = dataRow.ItemArray[50].ToString();
                        files[i].Rating = dataRow.ItemArray[51].ToString();
                        files[i].Description = dataRow.ItemArray[52].ToString();
                        files[i].Comments = dataRow.ItemArray[53].ToString();
                        files[i].Has_Track_No = dataRow.ItemArray[54].ToString();
                        files[i].Platform = dataRow.ItemArray[55].ToString();
                        files[i].PreviewTime = dataRow.ItemArray[56].ToString();
                        files[i].PreviewLenght = dataRow.ItemArray[57].ToString();
                        files[i].Temp = dataRow.ItemArray[58].ToString();
                        files[i].CustomForge_Followers = dataRow.ItemArray[59].ToString();
                        files[i].CustomForge_Version = dataRow.ItemArray[60].ToString();
                        files[i].Show_Available_Instruments = dataRow.ItemArray[61].ToString();
                        files[i].Show_Alternate_Version = dataRow.ItemArray[62].ToString();
                        files[i].Show_MultiTrack_Details = dataRow.ItemArray[63].ToString();
                        files[i].Show_Group = dataRow.ItemArray[64].ToString();
                        files[i].Show_Beta = dataRow.ItemArray[65].ToString();
                        files[i].Show_Broken = dataRow.ItemArray[66].ToString();
                        files[i].Show_DD = dataRow.ItemArray[67].ToString();
                        files[i].Original = dataRow.ItemArray[68].ToString();
                        files[i].Selected = dataRow.ItemArray[69].ToString();
                        files[i].YouTube_Link = dataRow.ItemArray[70].ToString();
                        files[i].CustomsForge_Link = dataRow.ItemArray[71].ToString();
                        files[i].CustomsForge_Like = dataRow.ItemArray[72].ToString();
                        files[i].CustomsForge_ReleaseNotes = dataRow.ItemArray[73].ToString();
                        files[i].SignatureType = dataRow.ItemArray[74].ToString();
                        files[i].ToolkitVersion = dataRow.ItemArray[75].ToString();
                        files[i].Has_Author = dataRow.ItemArray[76].ToString();
                        files[i].OggPath = dataRow.ItemArray[77].ToString();
                        files[i].oggPreviewPath = dataRow.ItemArray[78].ToString();
                        files[i].UniqueDLCName = dataRow.ItemArray[79].ToString();
                        files[i].AlbumArt_Hash = dataRow.ItemArray[80].ToString();
                        files[i].Audio_Hash = dataRow.ItemArray[81].ToString();
                        files[i].audioPreview_Hash = dataRow.ItemArray[82].ToString();
                        files[i].Has_BassDD = dataRow.ItemArray[83].ToString();
                        files[i].Has_Bonus_Arrangement = dataRow.ItemArray[84].ToString();
                        files[i].Artist_ShortName = dataRow.ItemArray[85].ToString();
                        files[i].Album_ShortName = dataRow.ItemArray[86].ToString();
                        files[i].Available_Old = dataRow.ItemArray[87].ToString();
                        files[i].Available_Duplicate = dataRow.ItemArray[88].ToString();
                        files[i].Has_Been_Corrected = dataRow.ItemArray[89].ToString();
                        i++;
                    }
                    //Closing Connection
                    dax.Dispose();
                    cnn2.Close();
                    //rtxt_StatisticsOnReadDLCs.Text += i;
                    //var ex = 0;
                }
            }
            catch (System.IO.FileNotFoundException ee)
            {
                MessageBox.Show(ee.Message + "Can not open Main DB connection ! ");
                //MessageBox.Show(ee.Message, MESSAGEBOX_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            //rtxt_StatisticsOnReadDLCs.Text += "\n  max rows" + MaximumSize;
            return MaximumSize;//files[10000];
        }
Exemple #28
0
 public FileInfo(Grads grads)
 {
     files=new Files(grads);
 }
 public override Behaviors.Navigation.NavigationSearcher.Abstract.GeodesicPointFinder Create(Files.LocatorFile file)
 {
     return null;
 }
 //Get all file data
 public FileResponse Get(Files request)
 {
     return new FileResponse { File = Db.Select<File>() };
 }