Ejemplo n.º 1
0
        //添加
        private void addinvoice()
        {
            LoginInfo  login   = (EtNet_Models.LoginInfo)Session["login"];
            To_Invoice invoice = new To_Invoice();

            //创建
            invoice.InvoiceCDate       = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            invoice.InvoiceCDepartment = DepartmentInfoManager.getDepartmentInfoById(login.Departid).Departid;
            invoice.InvoiceCMan        = login.Id;
            //发票
            invoice.InvoiceDate = DateTime.Parse(this.txtInvoiceDate.Value.ToString());
            invoice.InvoiceID   = this.txtInvoiceID.Value.ToString();
            invoice.InvoiceUnit = this.txtUnit.Value.ToString();
            invoice.Remark      = this.txtRemark.Text.ToString();
            invoice.Selasmane   = Convert.ToInt32(this.HidSalesman.Value.ToString());
            invoice.Department  = this.txtDepart.Value.ToString();
            invoice.Sum         = float.Parse(this.txtSum.Value);
            invoice.InvoiceType = this.ddlType.SelectedItem.Text.ToString();
            invoice.Upfile      = "";
            int count = To_InvoiceManager.addTo_Invoice(invoice);

            if (count > 0)
            {
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('添加成功!');location.href='../Invoice/InvoiceList.aspx'", true);
                adddetial();
            }
        }
Ejemplo n.º 2
0
        private void addinvoice()
        {
            int id    = Convert.ToInt32(this.txtInvoiceID.Value.ToString());
            int idsum = To_InvoiceManager.getInvoiceById(id);


            if (idsum == 0)
            {
                LoginInfo  login   = (EtNet_Models.LoginInfo)Session["login"];
                To_Invoice invoice = new To_Invoice();
                //创建
                invoice.InvoiceCDate       = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd"));
                invoice.InvoiceCDepartment = DepartmentInfoManager.getDepartmentInfoById(login.Departid).Departid;
                invoice.InvoiceCMan        = login.Id;
                //发票
                invoice.InvoiceDate = DateTime.Parse(this.txtInvoiceDate.Value.ToString());
                invoice.InvoiceID   = this.txtInvoiceID.Value.ToString();
                invoice.InvoiceID   = this.txtInvoiceID.Value.ToString();
                invoice.InvoiceUnit = this.txtUnit.Value.ToString();
                invoice.Remark      = this.txtRemark.Value.ToString();
                invoice.Selasmane   = Convert.ToInt32(this.HidSalesman.Value.ToString());
                invoice.Department  = this.txtDepart.Value.ToString();
                invoice.Sum         = float.Parse(this.txtSum.Value);
                invoice.InvoiceType = this.ddlType.SelectedItem.Text.ToString();
                invoice.Upfile      = "";
                invoice.IsSure      = this.ChkConfirm.Checked ? 1 : 0;

                int count = To_InvoiceManager.addTo_Invoice(invoice);

                if (count > 0)
                {
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('添加成功!');location.href='../Invoice/InvoiceList.aspx'", true);

                    addcombank();
                }
            }
            else
            {
                lblInvoiceID.Text         = "<font color='red'>发票号码已存在!</font>";
                this.policyList.InnerHtml = this.hidTable.Value;
            }
        }