Пример #1
0
        protected void repFileReName_ItemCommand(object sender, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "Del")
            {
                string LabelName = e.CommandArgument.ToString();
                bll.DelLabelXML(LabelName);
                Response.Redirect("LabelManage.aspx");
            }
            if (e.CommandName == "Copy")
            {
                string LabelName = e.CommandArgument.ToString();

                M_Label newlbl = bll.GetLabelXML(LabelName);
                newlbl.LableName = newlbl.LableName + DataSecurity.RandomNum(4);
                newlbl.LabelID   = 0;
                bll.AddLabelXML(newlbl);
                Response.Redirect("LabelManage.aspx");
            }
            if (e.CommandName == "Download")
            {
                string      LabelName = e.CommandArgument.ToString();
                M_Label     newlbl    = bll.GetLabelXML(LabelName);
                XmlDocument doc       = new XmlDocument();
                XmlNode     nodelist  = doc.SelectSingleNode("//NewDataSet/Table[LabelID='" + newlbl.LabelID.ToString() + "']");
                string      fileName  = newlbl.LableName + ".lable";//客户端保存的文件名
                string      path      = newlbl.LabelCate + "/" + newlbl.LableName + ".label";
                SafeSC.DownFile(bll.dir + path, HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
            }
        }
 protected void repFileReName_ItemCommand(object sender, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "Del")
     {
         string LabelName = e.CommandArgument.ToString();
         bll.DelLabelXML(LabelName);
         Response.Redirect("LabelManage.aspx");
     }
     if (e.CommandName == "Copy")
     {
         string  LabelName = e.CommandArgument.ToString();
         M_Label newlbl    = bll.GetLabelXML(LabelName);
         newlbl.LableName = newlbl.LableName + DataSecurity.RandomNum(4);
         newlbl.LabelID   = 0;
         bll.AddLabelXML(newlbl);
         Response.Redirect("LabelManage.aspx");
     }
     if (e.CommandName == "Download")
     {
         string  LabelName = e.CommandArgument.ToString();
         M_Label newlbl    = bll.GetLabelXML(LabelName);
         SafeSC.DownFile(B_Label.GetLabelVPath(newlbl), newlbl.LableName + ".lable");
     }
 }
Пример #3
0
        protected void BtnSave_Click(object sender, EventArgs e)
        {
            M_Label labelMod = new M_Label();

            if (!string.IsNullOrEmpty(LabelName))
            {
                labelMod = bll.GetLabelXML(LabelName);
            }
            if (!LabelName.ToLower().Equals(TxtLabelName.Text.ToLower()))
            {
                bll.CheckLabelXML(TxtLabelName.Text);
            }
            labelMod.LableName  = this.TxtLabelName.Text;
            labelMod.LableType  = 1;
            labelMod.LabelCate  = this.TxtLabelType.Text;
            labelMod.Desc       = this.TxtLabelIntro.Text;
            labelMod.Content    = this.textContent.Text;
            labelMod.Param      = "";
            labelMod.LabelTable = "";
            labelMod.LabelField = "";
            labelMod.LabelWhere = "";
            labelMod.LabelOrder = "";
            labelMod.LabelCount = "";

            if (string.IsNullOrEmpty(LabelName))
            {
                labelMod.LabelNodeID   = 0;
                labelMod.Modeltypeinfo = this.Modeltypeinfo.Text;
                labelMod.Modelvalue    = this.Modelvalue.Text;
                labelMod.setroot       = this.setroot.SelectedValue;
                labelMod.Valueroot     = this.Valueroot.Text;
                labelMod.IsOpen        = this.boolmodel.Checked ? 1 : 0;
                labelMod.FalseContent  = this.falsecontent.Text;
                labelMod.addroot       = this.addroot.SelectedValue;
                bll.AddLabelXML(labelMod);
                function.WriteSuccessMsg("添加成功", "LabelManage.aspx");
            }
            else
            {
                labelMod.Modeltypeinfo = this.Modeltypeinfo.Text;
                labelMod.Modelvalue    = this.Modelvalue.Text;
                labelMod.setroot       = this.setroot.SelectedValue;
                if (this.Valueroot.Text == "这里放入标签")
                {
                    labelMod.Valueroot = "";
                }
                else
                {
                    labelMod.Valueroot = this.Valueroot.Text;
                }
                labelMod.FalseContent = this.falsecontent.Text;
                labelMod.addroot      = this.addroot.SelectedValue;
                labelMod.IsOpen       = this.boolmodel.Checked ? 1 : 0;
                //如果修改了名称
                if (!labelMod.LableName.ToLower().Equals(LabelName.ToLower()))
                {
                    bll.DelLabelXML(LabelName);
                    bll.AddLabelXML(labelMod);
                }
                else
                {
                    bll.UpdateLabelXML(labelMod);
                }
                function.WriteSuccessMsg("修改成功", "LabelManage.aspx");
            }
        }
