public bool addDebt(Debt c)
        {
            try
            {
                int param = 4;

                string[] name = new string[param];
                object[] value = new object[param];

                name[0] = "@contractid"; value[0] = c.Contractid;
                name[1] = "@dateSet"; value[1] = c.DateSet;
                name[2] = "@debtuntildate"; value[2] = c.DebtUntildate;
                name[3] = "@note"; value[3] = c.Note;

                int result = this.Update("debt_Insert", name, value, param);
                if (result != 0)
                {
                    return true;
                }
            }
            catch (System.Exception ex)
            {
                Console.WriteLine("Message = {1}", ex.Message);
            }

            return false;
        }
예제 #2
0
        public DebtEdit(Debt c)
        {
            InitializeComponent();
            this.objectDebt = c;
               // date.Format = DateTimePickerFormat.Custom;
               // this.date.CustomFormat = "MM-dd-yyyy";
            if (this.objectDebt != null)
            {

                this.idDebt.Text = c.Id.ToString();
                this.ctrID.Text = c.Contractid;
                this.debt.Text = c.DebtUnitldate.ToString();
                this.date.Value = c.DateSet;
                this.note.Text = c.Node;
            }
        }
        public DataTable searchDebt(Debt debt)
        {
            try
            {
                string[] names = new string[6];
                object[] values = new object[6];

                names[0] = "@p_ID"; values[0] = debt.Id;
                names[1] = "@p_CONTRACTID"; values[1] = debt.Contractid;
                names[2] = "@p_DATE"; values[2] = debt.DateSet;
                names[3] = "@p_DEBTUNTILDATE"; values[3] = debt.DebtUntildate;
                names[4] = "@p_NOTE"; values[4] = debt.Note;
                names[5] = "@p_TOP"; values[5] = 0;

                return this.ExcuteStoreProcedure("DEBT_Search", names, values);
            }
            catch (System.Exception ex)
            {
                Console.WriteLine("Message = {1}", ex.Message);
            }

            return null;
        }
예제 #4
0
 private void editDebt_click(object sender, EventArgs e)
 {
     Debt temp = new Debt();
     temp = d;
     DebtEdit debtEdit = new DebtEdit(temp);
     reset();
     debtEdit.Show();
 }
        public bool updateDebt(Debt c)
        {
            try
            {

                string sql = " Set dateformat dmy Update debt set contractid =('" + c.Contractid + "'), date =('" + c.DateSet + "'),  debtuntildate =('" + c.DebtUntildate + "'),  note =('" + c.Note + "') where id = ('" + c.Id.Trim() + "')";
                int result = this.ExecuteNonQuery(sql);
                if (result != 0)
                {
                    return true;
                }
            }
            catch (System.Exception ex)
            {
                Console.WriteLine("Message = {1}", ex.Message);
            }
            return false;
        }
예제 #6
0
 public bool updateDebt(Debt c)
 {
     return debtDAT.updateDebt(c);
 }
예제 #7
0
 public bool addDebt(Debt c)
 {
     return debtDAT.addDebt(c);
 }
 public DataTable searchDebt(Debt debt)
 {
     return debtDAT.searchDebt(debt);
 }