Ejemplo n.º 1
0
        public void GetAll(WebHelper w, Dictionary <string, object> kv)
        {
            sys_t_print_style style = w.GetObject <sys_t_print_style>("style");
            DataTable         tb    = bll.GetAll(style);

            w.Write(tb);
        }
Ejemplo n.º 2
0
        public void Add(sys_t_print_style style)
        {
            var num = Conv.ToInt(d.ExecuteScalar(@"select count(1) +1
            from sys_t_print_style
            where report_id='" + style.report_id + "' and style_data!='_" + style.report_id + "_00'", null));

            style.style_data = style.report_id + "_" + num.ToString("00");

            d.Insert(style);
        }
Ejemplo n.º 3
0
        public void Del(sys_t_print_style style)
        {
            JsonRequest r = new JsonRequest();

            r.Write("style", style);

            r.request("/print?t=Del");

            if (!r.ReadSuccess())
            {
                throw new Exception(r.ReadMessage());
            }
        }
Ejemplo n.º 4
0
        public void Del(sys_t_print_style style)
        {
            string sql         = "select * from sys_t_print_style where style_id='" + style.style_id + "'";
            var    print_style = d.ExecuteToModel <sys_t_print_style>(sql, null);

            if (print_style == null)
            {
                throw new Exception("不存在样式");
            }
            if (print_style.update_time > style.update_time)
            {
                throw new Exception("样式已被修改");
            }

            d.ExecuteScalar("delete from sys_t_print_style where style_id='" + style.style_id + "'", null);
        }
Ejemplo n.º 5
0
        public Dictionary <string, sys_t_print_style> GetStyleDic(sys_t_print_style style)
        {
            JsonRequest r = new JsonRequest();

            r.Write("style", style);

            r.request("/print?t=GetAll");

            if (!r.ReadSuccess())
            {
                throw new Exception(r.ReadMessage());
            }

            Dictionary <string, sys_t_print_style> style_dic = r.GetDicOfTable <string, sys_t_print_style>("style_id");

            return(style_dic);
        }
Ejemplo n.º 6
0
        public DataTable GetAll(sys_t_print_style style)
        {
            JsonRequest r = new JsonRequest();

            r.Write("style", style);

            r.request("/print?t=GetAll");

            if (!r.ReadSuccess())
            {
                throw new Exception(r.ReadMessage());
            }

            DataTable tb = r.GetDataTable();

            return(tb);
        }
Ejemplo n.º 7
0
        public void Update(sys_t_print_style style)
        {
            string sql         = "select * from sys_t_print_style where style_id='" + style.style_id + "'";
            var    print_style = d.ExecuteToModel <sys_t_print_style>(sql, null);

            if (print_style == null)
            {
                throw new Exception("不存在样式");
            }
            if (print_style.update_time > style.update_time)
            {
                throw new Exception("样式已被修改");
            }

            style.update_time = DateTime.Now;
            d.Update(style, "style_id");
        }
Ejemplo n.º 8
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            try
            {
                IBLL.IPrint bll = new BLL.PrintBLL();
                print_style.is_share    = this.cbShare.Checked ? "1" : "0";
                print_style.is_base     = this.cbIsBase.Checked ? "1" : "0";
                print_style.oper_id     = Program.oper.oper_id;
                print_style.style_name  = this.txtStyleName.Text;
                print_style.update_time = DateTime.Now;

                if (string.IsNullOrEmpty(print_style.style_id))
                {
                    print_style.style_id    = Guid.NewGuid().ToString();
                    print_style.create_time = DateTime.Now;
                    bll.Add(print_style);
                }
                else
                {
                    bll.Update(print_style);
                }

                sys_t_print_style style = PrintHelper.myStyle[print_style.style_id];

                global::PrintHelper.BLL.PrintD  p     = new global::PrintHelper.BLL.PrintD();
                global::PrintHelper.IBLL.IPrint print = p;
                p.SaveStyle += new global::PrintHelper.BLL.PrintD.SaveStyleHandler((style1, xml) =>
                {
                    PrintForm.PrintHelper.UpdateStyle(style1, xml);
                });
                print.Print(style.style_data,
                            PrintForm.PrintHelper.GetStyle(style.style_data),
                            PrintHelper.tb_main,
                            PrintHelper.tb_detail);
                this.Close();
            }
            catch (Exception exception)
            {
                MsgForm.ShowFrom(exception);
            }
        }
Ejemplo n.º 9
0
        public DataTable GetAll(sys_t_print_style style)
        {
            string sql = @"select p.*,
case when p.is_base='1' then  '系统'
    else (p.oper_id+'/'+o.oper_name)
end 用户
from sys_t_print_style p
left join sa_t_operator_i o on o.oper_id=p.oper_id
where 1=1 ";

            if (!string.IsNullOrEmpty(style.report_id))
            {
                sql += " and report_id='" + style.report_id + "' ";
            }
            if (!string.IsNullOrEmpty(style.oper_id))
            {
                sql += " and (p.oper_id='" + style.oper_id + "' or p.is_share='1' or p.is_base='1')";
            }

            DataTable tb = d.ExecuteToTable(sql, null);

            return(tb);
        }
Ejemplo n.º 10
0
        public void Del(WebHelper w, Dictionary <string, object> kv)
        {
            sys_t_print_style style = w.GetObject <sys_t_print_style>("style");

            bll.Del(style);
        }