Пример #4
0
        // 保存标签
        protected void BtnSave_Click(object sender, EventArgs e)
        {
            LabelName_T.Text = LabelName_T.Text.Trim();
            if (string.IsNullOrEmpty(SqlTable_T.Text))
            {
                Script("alert('查询表不能为空!');"); return;
            }
            M_Label labelMod = new M_Label();

            if (!string.IsNullOrEmpty(LabelName))
            {
                labelMod = bll.GetLabelXML(LabelName);
            }
            if (!LabelName.ToLower().Equals(LabelName_T.Text.ToLower()))
            {
                bll.CheckLabelXML(LabelName_T.Text);
            }
            labelMod.LableName  = LabelName_T.Text;
            labelMod.LableType  = DataConverter.CLng(LabelType_Rad.SelectedValue);
            labelMod.LabelCate  = LabelCate_T.Text;
            labelMod.Desc       = Desc_T.Text;
            labelMod.LabelTable = SqlTable_T.Text;
            string sqlFieldStr = SqlField_T.Text;

            labelMod.LabelField = string.IsNullOrEmpty(sqlFieldStr) ? "*" : sqlFieldStr;
            labelMod.Param      = Param_Hid.Value;
            labelMod.LabelWhere = Where_T.Text;
            labelMod.LabelOrder = Order_T.Text;
            labelMod.Content    = textContent.Text;
            labelMod.LabelCount = PSize_T.Text;
            //不支持跨数据源联结查询
            JObject jobj = new JObject();

            jobj.Add("ds_m", D1); jobj.Add("ds_s", D2); jobj.Add("tb_m", T1); jobj.Add("tb_s", T2);
            labelMod.DataSourceType = JsonConvert.SerializeObject(jobj);
            //标签模型化
            //M_SubLabel subMod = new M_SubLabel();
            //subMod.T1 = DBList_DP.SelectedValue;
            //subMod.T2 = DBList2_DP.SelectedValue;
            //subMod.JoinType = SqlJoin_DP.SelectedValue;
            //subMod.OnField1 = OnField_DP.SelectedValue;
            //subMod.OnField2 = OnField2_DP.SelectedValue;
            //labelMod.ProceParam = JsonConvert.SerializeObject(subMod);
            //---------------------
            if (!string.IsNullOrEmpty(LabelName))
            {
                if (labelMod.LabelID > 0)
                {
                    labelMod.Modeltypeinfo = Modeltypeinfo.Text;
                    labelMod.Modelvalue    = Modelvalue.Text;
                    labelMod.setroot       = setroot.SelectedValue;
                    labelMod.Valueroot     = Valueroot.Text;
                    labelMod.FalseContent  = falsecontent.Text;
                    labelMod.addroot       = bool_addroot_dp.SelectedValue;
                    labelMod.IsOpen        = BoolMode_Chk.Checked ? 1 : 0;
                }
                //外部库连接信息(改为修改ID),重要大小写,有labelinfo和LabelInfo
                //DropDownList dr = (DropDownList)WizardStep2.FindControl("DatabaseList");
                //labelMod.DataSourceType = dr.SelectedValue;//所属数据源ID,本地是0不处理
                //LabelInfo.ProceName = ProceName_Text.Text;
                //LabelInfo.ProceParam = ProceParam_Text.Text;
                //labelMod.ConnectString = schema_Text.Text;
                //如果修改了名称
                if (!labelMod.LableName.ToLower().Equals(LabelName.ToLower()))
                {
                    bll.DelLabelXML(LabelName);
                    bll.AddLabelXML(labelMod);
                }
                else
                {
                    bll.UpdateLabelXML(labelMod);
                }
                function.WriteSuccessMsg("修改成功", "LabelManage.aspx");
            }
            else
            {
                labelMod.LabelNodeID   = 0;
                labelMod.Modeltypeinfo = Modeltypeinfo.Text;
                labelMod.Modelvalue    = Modelvalue.Text;
                labelMod.setroot       = setroot.SelectedValue;
                labelMod.Valueroot     = Valueroot.Text;
                labelMod.IsOpen        = BoolMode_Chk.Checked ? 1 : 0;
                labelMod.FalseContent  = falsecontent.Text;
                labelMod.addroot       = bool_addroot_dp.SelectedValue;
                //LabelInfo.ProceName = ProceName_Text.Text;
                //LabelInfo.ProceParam = ProceParam_Text.Text;
                //labelMod.ConnectString = schema_Text.Text;
                bll.AddLabelXML(labelMod);
                function.WriteSuccessMsg("添加成功", "LabelManage.aspx");
            }
        }
