Ejemplo n.º 1
0
 public void FID2()
 {
     var f = new FID(4353425342532);
     var s = f.ToString();
     Console.WriteLine(s);
     Assert.AreEqual("3-16096351-68", s);
 }
Ejemplo n.º 2
0
 public void FID1()
 {
     var f = new FID(1);
     var s = f.ToString();
     Console.WriteLine(s);
     Assert.AreEqual("0-0-1", s);
 }
Ejemplo n.º 3
0
        public void FID2()
        {
            var f = new FID(4353425342532);
            var s = f.ToString();

            Console.WriteLine(s);
            Assert.AreEqual("3-16096351-68", s);
        }
Ejemplo n.º 4
0
        public void FID1()
        {
            var f = new FID(1);
            var s = f.ToString();

            Console.WriteLine(s);
            Assert.AreEqual("0-0-1", s);
        }
Ejemplo n.º 5
0
        protected void btnServiceClick(object sender, EventArgs e)
        {
            string id             = FID.ToString();
            var    plaintextBytes = Encoding.UTF8.GetBytes(id);
            var    encryptedValue = MachineKey.Encode(plaintextBytes, MachineKeyProtection.All);

            Response.Redirect("~/Admin/FuneralServicesSelect.aspx?ID=" + encryptedValue);
        }
Ejemplo n.º 6
0
        public void FID2()
        {
            var f = new FID(4353425342532);
            var s = f.ToString();

            s.See();
            Aver.AreEqual("3-16096351-68", s);
        }
Ejemplo n.º 7
0
        public void FID1()
        {
            var f = new FID(1);
            var s = f.ToString();

            s.See();
            Aver.AreEqual("0-0-1", s);
        }
Ejemplo n.º 8
0
        public void PrintQuotation()
        {
            string id             = FID.ToString();
            var    plaintextBytes = Encoding.UTF8.GetBytes(id);
            var    encryptedValue = MachineKey.Encode(plaintextBytes, MachineKeyProtection.All);

            //Response.Redirect("Default2.aspx?name=" + encryptedValue);
            Response.Redirect("~/Admin/PrintForm.aspx?FID=" + encryptedValue);
        }
Ejemplo n.º 9
0
 public string GetOperateDesc()
 {
     return($"FID:{FID.ToString()}】FName:{FName}】FDbType:{FDbType}】FIsDeleted:{(FIsDeleted ? "是" : "否")}】");
 }
Ejemplo n.º 10
0
 /// <summary>
 /// 获取操作信息
 /// </summary>
 /// <returns>操作信息</returns>
 public string GetOperateDesc()
 {
     return($"FID:{FID.ToString()}】FKey:{FKey}】FValue:{FValue}】FIsDeleted:{(FIsDeleted ? "是" : "否")}】");
 }
