Ejemplo n.º 1
0
        private void save()
        {
            QuoteTemplateBLL qtbll = new QuoteTemplateBLL();
            var sqt = qtbll.GetQuoteTemplate(id);

            if (sqt == null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('获取数据错误!');history.go(-1);</script>");
            }
            tempinfo = Session["tempinfo"] as InvioceTempDto.TempContent;
            if (tempinfo != null && tempinfo.id == id)
            {
                sqt.page_header_html  = tempinfo.head;   //页眉
                sqt.quote_header_html = tempinfo.top;    //头部
                sqt.body_html         = tempinfo.body;   //主体
                sqt.quote_footer_html = tempinfo.bottom; //底部
                sqt.page_footer_html  = tempinfo.foot;   //页脚
                //bottom税相关
                sqt.show_tax_cate = (SByte)tempinfo.tax_cat;
                sqt.show_each_tax_in_tax_group = (SByte)tempinfo.tax_group;
                sqt.show_tax_cate_superscript  = (SByte)tempinfo.tax_sup;
                //body分组
                sqt.body_group_by_id         = tempinfo.body_group_by;
                sqt.body_itemize_id          = tempinfo.body_itemize_id;
                sqt.body_order_by_id         = tempinfo.body_order_by;
                sqt.show_labels_when_grouped = (SByte)tempinfo.show_labels_when_grouped;
                //bottom 合计
                sqt.tax_total_disp = tempinfo.Invoice_text;
                //底部备注
                sqt.quote_footer_notes = tempinfo.foot_note;
            }
            //更新保存
            var result = qtbll.update(sqt, GetLoginUserId());

            if (result == ERROR_CODE.SUCCESS)                           // 更新用户成功,刷新前一个页面
            {
                Response.Write("<script>alert('发票模板修改成功!');</script>"); //关闭添加页面的同时,刷新父页面
            }
            else if (result == ERROR_CODE.USER_NOT_FIND)                // 用户丢失
            {
                Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
                Response.Redirect("Login.aspx");
            }
        }
Ejemplo n.º 2
0
        protected void AddQuoteTemplate(object sender, EventArgs e)
        {
            //this.DateFormat.
            sys_quote_tmpl sqt = new sys_quote_tmpl();

            sqt.name = this.Name.Text.Trim().ToString();
            if (this.Active.Checked)
            {
                sqt.is_active = 1;
            }
            else
            {
                sqt.is_active = 0;
            }
            sqt.description                 = this.Description.Text.Trim().ToString();
            sqt.paper_size_id               = paper_size_id();
            sqt.page_number_location_id     = page_number_location_id();
            sqt.create_user_id              = LoginUserId;
            sqt.currency_negative_format_id = Convert.ToInt32(this.CurrencyNegativePattern.SelectedValue.Trim().ToString());
            sqt.currency_positive_format_id = Convert.ToInt32(this.CurrencyPositivePattern.SelectedValue.Trim().ToString());
            sqt.number_display_format_id    = Convert.ToInt32(this.NumberFormat.SelectedValue.Trim().ToString());
            sqt.date_display_format_id      = Convert.ToInt32(this.DateFormat.SelectedValue.Trim().ToString());
            sqt.cate_id = 1;
            if (this.show_each_tax_in_tax_group.Checked)
            {
                sqt.show_each_tax_in_tax_group = 1;
            }
            else
            {
                sqt.show_each_tax_in_tax_group = 0;
            }
            if (this.show_each_tax_in_tax_period.Checked)
            {
                sqt.show_each_tax_in_tax_period = 1;
            }
            else
            {
                sqt.show_each_tax_in_tax_period = 0;
            }
            if (this.show_tax_cate.Checked)
            {
                sqt.show_tax_cate = 1;
            }
            else
            {
                sqt.show_tax_cate = 0;
            }
            if (this.show_tax_cate_superscript.Checked)
            {
                sqt.show_tax_cate_superscript = 1;
            }
            else
            {
                sqt.show_tax_cate_superscript = 0;
            }

            sqt.tax_total_disp = tax_total_disp();
            // sqt.create_time = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now);

            QuoteTemplateBLL qtbll = new QuoteTemplateBLL();

            if (string.IsNullOrEmpty(sqt.name))
            {
                ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('模板名称未填写!');</script>");
            }
            if (id > 0)
            {
                var result = qtbll.update(sqt, GetLoginUserId());
                if (result == ERROR_CODE.SUCCESS)
                {
                    Response.Write("<script>alert('报价模板属性修改成功');window.close();self.opener.location.reload();</script>");
                }
                else if (result == ERROR_CODE.USER_NOT_FIND)               // 用户丢失
                {
                    Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
                    Response.Redirect("Login.aspx");
                }
                else
                {
                    Response.Write("<script>alert('报价模板属性修改成功');</script>");
                }
            }
            else
            {
                int id1;
                var result = qtbll.Add(sqt, GetLoginUserId(), out id1);
                if (result == ERROR_CODE.SUCCESS)                                                                        // 插入用户成功,刷新前一个页面
                {
                    Response.Write("<script>alert('报价模板添加成功!');window.close();self.opener.location.reload();</script>"); //  关闭添加页面的同时,刷新父页面
                }
                else if (result == ERROR_CODE.USER_NOT_FIND)                                                             // 用户丢失
                {
                    Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
                    Response.Redirect("Login.aspx");
                }
            }
        }