Пример #5
0
        public IActionResult LabelSql_Save()
        {
            M_APIResult retMod = new M_APIResult(Failed);
            string      name   = DataConvert.CStr(RequestEx["LabelName_T"]).Replace(" ", "");

            if (string.IsNullOrEmpty(name))
            {
                retMod.retmsg = "标签名不能为空"; return(Content(retMod.ToString()));
            }
            //if (string.IsNullOrEmpty(SqlTable_T.Text)) { Script("alert('查询表不能为空!');");  }
            M_Label labelMod = new M_Label();

            if (!string.IsNullOrEmpty(LabelName))
            {
                labelMod = labelBll.GetLabelXML(LabelName);
            }
            if (!LabelName.ToLower().Equals(name.ToLower()))
            {
                labelBll.CheckLabelXML(name);
            }
            labelMod.LabelName  = name;
            labelMod.LabelType  = DataConverter.CLng(RequestEx["LabelType_Rad"]);
            labelMod.LabelCate  = RequestEx["LabelCate_T"];
            labelMod.Desc       = RequestEx["Desc_T"];
            labelMod.LabelTable = RequestEx["SqlTable_T"];
            string sqlFieldStr = RequestEx["SqlField_T"];

            labelMod.LabelField = string.IsNullOrEmpty(sqlFieldStr) ? "*" : sqlFieldStr;
            labelMod.Param      = RequestEx["Param_Hid"];
            labelMod.LabelWhere = RequestEx["Where_T"];
            labelMod.LabelOrder = RequestEx["Order_T"];
            labelMod.LabelCount = DataConvert.CLng(RequestEx["PSize_T"], 10).ToString();
            //不支持跨数据源联结查询
            //JObject jobj = new JObject();
            //jobj.Add("ds_m", D1); jobj.Add("ds_s", D2); jobj.Add("tb_m", T1); jobj.Add("tb_s", T2);
            labelMod.DataSourceType = RequestEx["ds_hid"];
            //---------------------
            labelMod.Content      = RequestEx["Content_T"];
            labelMod.FalseContent = RequestEx["FalseContent"];
            labelMod.EmptyContent = RequestEx["EmptyContent"];
            //判断模式
            labelMod.IsOpen        = DataConvert.CLng(RequestEx["BoolMode_Chk"]);
            labelMod.setroot       = RequestEx["setroot"];
            labelMod.Valueroot     = RequestEx["Valueroot"];
            labelMod.Modeltypeinfo = RequestEx["Modeltypeinfo"];
            labelMod.Modelvalue    = RequestEx["Modelvalue"];
            if (!string.IsNullOrEmpty(LabelName))
            {
                //如果修改了名称
                if (!labelMod.LabelName.ToLower().Equals(LabelName.ToLower()))
                {
                    labelBll.DelLabelXML(LabelName);
                    labelBll.AddLabelXML(labelMod);
                }
                else
                {
                    labelBll.UpdateLabelXML(labelMod);
                }
            }
            else
            {
                labelMod.LabelNodeID = 0;
                labelBll.AddLabelXML(labelMod);
            }
            retMod.retcode = Success;
            return(Content(retMod.ToString()));
        }