Ejemplo n.º 11
0
        public string getServiceData()
        {
            string        data         = "";
            decimal       TotalPayment = 0;
            StringBuilder sb           = new StringBuilder();

            if (QuotationID != 0)
            {
                QuotationServicesModel[] objServ = client.SelectServiceByQoutationID(QuotationID);
                if (objServ != null)
                {
                    sb.Append("<table  border='1'>");
                    sb.Append("<thead>");
                    sb.Append("<tr>");
                    sb.Append("<th class='service'>SERVICE</th>");
                    sb.Append("<th class='desc'>DESCRIPTION</th>");
                    sb.Append("<th>PRICE</th>");
                    sb.Append("<th>QTY</th>");
                    sb.Append("<th>TOTAL</th>");
                    sb.Append("</tr>");
                    sb.Append("</thead>");
                    sb.Append("<tbody>");
                    foreach (var Service in objServ)
                    {
                        sb.Append("<tr>");
                        sb.Append("<td class='service'>");
                        sb.Append(Service.ServiceName);
                        sb.Append("</td>");
                        sb.Append("<td class='desc'>");
                        sb.Append(Service.ServiceDesc);
                        sb.Append("</td>");
                        sb.Append("<td class='unit'>");
                        sb.Append(Service.ServiceRate);
                        sb.Append("</td>");
                        sb.Append("<td class='qty'>");
                        sb.Append(Service.Quantity);
                        sb.Append("</td>");
                        sb.Append("<td class='total'>");
                        sb.Append(Currency.Trim() + " " + Service.Amount);
                        sb.Append("</td>");
                        sb.Append("</tr>");
                    }
                    sb.Append("<tr>");
                    sb.Append("<td colspan='4'>"); sb.Append("SUBTOTAL"); sb.Append("</td>");
                    decimal Amt = 0;
                    foreach (var item in objServ)
                    {
                        Amt = Amt + item.Amount;
                    }
                    sb.Append("<td class='total'>"); sb.Append(Currency.Trim() + " " + Amt); sb.Append("</td>");
                    sb.Append("</tr>");
                    lblSubtotal.Text = Currency.Trim() + " " + Amt.ToString();
                    sb.Append("</tbody>");
                    sb.Append("</table");
                }
            }
            else if (FID != 0)
            {
                FuneralServiceSelectModel[] objServ = client.SelectServiceByFuneralID(FID);
                TotalPayment = client.ReturnFuneralPayments(this.ParlourId, FID.ToString()).ToList().Sum(x => x.AmountPaid);
                if (objServ != null)
                {
                    sb.Append("<table  border='1'>");
                    sb.Append("<thead>");
                    sb.Append("<tr>");
                    sb.Append("<th class='service'>SERVICE</th>");
                    sb.Append("<th class='desc'>DESCRIPTION</th>");
                    sb.Append("<th>PRICE</th>");
                    sb.Append("<th>QTY</th>");
                    sb.Append("<th>TOTAL</th>");
                    sb.Append("</tr>");
                    sb.Append("</thead>");
                    sb.Append("<tbody>");
                    foreach (var Service in objServ)
                    {
                        sb.Append("<tr>");
                        sb.Append("<td class='service'>");
                        sb.Append(Service.ServiceName);
                        sb.Append("</td>");
                        sb.Append("<td class='desc'>");
                        sb.Append(Service.ServiceDesc);
                        sb.Append("</td>");
                        sb.Append("<td class='unit'>");
                        sb.Append(Service.ServiceRate);
                        sb.Append("</td>");
                        sb.Append("<td class='qty'>");
                        sb.Append(Service.Quantity);
                        sb.Append("</td>");
                        sb.Append("<td class='total'>");
                        sb.Append(Currency.Trim() + " " + Service.Amount);
                        sb.Append("</td>");
                        sb.Append("</tr>");
                    }
                    sb.Append("<tr>");
                    sb.Append("<td colspan='4'>"); sb.Append("SUBTOTAL"); sb.Append("</td>");
                    decimal Amt = 0;
                    foreach (var item in objServ)
                    {
                        Amt = Amt + item.Amount;
                    }
                    sb.Append("<td class='total'>"); sb.Append(Currency.Trim() + " " + Amt); sb.Append("</td>");
                    sb.Append("</tr>");
                    lblSubtotal.Text = Currency.Trim() + " " + Amt.ToString();
                    sb.Append("</tbody>");
                    sb.Append("</table");
                }
            }
            else if (TBID != 0)
            {
                TombStoneServiceSelectModel[] objServ = client.SelectServiceByTombStoneID(TBID);
                TotalPayment = client.TombStonesPaymentSelectByTombstoneId(this.ParlourId, TBID).ToList().Sum(x => x.AmountPaid);
                if (objServ != null)
                {
                    sb.Append("<table  border='1'>");
                    sb.Append("<thead>");
                    sb.Append("<tr>");
                    sb.Append("<th class='service'>SERVICE</th>");
                    sb.Append("<th class='desc'>DESCRIPTION</th>");
                    sb.Append("<th>PRICE</th>");
                    sb.Append("<th>QTY</th>");
                    sb.Append("<th>TOTAL</th>");
                    sb.Append("</tr>");
                    sb.Append("</thead>");
                    sb.Append("<tbody>");
                    foreach (var Service in objServ)
                    {
                        sb.Append("<tr>");
                        sb.Append("<td class='service'>");
                        sb.Append(Service.ServiceName);
                        sb.Append("</td>");
                        sb.Append("<td class='desc'>");
                        sb.Append(Service.ServiceDesc);
                        sb.Append("</td>");
                        sb.Append("<td class='unit'>");
                        sb.Append(Service.ServiceRate);
                        sb.Append("</td>");
                        sb.Append("<td class='qty'>");
                        sb.Append(Service.Quantity);
                        sb.Append("</td>");
                        sb.Append("<td class='total'>");
                        sb.Append(Currency.Trim() + " " + Service.Amount);
                        sb.Append("</td>");
                        sb.Append("</tr>");
                    }
                    sb.Append("<tr>");
                    sb.Append("<td colspan='4'>"); sb.Append("SUBTOTAL"); sb.Append("</td>");
                    decimal Amt = 0;
                    foreach (var item in objServ)
                    {
                        Amt = Amt + item.Amount;
                    }
                    sb.Append("<td class='total'>"); sb.Append(Currency.Trim() + " " + Amt); sb.Append("</td>");
                    sb.Append("</tr>");
                    lblSubtotal.Text = Currency.Trim() + " " + Amt.ToString();
                    sb.Append("</tbody>");
                    sb.Append("</table");
                }
            }
            lblTotalPayment.Text = Currency.Trim() + " " + TotalPayment == null ? "0" : TotalPayment.ToString();
            ltrData.Text         = sb.ToString();
            return(data);
        }