Ejemplo n.º 3
0
        private void save()
        {
            QuoteTemplateBLL qtbll = new QuoteTemplateBLL();
            var sqt = qtbll.GetQuoteTemplate(id);

            if (sqt == null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('获取数据错误!');history.go(-1);</script>");
            }
            //sys_quote_tmpl sqt = new sys_quote_tmpl();
            if (Session["page_head"] != null)
            {
                sqt.page_header_html = Session["page_head"].ToString();
            }
            if (Session["quote_head"] != null)
            {
                sqt.quote_header_html = Session["quote_head"].ToString();
            }
            if (Session["quote_body"] != null)
            {
                sqt.body_html = Session["quote_body"].ToString();
            }
            if (Session["quote_foot"] != null)
            {
                sqt.quote_footer_html = Session["quote_foot"].ToString();
            }
            if (Session["page_foot"] != null)
            {
                sqt.page_footer_html = Session["page_foot"].ToString();
            }
            if (Session["page_appendix"] != null)
            {
                sqt.quote_footer_notes = Session["page_appendix"].ToString();
            }

            //if (Session["copy"] != null)
            //{
            //    string name = Session["copy"].ToString();
            //    Session.Remove("copy");
            //    //保存副本
            //    //sqt.id = (int)(_dal.GetNextIdCom());
            //    sqt.is_system = 0;
            //    sqt.is_default = 0;
            //    sqt.name = name+sqt.name+Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now);
            //    var result = qtbll.Add(sqt, GetLoginUserId(), out id);
            //    if (result == ERROR_CODE.SUCCESS)                    //
            //    {
            //        //id  获取副本插入时的id
            //        Response.Write("<script>alert('报价模板副本成功添加成功!');</script>");  //  刷新页面
            //    }
            //    else if (result == ERROR_CODE.USER_NOT_FIND)               // 用户丢失
            //    {
            //        Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
            //        Response.Redirect("Login.aspx");
            //    }
            //}
            //else
            //{
            //更新保存
            var result = qtbll.update(sqt, GetLoginUserId());

            if (result == ERROR_CODE.SUCCESS)                           // 更新用户成功,刷新前一个页面
            {
                Response.Write("<script>alert('报价模板修改成功!');</script>"); //  关闭添加页面的同时,刷新父页面
            }
            else if (result == ERROR_CODE.USER_NOT_FIND)                // 用户丢失
            {
                Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
                Response.Redirect("Login.aspx");
            }
            //}
        }
