public int Add(IncometInvoiceModel model) { StringBuilder builder = new StringBuilder(); builder.Append("insert into Con_Incomet_Invoice("); builder.Append("InvoiceID,ContractID,InvoiceNo,InvoiceCode,InvoiceType,TaxNo,BankCode,Project,Contact,InvoiceDate,Amount,Transactor,Annex,FlowState,Payer,Payee,InputPerson,InputDate,Notes,OrganizationCode)"); builder.Append(" values ("); builder.Append("@InvoiceID,@ContractID,@InvoiceNo,@InvoiceCode,@InvoiceType,@TaxNo,@BankCode,@Project,@Contact,@InvoiceDate,@Amount,@Transactor,@Annex,@FlowState,@Payer,@Payee,@InputPerson,@InputDate,@Notes,@OrganizationCode)"); SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@InvoiceID", SqlDbType.NVarChar, 0x40), new SqlParameter("@ContractID", SqlDbType.NVarChar, 0x40), new SqlParameter("@InvoiceNo", SqlDbType.NVarChar, 0x40), new SqlParameter("@InvoiceCode", SqlDbType.NVarChar, 0x40), new SqlParameter("@InvoiceType", SqlDbType.NVarChar, 0x40), new SqlParameter("@TaxNo", SqlDbType.NVarChar, 0x40), new SqlParameter("@BankCode", SqlDbType.NVarChar, 500), new SqlParameter("@Project", SqlDbType.NVarChar, 0x40), new SqlParameter("@Contact", SqlDbType.NVarChar, 500), new SqlParameter("@InvoiceDate", SqlDbType.DateTime), new SqlParameter("@Amount", SqlDbType.Decimal, 9), new SqlParameter("@Transactor", SqlDbType.NVarChar, 0x40), new SqlParameter("@Annex", SqlDbType.NVarChar, 0x40), new SqlParameter("@FlowState", SqlDbType.Int, 4), new SqlParameter("@Payer", SqlDbType.NVarChar, 0x40), new SqlParameter("@Payee", SqlDbType.NVarChar, 0x40), new SqlParameter("@InputPerson", SqlDbType.NVarChar, 0x40), new SqlParameter("@InputDate", SqlDbType.DateTime), new SqlParameter("@Notes", SqlDbType.NVarChar), new SqlParameter("@OrganizationCode", SqlDbType.NVarChar, 500) }; commandParameters[0].Value = model.InvoiceID; commandParameters[1].Value = model.ContractID; commandParameters[2].Value = model.InvoiceNo; commandParameters[3].Value = model.InvoiceCode; commandParameters[4].Value = model.InvoiceType; commandParameters[5].Value = model.TaxNo; commandParameters[6].Value = model.BankCode; commandParameters[7].Value = model.Project; commandParameters[8].Value = model.Contact; commandParameters[9].Value = model.InvoiceDate; commandParameters[10].Value = model.Amount; commandParameters[11].Value = model.Transactor; commandParameters[12].Value = model.Annex; commandParameters[13].Value = model.FlowState; commandParameters[14].Value = model.Payer; commandParameters[15].Value = model.Payee; commandParameters[0x10].Value = model.InputPerson; commandParameters[0x11].Value = model.InputDate; commandParameters[0x12].Value = model.Notes; commandParameters[0x13].Value = model.OrganizationCode; return(SqlHelper.ExecuteNonQuery(CommandType.Text, builder.ToString(), commandParameters)); }
public void InitPage() { this.BindDdl(); IncometContractModel model = this.incometContractBll.GetModel(base.Request.QueryString["ContractID"]); if (base.Request.QueryString["id"] != null) { this.lblTitle.Text = "编辑发票"; IncometInvoiceModel model2 = this.incometInvoiceBll.GetModel(base.Request.QueryString["id"]); this.txtAmount.Text = model2.Amount.ToString(); this.txtInputDate.Text = Common2.GetTime(model2.InputDate.ToString()); this.txtInputPerson.Text = model2.InputPerson; this.txtInvoiceDate.Text = Common2.GetTime(model2.InvoiceDate.ToString()); this.txtNotes.Text = model2.Notes; this.txtTransactor.Text = model2.Transactor; this.hdGuid.Value = model2.InvoiceID; this.txtInvoiceNo.Text = model2.InvoiceNo; this.hdChangeCode.Value = model2.InvoiceNo; this.txtInvoiceCode.Text = model2.InvoiceCode; this.txtParty.Text = model2.Payer; this.txtSecond.Text = model2.Payee; this.ddlInvoiceType.SelectedValue = model2.InvoiceType; this.txtTaxNo.Text = model2.TaxNo; this.txtContact.Text = model2.Contact; this.txtBankCode.Text = model2.BankCode; this.txtOrganizationCode.Text = model2.OrganizationCode; } else { this.lblTitle.Text = "开票登记"; this.txtInputDate.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); this.txtInputPerson.Text = PageHelper.QueryUser(this, base.UserCode); this.hdGuid.Value = Guid.NewGuid().ToString(); this.txtSecond.Text = model.Second; BasicContactCorpModel basicModel = this.GetBasicModel(this.txtSecond.Text.Trim()); if (basicModel != null) { this.txtTaxNo.Text = basicModel.TaxCard; this.txtContact.Text = basicModel.Address + basicModel.Telephone; this.txtBankCode.Text = basicModel.AccountBank + basicModel.BankAccounts; } if (model.Party != null) { this.txtParty.Text = model.Party.CorpName; } } this.txtPrjCode.Text = model.Project.PrjCode; this.txtPrjName.Text = model.Project.PrjName; this.txtContractCode.Text = model.ContractCode; this.txtContractName.Text = model.ContractName; this.txtContractPrice.Text = WebUtil.GetEnPrice(model.ContractPrice.ToString(), model.ContractID); this.txtSignedTime.Text = Common2.GetTime(model.SignedTime.ToString()); this.txtPaymentSum.Text = WebUtil.GetPaymentSum(model.ContractID, "Con_Incomet_Payment", "CllectionPrice"); this.txtInvoiceSum.Text = WebUtil.GetPaymentSum(model.ContractID, "Con_Incomet_Invoice", "Amount"); this.txtBalance.Text = string.Concat(Convert.ToDecimal(this.txtPaymentSum.Text) - Convert.ToDecimal(this.txtInvoiceSum.Text)); this.FileLink1.MID = 1912; this.FileLink1.FID = this.hdGuid.Value; this.FileLink1.Type = 1; }
public int Update(IncometInvoiceModel model) { StringBuilder builder = new StringBuilder(); builder.Append("update Con_Incomet_Invoice set "); builder.Append("ContractID=@ContractID,"); builder.Append("InvoiceNo=@InvoiceNo,"); builder.Append("InvoiceCode=@InvoiceCode,"); builder.Append("InvoiceType=@InvoiceType,"); builder.Append("TaxNo=@TaxNo,"); builder.Append("BankCode=@BankCode,"); builder.Append("Project=@Project,"); builder.Append("Contact=@Contact,"); builder.Append("InvoiceDate=@InvoiceDate,"); builder.Append("Amount=@Amount,"); builder.Append("Transactor=@Transactor,"); builder.Append("Annex=@Annex,"); builder.Append("FlowState=@FlowState,"); builder.Append("Payer=@Payer,"); builder.Append("Payee=@Payee,"); builder.Append("InputPerson=@InputPerson,"); builder.Append("InputDate=@InputDate,"); builder.Append("Notes=@Notes,"); builder.Append("OrganizationCode=@OrganizationCode"); builder.Append(" where InvoiceID=@InvoiceID "); SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@InvoiceID", SqlDbType.NVarChar, 0x40), new SqlParameter("@ContractID", SqlDbType.NVarChar, 0x40), new SqlParameter("@InvoiceNo", SqlDbType.NVarChar, 0x40), new SqlParameter("@InvoiceCode", SqlDbType.NVarChar, 0x40), new SqlParameter("@InvoiceType", SqlDbType.NVarChar, 0x40), new SqlParameter("@TaxNo", SqlDbType.NVarChar, 0x40), new SqlParameter("@BankCode", SqlDbType.NVarChar, 500), new SqlParameter("@Project", SqlDbType.NVarChar, 0x40), new SqlParameter("@Contact", SqlDbType.NVarChar, 500), new SqlParameter("@InvoiceDate", SqlDbType.DateTime), new SqlParameter("@Amount", SqlDbType.Decimal, 9), new SqlParameter("@Transactor", SqlDbType.NVarChar, 0x40), new SqlParameter("@Annex", SqlDbType.NVarChar, 0x40), new SqlParameter("@FlowState", SqlDbType.Int, 4), new SqlParameter("@Payer", SqlDbType.NVarChar, 0x40), new SqlParameter("@Payee", SqlDbType.NVarChar, 0x40), new SqlParameter("@InputPerson", SqlDbType.NVarChar, 0x40), new SqlParameter("@InputDate", SqlDbType.DateTime), new SqlParameter("@Notes", SqlDbType.NVarChar), new SqlParameter("@OrganizationCode", SqlDbType.NVarChar, 500) }; commandParameters[0].Value = model.InvoiceID; commandParameters[1].Value = model.ContractID; commandParameters[2].Value = model.InvoiceNo; commandParameters[3].Value = model.InvoiceCode; commandParameters[4].Value = model.InvoiceType; commandParameters[5].Value = model.TaxNo; commandParameters[6].Value = model.BankCode; commandParameters[7].Value = model.Project; commandParameters[8].Value = model.Contact; commandParameters[9].Value = model.InvoiceDate; commandParameters[10].Value = model.Amount; commandParameters[11].Value = model.Transactor; commandParameters[12].Value = model.Annex; commandParameters[13].Value = model.FlowState; commandParameters[14].Value = model.Payer; commandParameters[15].Value = model.Payee; commandParameters[0x10].Value = model.InputPerson; commandParameters[0x11].Value = model.InputDate; commandParameters[0x12].Value = model.Notes; commandParameters[0x13].Value = model.OrganizationCode; return(SqlHelper.ExecuteNonQuery(CommandType.Text, builder.ToString(), commandParameters)); }
public IncometInvoiceModel GetModel(string InvoiceID) { StringBuilder builder = new StringBuilder(); builder.Append("select InvoiceID,ContractID,InvoiceNo,InvoiceCode,InvoiceType,TaxNo,BankCode,Project,Contact,InvoiceDate,Amount,Transactor,Annex,FlowState,Payer,Payee,InputPerson,InputDate,Notes,OrganizationCode from Con_Incomet_Invoice "); builder.Append(" where InvoiceID=@InvoiceID "); IncometInvoiceModel model = null; using (IDataReader reader = SqlHelper.ExecuteReader(CommandType.Text, builder.ToString(), new SqlParameter[] { new SqlParameter("@InvoiceID", InvoiceID) })) { if (reader.Read()) { model = this.ReaderBind(reader); } } return(model); }
public IncometInvoiceModel ReaderBind(IDataReader dataReader) { IncometInvoiceModel model = new IncometInvoiceModel { InvoiceID = dataReader["InvoiceID"].ToString(), ContractID = dataReader["ContractID"].ToString(), InvoiceNo = dataReader["InvoiceNo"].ToString(), InvoiceCode = dataReader["InvoiceCode"].ToString(), InvoiceType = dataReader["InvoiceType"].ToString(), TaxNo = dataReader["TaxNo"].ToString(), BankCode = dataReader["BankCode"].ToString(), Project = dataReader["Project"].ToString(), Contact = dataReader["Contact"].ToString() }; object obj2 = dataReader["InvoiceDate"]; if ((obj2 != null) && (obj2 != DBNull.Value)) { model.InvoiceDate = new DateTime?((DateTime)obj2); } obj2 = dataReader["Amount"]; if ((obj2 != null) && (obj2 != DBNull.Value)) { model.Amount = new decimal?((decimal)obj2); } model.Transactor = dataReader["Transactor"].ToString(); model.Annex = dataReader["Annex"].ToString(); obj2 = dataReader["FlowState"]; if ((obj2 != null) && (obj2 != DBNull.Value)) { model.FlowState = new int?((int)obj2); } model.Payer = dataReader["Payer"].ToString(); model.Payee = dataReader["Payee"].ToString(); model.InputPerson = dataReader["InputPerson"].ToString(); obj2 = dataReader["InputDate"]; if ((obj2 != null) && (obj2 != DBNull.Value)) { model.InputDate = new DateTime?((DateTime)obj2); } model.Notes = dataReader["Notes"].ToString(); model.OrganizationCode = dataReader["OrganizationCode"].ToString(); return(model); }
protected void InitPage() { IncometContractModel model = this.incometContractBll.GetModel(base.Request.QueryString["ContractID"]); if (model != null) { this.lblPrjCode.Text = model.Project.PrjCode; this.lblPrjName.Text = model.Project.PrjName; this.lblContractCode.Text = model.ContractCode; this.lblContractName.Text = model.ContractName; this.lblContractMoney.Text = WebUtil.GetEnPrice(model.ContractPrice.ToString(), model.ContractID); this.lblSignedDate.Text = Common2.GetTime(model.SignedTime.ToString()); this.lblPaymentSum.Text = WebUtil.GetPaymentSum(model.ContractID, "Con_Incomet_Payment", "CllectionPrice"); this.lblInvoiceSum.Text = WebUtil.GetPaymentSum(model.ContractID, "Con_Incomet_Invoice", "Amount"); this.lblBalance.Text = string.Concat(Convert.ToDecimal(this.lblPaymentSum.Text) - Convert.ToDecimal(this.lblInvoiceSum.Text)); } IncometInvoiceModel model2 = this.incometInvoiceBll.GetModel(base.Request.QueryString["id"]); if (model2 != null) { this.lblAmountMoney.Text = model2.Amount.ToString(); this.lblInputTime.Text = Common2.GetTime(model2.InputDate.ToString()); this.lblInputUser.Text = model2.InputPerson; this.lblInvoiceDate.Text = Common2.GetTime(model2.InvoiceDate.ToString()); this.lblNote.Text = model2.Notes; this.lblTransactor.Text = model2.Transactor; this.lblInvoiceNo.Text = model2.InvoiceNo; this.lblInvoiceCode.Text = model2.InvoiceCode; this.lblParty.Text = model2.Payer; this.lblSecond.Text = model2.Payee; this.lblInvoiceType.Text = this.GetInvoiceType(model2.InvoiceType); this.lblTaxNo.Text = model2.TaxNo; this.lblAddress.Text = model2.Contact; this.lblBankCode.Text = model2.BankCode; this.lblOrganizationCode.Text = model2.OrganizationCode; this.lblUpFiled.Text = FileView.FilesBind(1912, model2.InvoiceID); } }
public int Update(IncometInvoiceModel model) { return(this.incometInvoice.Update(model)); }
public int Add(IncometInvoiceModel model) { return(this.incometInvoice.Add(model)); }