private void UpdatePawnTicket() { DDPawnTicket oldTicket = new DDPawnTicket("TicketID", m_OldTicketID); oldTicket.IsLast = 0; DDPawnTicket newTicket = new DDPawnTicket(); newTicket.CustomerID = oldTicket.CustomerID; newTicket.StatusID = 3; newTicket.OldTicketID = oldTicket.TicketID; newTicket.TicketNumber = this.tbxTicketNumber.Text; newTicket.OldTicketNumber = this.lblOldTicketNum.Text; newTicket.TotalAmount = this.tbxTotalAmount.Text; newTicket.ServiceFee = this.tbxServiceFee.Text; newTicket.InterestFee = this.tbxInterestFee.Text; newTicket.OverdueFee = oldTicket.OverdueFee; newTicket.ReturnFee = oldTicket.ReturnFee; newTicket.StartDate = this.tbxStartDate.Text; newTicket.EndDate = this.tbxEndDate.Text; newTicket.OperateDate = this.tbxStartDate.Text; newTicket.OperaterName = MainForm.AccountName; newTicket.IsLast = 1; try { oldTicket.Save(); newTicket.Save(); UpdatePawages(newTicket.TicketID); MessageBox.Show(this, "续当成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch { MessageBox.Show(this, "数据更新失败,请检查数据库是否连接正确!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void UpdateTicketStatus() { DDPawnTicket newTicket = new DDPawnTicket("TicketID", m_TicketID); newTicket.StatusID = 7; newTicket.Save(); }
private void UpdateTicketStatus(int iTicketID) { DDPawnTicket newTicket = new DDPawnTicket("TicketID", iTicketID); newTicket.StatusID = 2; newTicket.Save(); }
private void UpdateCloseOperation() { DataGridViewRow dgr = dataGridView1.CurrentRow; int intStatusID = Convert.ToInt32(dgr.Cells["StatusID"].Value); if (intStatusID == 1 || intStatusID == 3) { int iTicketID = Convert.ToInt32(dgr.Cells["TicketID"].Value); DDPawnTicket newTicket = new DDPawnTicket("TicketID", iTicketID); Query queryOperations = new Query(DDOperation.Schema); queryOperations.AddWhere("TicketID", iTicketID); queryOperations.AddWhere("NextOperationID", 0); DataTable dtOperations = queryOperations.ExecuteDataSet().Tables[0]; if (dtOperations.Rows.Count > 0) { newTicket.StatusID = 4; newTicket.Save(); DateTime operateDate = DateTime.Now; string strDate = operateDate.Year.ToString() + "-" + operateDate.Month.ToString() + "-" + operateDate.Day.ToString(); int preOperationID = 0; for (int i = 0; i < dtOperations.Rows.Count; i++) { DDOperation newOperation = new DDOperation(); preOperationID = Convert.ToInt32(dtOperations.Rows[i]["OperationID"]); newOperation.TicketID = iTicketID; newOperation.PawnageID = Convert.ToInt32(dtOperations.Rows[i]["PawnageID"]); newOperation.OperationType = 4; //4 :绝当 newOperation.OperationNumber = m_OperationNumber; newOperation.ServiceFee = "0"; newOperation.InterestFee = "0"; newOperation.ReturnFee = "0"; newOperation.OverdueFee = "0"; newOperation.Amount = dtOperations.Rows[i]["Amount"].ToString(); newOperation.ReckonAmount = "0"; newOperation.OperationDate = strDate; newOperation.OperaterName = MainForm.AccountName; newOperation.PreOperationID = preOperationID; newOperation.NextOperationID = 0; newOperation.Save(); DDOperation oldOperation = new DDOperation("OperationID", preOperationID); oldOperation.NextOperationID = newOperation.OperationID; oldOperation.Save(); } InitGridSource(); dataGridView1.DataSource = m_GridTable; MessageBox.Show("绝当处理成功!", "绝当"); } } else { MessageBox.Show("该当票不能进行绝当操作!", "绝当"); } }
private void UpdateOperation() { try { if (dataGridView1.Rows.Count > 0) { DateTime operateDate = DateTime.Now; string strDate = operateDate.Year.ToString() + "-" + operateDate.Month.ToString() + "-" + operateDate.Day.ToString(); int iPawnageID = 0; int preOperationID = 0; for (int i = dataGridView1.Rows.Count - 1; i > -1; i--) { DataGridViewRow dgr = dataGridView1.Rows[i]; iPawnageID = Convert.ToInt32(dgr.Cells["PawnageID"].Value); preOperationID = Convert.ToInt32(dgr.Cells["OperationID"].Value); DDOperation newOperation = new DDOperation(); newOperation.TicketID = m_TicketID; newOperation.PawnageID = iPawnageID; newOperation.OperationType = 7; //7:清算 newOperation.OperationNumber = m_OperationNumber; newOperation.ServiceFee = "0"; newOperation.InterestFee = "0"; newOperation.ReturnFee = "0"; newOperation.OverdueFee = "0"; newOperation.Amount = dgr.Cells["Amount"].Value.ToString(); newOperation.ReckonAmount = dgr.Cells["ReckonAmount"].Value.ToString(); newOperation.OperationDate = strDate; newOperation.OperaterName = MainForm.AccountName; newOperation.PreOperationID = preOperationID; newOperation.NextOperationID = 0; newOperation.Deleted = 0; newOperation.Save(); DDOperation oldOperation = new DDOperation("OperationID", preOperationID); oldOperation.NextOperationID = newOperation.OperationID; oldOperation.Save(); DDPawnageInfo newInfo = new DDPawnageInfo("PawnageID", iPawnageID); newInfo.StatusID = 7; newInfo.Save(); } DDPawnTicket newTicket = new DDPawnTicket("TicketID", m_TicketID); newTicket.StatusID = 7; //7:清算 newTicket.Save(); } } catch (Exception ex) { throw ex; } }
public void Insert(int?CustomerID, string TicketNumber, string StartDate, string EndDate, int?StatusID) { DDPawnTicket item = new DDPawnTicket(); item.CustomerID = CustomerID; item.TicketNumber = TicketNumber; item.StartDate = StartDate; item.EndDate = EndDate; item.StatusID = StatusID; item.Save(UserName); }
public void Update(int TicketID, int?CustomerID, string TicketNumber, string StartDate, string EndDate, int?StatusID) { DDPawnTicket item = new DDPawnTicket(); item.MarkOld(); item.IsLoaded = true; item.TicketID = TicketID; item.CustomerID = CustomerID; item.TicketNumber = TicketNumber; item.StartDate = StartDate; item.EndDate = EndDate; item.StatusID = StatusID; item.Save(UserName); }
private void UpdatePawnTicket() { int intCustomerID = UpdateCustomerInfo(); DDPawnTicket newTicket = new DDPawnTicket(); newTicket.CompanyID = 1; newTicket.CustomerID = intCustomerID; newTicket.StatusID = 1; newTicket.TicketNumber = this.tbxTicketNumber.Text; newTicket.StartDate = this.tbxStartDate.Text; newTicket.EndDate = this.tbxEndDate.Text; newTicket.OperateDate = this.tbxOperateDate.Text; //newTicket.OperatorID = 1111; try { newTicket.Save(); UpdatePawages(newTicket.TicketID); } catch { MessageBox.Show("当票信息更新失败,请检查数据库连接状态!"); } }
private void UpdateOperation() { try { DataGridViewRow dgr = dataGridView1.CurrentRow; int intStatusID = Convert.ToInt32(dgr.Cells["StatusID"].Value); if (intStatusID == 1 || intStatusID == 3) { int iTicketID = Convert.ToInt32(dgr.Cells["TicketID"].Value); DDPawnTicket newTicket = new DDPawnTicket("TicketID", iTicketID); Query queryOperations = new Query(DDOperation.Schema); queryOperations.AddWhere("TicketID", iTicketID); queryOperations.AddWhere("NextOperationID", 0); queryOperations.AddWhere("OperationType", Comparison.NotEquals, 6); DataTable dtOperations = queryOperations.ExecuteDataSet().Tables[0]; if (dtOperations.Rows.Count > 0) { newTicket.StatusID = 4; newTicket.Save(); int preOperationID = 0; for (int i = 0; i < dtOperations.Rows.Count; i++) { DDOperation newOperation = new DDOperation(); preOperationID = Convert.ToInt32(dtOperations.Rows[i]["OperationID"]); newOperation.TicketID = iTicketID; newOperation.PawnageID = Convert.ToInt32(dtOperations.Rows[i]["PawnageID"]); newOperation.OperationType = 4; //4 :绝当 newOperation.OperationNumber = m_OperationNumber; newOperation.ServiceFee = "0"; newOperation.InterestFee = "0"; newOperation.ReturnFee = "0"; newOperation.OverdueFee = "0"; newOperation.Amount = dtOperations.Rows[i]["Amount"].ToString(); newOperation.ReckonAmount = "0"; newOperation.OperationDate = dgr.Cells["OperationDate"].Value.ToString(); newOperation.OperaterName = MainForm.AccountName; newOperation.PreOperationID = preOperationID; newOperation.NextOperationID = 0; newOperation.Deleted = 0; newOperation.Save(); DDOperation oldOperation = new DDOperation("OperationID", preOperationID); oldOperation.NextOperationID = newOperation.OperationID; oldOperation.Save(); //更新当品信息与当票信息 DDPawnageInfo newPawn = new DDPawnageInfo("PawnageID", dtOperations.Rows[i]["PawnageID"]); newPawn.StatusID = 4; //绝当 newPawn.Save(); } InitGridSource(); dataGridView1.DataSource = m_GridTable; MessageBox.Show("绝当处理成功!", "绝当"); } } else { MessageBox.Show("该当票不能进行绝当操作!", "绝当"); } } catch (Exception ex) { throw ex; } }
private void UpdateOperation() { try { if (dataGridView1.Rows.Count > 0) { DDPawnTicket newTicket = new DDPawnTicket("TicketID", m_TicketID); newTicket.StatusID = 3; //3:续当 newTicket.EndDate = this.tbxEndDate.Text; newTicket.Save(); int iPawnageID = 0; int preOperationID = 0; for (int i = dataGridView1.Rows.Count - 1; i > -1; i--) { DataGridViewRow dgr = dataGridView1.Rows[i]; iPawnageID = Convert.ToInt32(dgr.Cells["PawnageID"].Value); DDPawnageInfo newInfo = new DDPawnageInfo("PawnageID", iPawnageID); preOperationID = Convert.ToInt32(dgr.Cells["OperationID"].Value); DDOperation newOperation = new DDOperation(); newOperation.TicketID = m_TicketID; newOperation.PawnageID = iPawnageID; newOperation.OperationType = 3; //3 :续当 newOperation.OperationNumber = m_OperationNumber; newOperation.ServiceFee = dataGridView1.Rows[i].Cells["ServiceFee"].Value.ToString(); newOperation.InterestFee = dataGridView1.Rows[i].Cells["InterestFee"].Value.ToString(); newOperation.ReturnFee = "0"; newOperation.OverdueFee = "0"; newOperation.Amount = dgr.Cells["Amount"].Value.ToString(); newOperation.ReckonAmount = "0"; newOperation.OperationDate = this.tbxOperationDate.Text; newOperation.StartDate = this.tbxStartDate.Text; newOperation.EndDate = this.tbxEndDate.Text; DDUser newOperater = new DDUser("AccountName", MainForm.AccountName); newOperation.OperaterName = newOperater.UserName; newOperation.PreOperationID = preOperationID; newOperation.ServiceFeeRate = dgr.Cells["FeeRate"].Value.ToString(); newOperation.InterestFeeRate = dgr.Cells["InterestRate"].Value.ToString(); newOperation.NextOperationID = 0; newOperation.Deleted = 0; newOperation.Save(); DDOperation oldOperation = new DDOperation("OperationID", preOperationID); oldOperation.NextOperationID = newOperation.OperationID; oldOperation.Save(); newInfo.FeeRate = dgr.Cells["FeeRate"].Value.ToString(); newInfo.InterestRate = dgr.Cells["InterestRate"].Value.ToString(); newInfo.EndDate = this.tbxEndDate.Text; newInfo.StatusID = 3; //续当 newInfo.Save(); } } } catch (Exception ex) { throw ex; } }
private void DeleteOperation() { DataGridViewRow dgr = dataGridView1.CurrentRow; int intTicketID = Convert.ToInt32(dgr.Cells["TicketID"].Value); DDPawnTicket newTicket = new DDPawnTicket("TicketID", intTicketID); Query query = new Query(DDOperation.Schema); query.AddWhere("TicketID", intTicketID); query.AddWhere("NextOperationID", 0); DataTable dt = query.ExecuteDataSet().Tables[0]; if (dt.Rows.Count > 0) { DateTime operateDate = DateTime.Now; string strDate = operateDate.Year.ToString() + "-" + operateDate.Month.ToString() + "-" + operateDate.Day.ToString(); //DDOperation newOperation = new DDOperation(); //newOperation.TicketID = operation.TicketID; //newOperation.PawnageID = operation.PawnageID; //newOperation.OperationType = 6; //newOperation.OperationNumber = operation.OperationNumber; //newOperation.OperationDate = strDate; //newOperation.OperaterName = MainForm.AccountName; //newOperation.PreOperationID = operation.OperationID; //newOperation.NextOperationID = 0; //newOperation.Save(); for (int i = 0; i < dt.Rows.Count; i++) { DDPawnageInfo newInfo = new DDPawnageInfo("PawnageID", Convert.ToInt32(dt.Rows[i]["PawnageID"])); DDOperation newOperation = new DDOperation("OperationID", Convert.ToInt32(dt.Rows[i]["OperationID"])); if (newOperation.PreOperationID != 0) { DDOperation preOperation = new DDOperation("OperationID", newOperation.PreOperationID); preOperation.NextOperationID = 0; preOperation.Save(); newTicket.StatusID = preOperation.OperationType; newInfo.StatusID = preOperation.OperationType; if (newOperation.OperationType == 3) { newTicket.EndDate = preOperation.EndDate; } } else { newTicket.StatusID = 6; newInfo.StatusID = 6; } newOperation.OperationType = 6;//6:删除 newOperation.NextOperationID = -1; newOperation.OperationDate = strDate; newOperation.Deleted = 1; newOperation.Save(); newInfo.Save(); } } newTicket.Save(); InitGridSource(); dataGridView1.DataSource = m_GridTable; SetForGridViewPage(); MessageBox.Show("删除成功!", "删除"); }
private void UpdateOperation() { if (dataGridView1.Rows.Count > 0) { DDPawnTicket newTicket = new DDPawnTicket("TicketID", m_TicketID); newTicket.StatusID = 3; //3:续当 newTicket.EndDate = this.tbxEndDate.Text; newTicket.Save(); int iPawnageID = 0; int preOperationID = 0; PawnSpan Span = new PawnSpan(); Span = DianDangFunction.GetPawnSpan(DateTime.Parse(tbxStartDate.Text), DateTime.Parse(tbxEndDate.Text)); for (int i = dataGridView1.Rows.Count - 1; i > -1; i--) { DataGridViewRow dgr = dataGridView1.Rows[i]; try { iPawnageID = Convert.ToInt32(dgr.Cells["PawnageID"].Value); DDPawnageInfo newInfo = new DDPawnageInfo("PawnageID", iPawnageID); preOperationID = Convert.ToInt32(dgr.Cells["OperationID"].Value); DDOperation newOperation = new DDOperation(); newOperation.TicketID = m_TicketID; newOperation.PawnageID = iPawnageID; newOperation.OperationType = 3; //3 :续当 newOperation.OperationNumber = m_OperationNumber; newOperation.ServiceFee = dataGridView1.Rows[i].Cells["ServiceFee"].Value.ToString(); newOperation.InterestFee = dataGridView1.Rows[i].Cells["InterestFee"].Value.ToString(); newOperation.ReturnFee = "0"; newOperation.OverdueFee = "0"; newOperation.Amount = dgr.Cells["Amount"].Value.ToString(); newOperation.ReckonAmount = "0"; newOperation.OperationDate = this.tbxOperationDate.Text; newOperation.StartDate = this.tbxStartDate.Text; newOperation.EndDate = this.tbxEndDate.Text; DDUser newOperater = new DDUser("AccountName", MainForm.AccountName); newOperation.OperaterName = newOperater.UserName; newOperation.PreOperationID = preOperationID; newOperation.ServiceFeeRate = dgr.Cells["FeeRate"].Value.ToString(); newOperation.InterestFeeRate = dgr.Cells["InterestRate"].Value.ToString(); newOperation.NextOperationID = 0; newOperation.Deleted = 0; newOperation.Save(); DDOperation oldOperation = new DDOperation("OperationID", preOperationID); oldOperation.NextOperationID = newOperation.OperationID; oldOperation.Save(); newInfo.FeeRate = dgr.Cells["FeeRate"].Value.ToString(); newInfo.InterestRate = dgr.Cells["InterestRate"].Value.ToString(); newInfo.EndDate = this.tbxEndDate.Text; newInfo.StatusID = 3; //续当 newInfo.Save(); } catch { MessageBox.Show(this, "续当操作失败,请检查数据库是否连接正确!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } }