示例#1
0
        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("该当票不能进行绝当操作!", "绝当");
            }
        }
示例#2
0
        private void UpdateOperation(int iTicketID)
        {
            try
            {
                Query query = new Query(DDOperation.Schema);
                query.AddWhere("TicketID", iTicketID);
                query.AddWhere("OperationType", Comparison.In, new int[] { 1, 3 });
                query.AddWhere("NextOperationID", 0);
                query.AddWhere("OperationType", Comparison.NotEquals, 6);
                DataTable dt = query.ExecuteDataSet().Tables[0];
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DDOperation oldOperation = new DDOperation("OperationID", Convert.ToInt32(dt.Rows[i]["OperationID"].ToString()));
                    DDOperation newOperation = new DDOperation();
                    int         dataGridRow  = 0;
                    for (int j = 0; j < dataGridView1.Rows.Count; j++)
                    {
                        if (dataGridView1.Rows[j].Cells["PawnageID"].Value.ToString() == oldOperation.PawnageID.ToString())
                        {
                            dataGridRow = j;
                        }
                    }
                    newOperation.TicketID        = m_TicketID;
                    newOperation.PawnageID       = Convert.ToInt32(dataGridView1.Rows[dataGridRow].Cells["PawnageID"].Value.ToString());
                    newOperation.OperationType   = 2;
                    newOperation.OperationNumber = m_OperationNumber;
                    newOperation.ServiceFee      = "0";
                    newOperation.InterestFee     = (Convert.ToDouble(dataGridView1.Rows[dataGridRow].Cells["PaidInterestFee"].Value.ToString()) - Convert.ToDouble(dataGridView1.Rows[dataGridRow].Cells["ReturnInterestFee"].Value.ToString())).ToString();
                    newOperation.ReturnFee       = dataGridView1.Rows[dataGridRow].Cells["ReturnFee"].Value.ToString();
                    newOperation.OverdueFee      = dataGridView1.Rows[dataGridRow].Cells["OverdueFee"].Value.ToString();
                    newOperation.Amount          = dataGridView1.Rows[dataGridRow].Cells["Amount"].Value.ToString();
                    newOperation.ReckonAmount    = "0";
                    newOperation.ServiceFeeRate  = dataGridView1.Rows[dataGridRow].Cells["ServiceFeeRate"].Value.ToString();
                    newOperation.InterestFeeRate = dataGridView1.Rows[dataGridRow].Cells["InterestFeeRate"].Value.ToString();
                    newOperation.OperationDate   = tbxOperationDate.Text;
                    DDUser newUser = new DDUser("AccountName", MainForm.AccountName);
                    newOperation.OperaterName    = newUser.UserName;
                    newOperation.PreOperationID  = oldOperation.OperationID;
                    newOperation.NextOperationID = 0;
                    newOperation.Save();

                    oldOperation.NextOperationID = newOperation.OperationID;
                    oldOperation.Save();

                    DDPawnageInfo newInfo = new DDPawnageInfo("PawnageID", Convert.ToInt32(dataGridView1.Rows[dataGridRow].Cells["PawnageID"].Value.ToString()));
                    newInfo.StatusID = 2;  //赎当
                    newInfo.Save();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#3
0
        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;
            }
        }
示例#4
0
        public void Update(int OperationID, int?TicketID, int?PawnageID, int?OperationType, string OperationNumber, string ServiceFee, string InterestFee, string ReturnFee, string OverdueFee, string Amount, string ReckonAmount, string OperationDate, string StartDate, string EndDate, string OperaterName, int?PreOperationID, int?NextOperationID, int?Deleted)
        {
            DDOperation item = new DDOperation();

            item.MarkOld();
            item.IsLoaded = true;

            item.OperationID = OperationID;

            item.TicketID = TicketID;

            item.PawnageID = PawnageID;

            item.OperationType = OperationType;

            item.OperationNumber = OperationNumber;

            item.ServiceFee = ServiceFee;

            item.InterestFee = InterestFee;

            item.ReturnFee = ReturnFee;

            item.OverdueFee = OverdueFee;

            item.Amount = Amount;

            item.ReckonAmount = ReckonAmount;

            item.OperationDate = OperationDate;

            item.StartDate = StartDate;

            item.EndDate = EndDate;

            item.OperaterName = OperaterName;

            item.PreOperationID = PreOperationID;

            item.NextOperationID = NextOperationID;

            item.Deleted = Deleted;

            item.Save(UserName);
        }
示例#5
0
        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;
            }
        }
示例#6
0
        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;
            }
        }
示例#7
0
        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("删除成功!", "删除");
        }
示例#8
0
        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);
                    }
                }
            }
        }