コード例 #1
0
 protected void rpRefinement_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
     {
         Refine        refine     = e.Item.DataItem as Refine;
         RefineItemDAL dal        = new RefineItemDAL();
         var           refineItem = dal.GetRefineItemByRefineId(refine.Refine_Id).OrderByDescending(i => i.RefineItemDate).FirstOrDefault();
         if (refineItem != null)
         {
             HyperLink lnkLatestFile = e.Item.FindControl("lnkLatestFile") as HyperLink;
             lnkLatestFile.Text        = refineItem.RefineFileName;
             lnkLatestFile.NavigateUrl = Page.ResolveUrl(refineItem.RefineFilePath);
         }
     }
 }
コード例 #2
0
        protected void btnCreateCADRefinement_Click(object sender, EventArgs e)
        {
            //get no
            SeedDAL sdal = new SeedDAL();
            string  no   = sdal.GetNoByTableName(SysConst.TableRefine, SysConst.SuffixRefine);
            //get enqordman
            string enqOrdMan   = string.Empty;
            string companyName = string.Empty;
            string contact     = string.Empty;
            string address     = string.Empty;
            string email       = string.Empty;
            string qq          = string.Empty;
            string phone1      = string.Empty;
            string phone2      = string.Empty;
            string other       = string.Empty;
            string enqNo       = string.Empty;

            if (string.Equals(SourceType, SysConst.SourceTypeEnquiry, StringComparison.OrdinalIgnoreCase))
            {
                EnquiryDAL enqDAL = new EnquiryDAL();
                var        enq    = enqDAL.GetEnquiryByNo(SourceNo);
                enqOrdMan   = enq.EnqMan;
                companyName = enq.CustomerCompanyName;
                contact     = enq.CustomerContactName;
                address     = enq.CustomerAddress;
                email       = enq.CustomerEmail;
                qq          = enq.CustomerQQ;
                phone1      = enq.CustomerPhone1;
                phone2      = enq.CustomerPhone2;
                other       = enq.CustomerOthers;
                enqNo       = SourceNo;
                //update enq status
                enq.Status = "申请CAD细化";
                enqDAL.Save();
            }
            if (string.Equals(SourceType, SysConst.SourceTypeSalesOrder, StringComparison.OrdinalIgnoreCase))
            {
                OrderDAL soDAL = new OrderDAL();
                var      so    = soDAL.GetOrderByNo(SourceNo);
                enqOrdMan   = so.OrderMan;
                companyName = so.CustomerCompanyName;
                contact     = so.CustomerContactName;
                address     = so.CustomerAddress;
                email       = so.CustomerEmail;
                qq          = so.CustomerQQ;
                phone1      = so.CustomerPhone1;
                phone2      = so.CustomerPhone2;
                other       = so.CustomerOthers;
                enqNo       = so.EnqNo;
                //update enq status
                so.Status = "申请CAD细化";
                soDAL.Save();
            }
            //new refine
            RefineDAL dal    = new RefineDAL();
            Refine    refine = new Refine()
            {
                Refine_No           = no,
                Status              = FirstStatusConsts.Refine,
                EnqOrdMan           = enqOrdMan,
                SourceType          = SourceType,
                SourceNo            = SourceNo,
                CreatedDate         = DateTime.Now,
                CreatedAt           = DateTime.Now,
                CreatedBy           = SMSContext.Current.User.UserName,
                CustomerCompanyName = companyName,
                CustomerContactName = contact,
                CustomerAddress     = address,
                CustomerEmail       = email,
                CustomerQQ          = qq,
                CustomerPhone1      = phone1,
                CustomerPhone2      = phone2,
                CustomerOthers      = other,
                EnqNo = enqNo
            };

            dal.AddRefine(refine);
            dal.Save();

            int    refid  = refine.Refine_Id;
            string refno  = refine.Refine_No;
            string url    = Page.ResolveUrl(string.Format("~/RefineForm.aspx?refid={0}&refno={1}&sourcetype={2}&sourceno={3}", refid, refno, SourceType, SourceNo));
            string script = string.Format("<script>window.open('{0}')</script>", url);

            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "createrefine", script);
            BindControl();
            SetFocus(btnCreateCADRefinement);
        }