Ejemplo n.º 12
0
 /// <summary>
 /// 获取操作信息
 /// </summary>
 /// <returns>操作信息</returns>
 public string GetOperateDesc()
 {
     return($"FID:{FID.ToString()}】FMacAddress:{FMacAddress}】FIP:{FIP}】FName:{FName}】FIsDeleted:{(FIsDeleted ? "是" : "否")}】");
 }
Ejemplo n.º 13
0
        private void SaveFile()
        {
            string message = "true";

            try
            {
                HttpFileCollection files = HttpContext.Current.Request.Files;

                BP.WF.Node node = new BP.WF.Node(FK_Node);

                string fileStart = WorkID.ToString();
                if (node.HisNodeWorkType == NodeWorkType.SubThreadWork)
                {
                    fileStart = FID.ToString();
                }

                //string file = Request["Path"];
                //file = HttpUtility.UrlDecode(file, Encoding.UTF8);

                string   path = Server.MapPath("~/DataUser/OfficeFile/" + FK_Flow + "/");
                string[] haveFiles = Directory.GetFiles(path);
                string   fileName = "", fileExtension = "";

                bool isHave = false;
                foreach (string file in haveFiles)
                {
                    FileInfo fileInfo = new FileInfo(file);
                    if (fileInfo.Name.StartsWith(fileStart + "."))
                    {
                        fileInfo.Delete();
                    }
                }

                if (files.Count > 0)
                {
                    ///'检查文件扩展名字
                    HttpPostedFile postedFile = files[0];
                    fileName = System.IO.Path.GetFileName(postedFile.FileName);

                    if (fileName != "")
                    {
                        //if (!isHave)
                        fileExtension = System.IO.Path.GetExtension(fileName);



                        postedFile.SaveAs(path + "\\" + fileStart + fileExtension);


                        if (IsSavePDF)
                        {
                            using (WebClient wc = new WebClient())
                            {
                                string url = "http://" + Request.Url.Authority + BP.WF.Glo.CCFlowAppPath + "WF/WebOffice/OfficeServices.ashx";
                                Uri    uri = new Uri(url);


                                string json = "Start=" + fileStart + "&Path=" + path + "&Extension=" + fileExtension + "&Type=savePDF";
                                //"{\"Start\":\"" + fileStart + "\",\"Path\":\"" + path + "\",\"Extension\":\"" + fileExtension + "\",\"Type\":\"savePDF\"}";
                                wc.Encoding = System.Text.Encoding.UTF8;

                                NameValueCollection value = new NameValueCollection();
                                value.Add("Start", fileStart);
                                value.Add("Path", path);
                                value.Add("Extension", fileExtension);
                                value.Add("Type", "savePDF");
                                wc.QueryString = value;
                                wc.UploadStringAsync(uri, "PUT", json, wc);
                            }
                        }
                    }
                    #region 标示已经自动套红
                    if (IsTrueTH)
                    {
                        //BP.Data.XCWordOver wordOver = new BP.Data.XCWordOver();
                        //  wordOver.ID = int.Parse(this.WorkID.ToString());
                        //  wordOver.IsOVer = true;
                        //  wordOver.Insert();
                    }
                    #endregion 标示已经自动套红

                    //try
                    //{


                    //    Microsoft.Office.Interop.Word.Application appClass = new Microsoft.Office.Interop.Word.Application();
                    //    appClass.Visible = false;

                    //    Object missing = System.Reflection.Missing.Value;

                    //    object fileNameR = path + "\\" + fileStart + fileExtension;
                    //    var wordDoc = appClass.Documents.Open(ref fileNameR, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);


                    //    object format = WdSaveFormat.wdFormatPDF;
                    //    object savePath = path + "\\" + fileStart + ".pdf";
                    //    wordDoc.SaveAs(ref savePath, ref format, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
                    //    wordDoc.Close();

                    //}
                    //catch (Exception ex)
                    //{

                    //}
                }
            }
            catch (Exception ex)
            {
                message = ex.Message.ToString();
            }
            this.Response.Clear();
            this.Response.Write(message);
            this.Response.End();
        }