Ejemplo n.º 4
0
        protected void Save_Close_Click(object sender, EventArgs e)
        {
            sys_quote_tmpl data = new sys_quote_tmpl();

            if (id > 0)
            {
                data = temp.GetQuoteTemplate(id);
            }
            data.name = this.Name.Text.Trim().ToString();
            if (this.Active.Checked)
            {
                data.is_active = 1;
            }
            else
            {
                data.is_active = 0;
            }
            data.description                 = this.Description.Text.Trim().ToString();
            data.paper_size_id               = paper_size_id();
            data.page_number_location_id     = page_number_location_id();
            data.currency_negative_format_id = Convert.ToInt32(this.CurrencyNegativePattern.SelectedValue.Trim().ToString());
            data.currency_positive_format_id = Convert.ToInt32(this.CurrencyPositivePattern.SelectedValue.Trim().ToString());
            data.number_display_format_id    = Convert.ToInt32(this.NumberFormat.SelectedValue.Trim().ToString());
            data.date_display_format_id      = Convert.ToInt32(this.DateFormat.SelectedValue.Trim().ToString());
            data.payment_term_id             = Convert.ToInt32(this.Payment_terms.SelectedValue.Trim().ToString());
            data.show_each_tax_in_tax_group  = 1;
            data.show_tax_cate_superscript   = 1;
            data.show_tax_cate               = 1;
            data.show_each_tax_in_tax_period = 0;
            data.cate_id = 2;
            if (id > 0)
            {
                var result = temp.update(data, GetLoginUserId());
                if (result == ERROR_CODE.SUCCESS)
                {
                    Response.Write("<script>alert('发票模板属性修改成功');window.close();self.opener.location.reload();</script>");
                }
                else if (result == ERROR_CODE.USER_NOT_FIND)               // 用户丢失
                {
                    Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
                    Response.Redirect("Login.aspx");
                }
                else
                {
                    Response.Write("<script>alert('发票模板属性修改失败!');</script>");
                }
            }
            else
            {
                var result = temp.Add(data, GetLoginUserId(), out id);
                if (result == ERROR_CODE.SUCCESS)                                                                        // 插入用户成功,刷新前一个页面
                {
                    Response.Write("<script>alert('发票模板添加成功!');window.close();self.opener.location.reload();</script>"); //  关闭添加页面的同时,刷新父页面
                }
                else if (result == ERROR_CODE.USER_NOT_FIND)                                                             // 用户丢失
                {
                    Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
                    Response.Redirect("Login.aspx");
                }
            }
        }
Ejemplo n.º 5
0
        protected void UPdateQuoteTemplate(object sender, EventArgs e)
        {
            data.name = this.Name.Text.Trim().ToString();
            if (this.Active.Checked)
            {
                data.is_active = 1;
            }
            else
            {
                data.is_active = 0;
            }
            data.description                 = this.Description.Text.Trim().ToString();
            data.paper_size_id               = paper_size_id();
            data.page_number_location_id     = page_number_location_id();
            data.currency_negative_format_id = Convert.ToInt32(this.CurrencyNegativePattern.SelectedValue.Trim().ToString());
            data.currency_positive_format_id = Convert.ToInt32(this.CurrencyPositivePattern.SelectedValue.Trim().ToString());
            data.number_display_format_id    = Convert.ToInt32(this.NumberFormat.SelectedValue.Trim().ToString());
            data.date_display_format_id      = Convert.ToInt32(this.DateFormat.SelectedValue.Trim().ToString());
            data.show_each_tax_in_tax_group  = 1;
            data.show_tax_cate_superscript   = 1;
            data.show_tax_cate               = 1;
            data.show_each_tax_in_tax_period = 0;
            if (this.show_each_tax_in_tax_group.Checked)
            {
                data.show_each_tax_in_tax_group = 1;
            }
            if (this.show_each_tax_in_tax_period.Checked)
            {
                data.show_each_tax_in_tax_period = 1;
            }
            if (this.show_tax_cate.Checked)
            {
                data.show_tax_cate = 1;
            }
            if (this.show_tax_cate_superscript.Checked)
            {
                data.show_tax_cate_superscript = 1;
            }

            data.tax_total_disp = tax_total_disp();
            if (string.IsNullOrEmpty(data.name))
            {
                ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('模板名称未填写!');</script>");
            }


            //qtbll.log(user);

            var result = qtb.update(data, GetLoginUserId());

            if (result == ERROR_CODE.SUCCESS)                    // 插入用户成功,刷新前一个页面
            {
                //Response.Write("<script>alert('报价模板属性修改成功'); window.location.href = 'QuoteTemplateEdit.aspx?id ="+id+"&op= edit';</script>");
                //  关闭添加页面的同时,刷新父页面
                Response.Redirect("QuoteTemplateEdit.aspx?id=" + id + "&op=edit");
            }
            else if (result == ERROR_CODE.USER_NOT_FIND)               // 用户丢失
            {
                Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
                Response.Redirect("Login.aspx");
            }
            else
            {
                Response.Write("<script>alert('报价模板属性修改成功');</script>");
            }
        }