コード例 #3
0
ファイル: RefineResolver.cs プロジェクト: jwoff78/Angle
 public void AddRefine(string s)
 {
     Refine.Add(s);
 }
コード例 #4
0
 public void AddRefine(Refine refine)
 {
     refine.IsActive = true;
     Db.Refine.AddObject(refine);
 }
コード例 #5
0
    private static void Main(string[] args)
    //****************************************************************************80
    //
    //  Purpose:
    //
    //    MAIN is the main program for TRIANGULATION_REFINE.
    //
    //  Discussion:
    //
    //    TRIANGULATION_REFINE refines a triangulation by doubling.
    //
    //  Usage:
    //
    //    triangulation_refine prefix
    //
    //    where 'prefix' is the common filename prefix:
    //
    //    * prefix_nodes.txt contains the node coordinates,
    //    * prefix_elements.txt contains the element definitions.
    //    * prefix_ref_nodes.txt will contain the refined nodes;
    //    * prefix_ref_elements.txt will contain the refined elements.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    04 October 2009
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        const bool debug     = true;
        int        node_num2 = 0;
        string     prefix;
        int        triangle_num2 = 0;

        Console.WriteLine("");
        Console.WriteLine("TRIANGULATION_REFINE");
        Console.WriteLine("  Read a \"linear\" or \"quadratic\" triangulation");
        Console.WriteLine("  and write out a refined triangulation.");
        Console.WriteLine("");
        Console.WriteLine("  In particular:");
        Console.WriteLine("");
        Console.WriteLine("  Read a dataset of NODE_NUM1 points in 2 dimensions.");
        Console.WriteLine("");
        Console.WriteLine("  Read an associated triangulation dataset of TRIANGLE_NUM1 ");
        Console.WriteLine("  triangles which use 3 or 6 nodes per triangle.");
        Console.WriteLine("");
        Console.WriteLine("  Subdivide each triangle into 4 triangles,");
        Console.WriteLine("  generate new nodes as midpoints of current nodes.");
        Console.WriteLine("");
        Console.WriteLine("  Write out the new node and triangulation data.");
        Console.WriteLine("");
        Console.WriteLine("  If the input triangulation was Delaunay, then");
        Console.WriteLine("  the output triangulation will be Delaunay.");
        Console.WriteLine("");

        //
        //  Get the filename prefix.
        //
        try
        {
            prefix = args[0];
        }
        catch
        {
            Console.WriteLine("");
            Console.WriteLine("TRIANGULATION_REFINE:");
            Console.WriteLine("  Please enter the filename prefix.");

            prefix = Console.ReadLine();
        }

        //
        //  Create the filenames.
        //
        string node_filename        = prefix + "_nodes.txt";
        string element_filename     = prefix + "_elements.txt";
        string node_ref_filename    = prefix + "_ref_nodes.txt";
        string element_ref_filename = prefix + "_ref_elements.txt";
        //
        //  Read the node data.
        //
        TableHeader h         = typeMethods.r8mat_header_read(node_filename);
        int         dim_num   = h.m;
        int         node_num1 = h.n;

        Console.WriteLine("");
        Console.WriteLine("  Read the header of \"" + node_filename + "\".");
        Console.WriteLine("");
        Console.WriteLine("  Spatial dimension DIM_NUM = " + dim_num + "");
        Console.WriteLine("  Number of nodes NODE_NUM1 = " + node_num1 + "");

        double[] node_xy1 = typeMethods.r8mat_data_read(node_filename, dim_num, node_num1);

        Console.WriteLine("");
        Console.WriteLine("  Read the data in \"" + node_filename + "\".");

        typeMethods.r8mat_transpose_print_some(dim_num, node_num1, node_xy1, 1, 1, dim_num, 5,
                                               "  First 5 nodes:");
        //
        //  Read the element data.
        //
        h = typeMethods.i4mat_header_read(element_filename);
        int triangle_order = h.m;
        int triangle_num1  = h.n;

        if (triangle_order != 3 && triangle_order != 6)
        {
            Console.WriteLine("");
            Console.WriteLine("TRIANGULATION_REFINE - Fatal error!");
            Console.WriteLine("  Data is not for a 3-node or 6-node triangulation.");
            return;
        }

        Console.WriteLine("");
        Console.WriteLine("  Read the header of \"" + element_filename + "\".");
        Console.WriteLine("");
        Console.WriteLine("  Triangle order TRIANGLE_ORDER = " + triangle_order + "");
        Console.WriteLine("  Number of triangles TRIANGLE_NUM1  = " + triangle_num1 + "");

        int[] triangle_node1 = typeMethods.i4mat_data_read(element_filename,
                                                           triangle_order, triangle_num1);

        Console.WriteLine("");
        Console.WriteLine("  Read the data in \"" + element_filename + "\".");

        typeMethods.i4mat_transpose_print_some(triangle_order, triangle_num1, triangle_node1,
                                               1, 1, triangle_order, 5, "  First 5 triangles:");
        //
        //  Detect and correct 1-based node indexing.
        //
        Mesh.mesh_base_zero(node_num1, triangle_order, triangle_num1, ref triangle_node1);
        //
        //  Determine the size of the refined mesh.
        //
        int[] edge_data = new int[5 * 3 * triangle_num1];

        switch (triangle_order)
        {
        case 3:
            Refine.triangulation_order3_refine_size(node_num1, triangle_num1,
                                                    triangle_node1, ref node_num2, ref triangle_num2, ref edge_data);
            break;

        case 6:
            Refine.triangulation_order6_refine_size(node_num1, triangle_num1,
                                                    triangle_node1, ref node_num2, ref triangle_num2, ref edge_data);
            break;
        }

        Console.WriteLine("");
        Console.WriteLine("  Number of nodes in refined mesh =      " + node_num2 + "");
        Console.WriteLine("  Number of triangles in refined mesh =  "
                          + triangle_num2 + "");

        double[] node_xy2       = new double[dim_num * node_num2];
        int[]    triangle_node2 = new int[triangle_order * triangle_num2];
        switch (triangle_order)
        {
        //
        //  Compute the refined mesh.
        //
        case 3:
            Refine.triangulation_order3_refine_compute(node_num1, triangle_num1,
                                                       node_xy1, triangle_node1, node_num2, triangle_num2, edge_data, ref node_xy2,
                                                       ref triangle_node2);
            break;

        case 6:
            Refine.triangulation_order6_refine_compute(node_num1, triangle_num1,
                                                       node_xy1, triangle_node1, node_num2, triangle_num2, edge_data, ref node_xy2,
                                                       ref triangle_node2);
            break;
        }

        switch (debug)
        {
        case true:
            typeMethods.r8mat_transpose_print_some(dim_num, node_num2, node_xy2,
                                                   1, 1, dim_num, 5, "  First 5 output nodes:");

            typeMethods.i4mat_transpose_print_some(triangle_order, triangle_num2, triangle_node2,
                                                   1, 1, triangle_order, 5, "  First 5 output triangles");
            break;
        }

        //
        //  Write out the node and triangle data.
        //
        typeMethods.r8mat_write(node_ref_filename, dim_num, node_num2, node_xy2);

        Console.WriteLine("");
        Console.WriteLine("  Wrote the refined node data to \"" + node_ref_filename + "\".");

        typeMethods.i4mat_write(element_ref_filename, triangle_order, triangle_num2,
                                triangle_node2);

        Console.WriteLine("  Wrote the refined element data to \"" + element_ref_filename + "\".");

        Console.WriteLine("");
        Console.WriteLine("TRIANGULATION_REFINE:");
        Console.WriteLine("  Normal end of execution.");
    }