Ejemplo n.º 14
0
        private void ReadFile()
        {
            string path = Server.MapPath("~/DataUser/OfficeFile/" + FK_Flow + "/");

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
            string[] files  = Directory.GetFiles(path);
            bool     isHave = false;

            BP.WF.Node node = new BP.WF.Node(FK_Node);



            string fileStart = WorkID.ToString();

            if (node.HisNodeWorkType == NodeWorkType.SubThreadWork)
            {
                fileStart = FID.ToString();
            }

            try
            {
                WorkFlow workflow = new WorkFlow(this.FK_Flow, this.WorkID);

                if (workflow.HisGenerWorkFlow.PWorkID != 0)
                {
                    BtnLab btnLab = new BtnLab(this.FK_Node);
                    if (btnLab.OfficeIsParent)
                    {
                        fileStart = workflow.HisGenerWorkFlow.PWorkID.ToString();
                    }
                }
            }
            catch (Exception)
            {
            }

            foreach (string file in files)
            {
                FileInfo fileInfo = new FileInfo(file);
                if (fileInfo.Name.StartsWith(fileStart + ".") && fileInfo.Name.Contains(".doc"))
                {
                    fileName.Text = fileInfo.Name;
                    fileType.Text = fileInfo.Extension.TrimStart('.');
                    isHave        = true;
                    break;
                }
            }

            foreach (string file in files)
            {
                FileInfo fileInfo = new FileInfo(file);
                if (fileInfo.Name.StartsWith(fileStart + "Mark."))
                {
                    MarkName = fileInfo.Name;
                    break;
                }
            }
            if (!isHave)
            {
                if (node.IsStartNode)
                {
                    //加载template
                    BtnLab btnLab = new BtnLab(this.FK_Node);
                    OfficeTemplate = btnLab.OfficeTemplate;

                    if (!string.IsNullOrEmpty(OfficeTemplate))
                    {
                        fileName.Text  = "/" + OfficeTemplate;
                        fileType.Text  = OfficeTemplate.Split('.')[1];
                        IsLoadTempLate = true;
                    }
                }

                //if (node.HisNodeWorkType == NodeWorkType.SubThreadWork)
                //{
                //    File.Exists(path+)
                //    foreach (string file in files)
                //    {
                //        FileInfo fileInfo = new FileInfo(file);
                //        if (fileInfo.Name.StartsWith(this.FID.ToString()))
                //        {
                //            fileInfo.CopyTo(path + "\\" + this.WorkID + fileInfo.Extension);
                //            fileName.Text = this.WorkID + fileInfo.Extension;
                //            fileType.Text = fileInfo.Extension.TrimStart('.');
                //            break;
                //        }
                //    }
                //}
            }
            else
            {
                //    if (node.HisNodeWorkType == NodeWorkType.WorkHL || node.HisNodeWorkType == NodeWorkType.WorkFHL)
                //    {

                //        GenerWorkFlows generWorksFlows = new GenerWorkFlows();
                //        generWorksFlows.RetrieveByAttr(GenerWorkFlowAttr.FID, this.WorkID);
                //        string tempH = "";
                //        foreach (GenerWorkFlow generWork in generWorksFlows)
                //        {
                //            tempH += generWork.WorkID + ",";
                //        }
                //        HeBing = tempH.TrimEnd(',');
                //    }
            }
        }
Ejemplo n.º 15
0
        private void SaveBak()
        {
            string result = "true";

            try
            {
                HttpFileCollection files = HttpContext.Current.Request.Files;

                BP.WF.Node node = new BP.WF.Node(FK_Node);

                string fileStart = WorkID.ToString() + "Mark";
                if (node.HisNodeWorkType == NodeWorkType.SubThreadWork)
                {
                    fileStart = FID.ToString();
                }

                //string file = Request["Path"];
                //file = HttpUtility.UrlDecode(file, Encoding.UTF8);

                string   path = Server.MapPath("~/DataUser/OfficeFile/" + FK_Flow + "/");
                string[] haveFiles = Directory.GetFiles(path);
                string   fileName = "", fileExtension = "";

                bool isHave = false;
                foreach (string file in haveFiles)
                {
                    FileInfo fileInfo = new FileInfo(file);
                    if (fileInfo.Name.StartsWith(fileStart + "."))
                    {
                        isHave = true;
                    }
                }
                if (isHave)
                {
                    fileStart += "." + Guid.NewGuid().ToString("N");
                }

                if (files.Count > 0)
                {
                    ///'检查文件扩展名字
                    HttpPostedFile postedFile = files[0];
                    fileName = System.IO.Path.GetFileName(postedFile.FileName);

                    if (fileName != "")
                    {
                        // if (!isHave)
                        fileExtension = System.IO.Path.GetExtension(fileName);

                        postedFile.SaveAs(path + "\\" + fileStart + fileExtension);
                        this.MarkName = fileStart + fileExtension;
                    }
                }
            }
            catch (Exception e)
            {
                result = "false";
            }

            this.Response.Clear();
            this.Response.Write(result);
            this.Response.End();
        }