Exemple #1
0
    void PostData()
    {
        string Name       = Request["Name"];
        string Catalog_id = Request["catalog_id"];
        string GridData   = Request["GridData"];
        string Filter     = Request["Filter"];

        if (string.IsNullOrEmpty(Name))
        {
            Response.Write("名称不能空!");
            return;
        }

        GetReport().Name = Name;
        if (Catalog_id != "")
        {
            GetReport().RPT_ReportCatalog_id = new Guid(Catalog_id);
        }
        GetReport().Filter = Filter;

        int iLastIdx = 0;

        string[] arr1 = Regex.Split(GridData, ";");
        foreach (string str1 in arr1)
        {
            if (str1.Length == 0)
            {
                continue;
            }
            iLastIdx++;

            string[]  arr2         = Regex.Split(str1, ",");
            string    id           = arr2[0];
            string    StatTypeName = arr2[1];
            string    OrderName    = arr2[2];
            CStatItem StatItem     = (CStatItem)GetReport().StatItemMgr.Find(new Guid(id));
            if (StatItem != null)
            {
                StatItem.Idx = iLastIdx;
                StatItem.SetStatTypeByName(StatTypeName);
                StatItem.SetOrderByName(OrderName);
            }
        }

        CUser user = (CUser)Session["User"];

        GetReport().Updator = user.Id;

        m_Company.ReportMgr.Update(GetReport());

        if (!m_Company.ReportMgr.Save(true))
        {
            Response.Write("修改失败!");
            return;
        }
    }
        void UpdateStatItem()
        {
            foreach (DataGridViewRow item in dataGridStatItem.Rows)
            {
                CStatItem StatItem = (CStatItem)item.Tag;
                StatItem.Idx = item.Index;
                StatItem.SetStatTypeByName(item.Cells[2].Value.ToString());
                StatItem.SetOrderByName(item.Cells[3].Value.ToString());

                m_Report.StatItemMgr.Update(StatItem);
            }
        }