Esempio n. 1
0
        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(supplierIdTextBox.Text.Trim()))
            {
                if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    supp = (MSupplier)DataMaster.GetObjectById(typeof(MSupplier), supplierIdTextBox.Text);
                    DataMaster.Delete(supp);

                    IList            listAcc = DataMaster.GetListEq(typeof(MSupplierAccount), MSupplierAccount.ColumnNames.SupplierId, supplierIdTextBox.Text);
                    MSupplierAccount suppAcc;
                    for (int i = 0; i < listAcc.Count; i++)
                    {
                        suppAcc = (MSupplierAccount)listAcc[i];
                        if (suppAcc != null)
                        {
                            DataMaster.Delete(suppAcc);
                        }
                    }

                    ModuleControlSettings.SaveLog(ListOfAction.Delete, supplierIdTextBox.Text, ListOfTable.MSupplier, lbl_UserName.Text);
                    BindData();
                }
            }
        }
Esempio n. 2
0
        private void DeleteTransactionDetail()
        {
            IList listTrans = DataMaster.GetListEq(typeof(TTransactionDetail), TTransactionDetail.ColumnNames.TransactionId, decimal.Parse(transactionIdLabel.Text));
            TTransactionDetail det;

            for (int i = 0; i < listTrans.Count; i++)
            {
                det = (TTransactionDetail)listTrans[i];
                DataMaster.Delete(det);
            }
        }
Esempio n. 3
0
        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(userNameTextBox.Text.Trim()))
            {
                if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    user = (MUser)DataMaster.GetObjectById(typeof(MUser), userNameTextBox.Text);
                    DataMaster.Delete(user);

                    DeleteTMenuUser();
                    BindData();
                }
            }
        }
Esempio n. 4
0
        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(itemIdTextBox.Text.Trim()))
            {
                if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    item = (MItem)DataMaster.GetObjectById(typeof(MItem), itemIdTextBox.Text);
                    DataMaster.Delete(item);

                    ItemGudangStok stok = (ItemGudangStok)DataMaster.GetObjectByProperty(typeof(ItemGudangStok), ItemGudangStok.ColumnNames.ItemId, itemIdTextBox.Text, ItemGudangStok.ColumnNames.GudangId, defaultGudangIdComboBox.SelectedValue);
                    DataMaster.Delete(stok);
                }
            }
        }
Esempio n. 5
0
        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(packetIdTextBox.Text.Trim()))
            {
                if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    //delete paket
                    paket = (MPacket)DataMaster.GetObjectByProperty(typeof(MPacket), MPacket.ColumnNames.PacketId, packetIdTextBox.Text);
                    DataMaster.Delete(paket);

                    //delete item paket
                    DeleteItemPacket();

                    ModuleControlSettings.SaveLog(ListOfAction.Delete, packetIdTextBox.Text, ListOfTable.MPacket, lbl_UserName.Text);
                    BindData();
                }
            }
        }
Esempio n. 6
0
 private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(groupIdLabel1.Text.Trim()))
     {
         if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
         {
             group = (MGroup)DataMaster.GetObjectByProperty(typeof(MGroup), MGroup.ColumnNames.GroupId, int.Parse(groupIdLabel1.Text));
             DataMaster.Delete(group);
             BindData();
         }
     }
 }
Esempio n. 7
0
 private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(customerIdTextBox.Text.Trim()))
     {
         if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
         {
             cust = (MCustomer)DataMaster.GetObjectByProperty(typeof(MCustomer), MCustomer.ColumnNames.CustomerId, customerIdTextBox.Text);
             DataMaster.Delete(cust);
             BindData();
         }
     }
 }
 private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(employeeIdTextBox.Text.Trim()))
     {
         if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
         {
             emp = (MEmployee)DataMaster.GetObjectById(typeof(MEmployee), employeeIdTextBox.Text);
             DataMaster.Delete(emp);
             ModuleControlSettings.SaveLog(ListOfAction.Delete, employeeIdTextBox.Text, ListOfTable.MEmployee, lbl_UserName.Text);
             BindData();
         }
     }
 }
Esempio n. 9
0
 private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(gudangIdLabel1.Text.Trim()))
     {
         if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
         {
             gud = (MGudang)DataMaster.GetObjectByProperty(typeof(MGudang), MGudang.ColumnNames.GudangId, Convert.ToInt32(gudangIdLabel1.Text));
             DataMaster.Delete(gud);
             ModuleControlSettings.SaveLog(ListOfAction.Delete, gudangNameTextBox.Text, ListOfTable.MGudang, lbl_UserName.Text);
             BindData();
         }
     }
 }
Esempio n. 10
0
 private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(itemTypeIdLabel1.Text.Trim()))
     {
         if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
         {
             tipe = (MItemType)DataMaster.GetObjectByProperty(typeof(MItemType), MItemType.ColumnNames.ItemTypeId, int.Parse(itemTypeIdLabel1.Text));
             DataMaster.Delete(tipe);
             ModuleControlSettings.SaveLog(ListOfAction.Delete, itemTypeNameTextBox.Text, ListOfTable.MGroup, lbl_UserName.Text);
             BindData();
         }
     }
 }
Esempio n. 11
0
        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(itemIdTextBox.Text.Trim()))
            {
                if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    item = (MItem)DataMaster.GetObjectByProperty(typeof(MItem), MItem.ColumnNames.ItemId, itemIdTextBox.Text);
                    DataMaster.Delete(item);

                    IList          listStok = DataMaster.GetListEq(typeof(ItemGudangStok), ItemGudangStok.ColumnNames.ItemId, itemIdTextBox.Text);
                    ItemGudangStok stok;
                    for (int i = 0; i < listStok.Count; i++)
                    {
                        stok = (ItemGudangStok)listStok[i];
                        if (stok != null)
                        {
                            DataMaster.Delete(stok);
                        }
                    }
                    ModuleControlSettings.SaveLog(ListOfAction.Delete, itemIdTextBox.Text, ListOfTable.MItem, lbl_UserName.Text);
                    BindData();
                }
            }
        }
        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(customerGroupIdTextBox.Text.Trim()))
            {
                if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    custGroup = (MCustomerGroup)DataMaster.GetObjectByProperty(typeof(MCustomerGroup), MCustomerGroup.ColumnNames.CustomerGroupId, customerGroupIdTextBox.Text);
                    DataMaster.Delete(custGroup);

                    ModuleControlSettings.SaveLog(ListOfAction.Delete, customerGroupIdTextBox.Text, ListOfTable.MCustomerGroup, lbl_UserName.Text);

                    BindData();
                }
            }
        }
        private void DeleteTransaction(DateTime from, DateTime to)
        {
            NHibernate.Expression.ICriterion[] expArrays = new NHibernate.Expression.ICriterion[2];
            expArrays[0] = NHibernate.Expression.Expression.Or(NHibernate.Expression.Expression.Eq(TTransaction.ColumnNames.TransactionStatus, ListOfTransaction.Sales.ToString()), NHibernate.Expression.Expression.Eq(TTransaction.ColumnNames.TransactionStatus, ListOfTransaction.SalesVIP.ToString()));
            expArrays[1] = NHibernate.Expression.Expression.Between(TTransaction.ColumnNames.TransactionDate, from, to);

            IList              list = DataMaster.GetList(typeof(TTransaction), expArrays, null);
            TTransaction       t;
            TTransactionDetail det;

            for (int i = 0; i < list.Count; i++)
            {
                t = (TTransaction)list[i];
                IList listDet = DataMaster.GetListEq(typeof(TTransactionDetail), TTransactionDetail.ColumnNames.TransactionId, t.TransactionId);
                for (int j = 0; j < listDet.Count; j++)
                {
                    det = (TTransactionDetail)listDet[j];
                    DataMaster.Delete(det);
                }
                DataMaster.Delete(t);
            }
            MessageBox.Show("Transaksi Berhasil dihapus", "Hapus Transaksi Berhasil.", MessageBoxButtons.OK, MessageBoxIcon.Information);
            groupBox1.Enabled = false;
        }
Esempio n. 14
0
        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            //if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            //{
            formDel = new FormDeleteConfirm(FormDeleteConfirm.DeletePin.Giro);

            if (formDel.ShowDialog(this) == DialogResult.OK)
            {
                giro = (TGiro)DataMaster.GetObjectByProperty(typeof(TGiro), TGiro.ColumnNames.GiroNo, giroNoTextBox.Text, TGiro.ColumnNames.BankId, bankIdComboBox.SelectedValue.ToString());
                if (giro != null)
                {
                    DataMaster.Delete(giro);
                }

                ModuleControlSettings.SaveLog(ListOfAction.Delete, bankIdComboBox.SelectedValue.ToString() + ";" + giroNoTextBox.Text + ";" + ListOfGiroStatus.Baru.ToString(), ListOfTable.TGiro, lbl_UserName.Text);
                BindGiroData();
            }
        }
Esempio n. 15
0
        private void button2_Click(object sender, EventArgs e)
        {
            DataMasterMgtServices DataMaster = new DataMasterMgtServices();
            TStokCard             card;
            decimal stokId;
            bool    isDelete = false;;

            for (int i = 0; i < dataGridView1.RowCount; i++)
            {
                isDelete = Convert.ToBoolean(dataGridView1.Rows[i].Cells[0].Value);
                if (isDelete)
                {
                    stokId = Convert.ToDecimal(dataGridView1.Rows[i].Cells[1].Value);
                    card   = (TStokCard)DataMaster.GetObjectByProperty(typeof(TStokCard), TStokCard.ColumnNames.StokCardId, stokId);
                    if (card != null)
                    {
                        DataMaster.Delete(card);
                    }
                }
            }
        }
Esempio n. 16
0
        private void SaveTransactionDetail()
        {
            TTransactionDetail det;
            ItemGudangStok     stok;
            MItem     item;
            TStokCard krt;


            //clear data if from billiard desk
            if (!lbl_TempDesk.Text.Equals(ListOfDesk.Cafe.ToString()))
            {
                IList listOfTransDetail = DataMaster.GetListEq(typeof(TTransactionDetail), TTransactionDetail.ColumnNames.TransactionId, Convert.ToDecimal(txt_TransactionId.Text));
                for (int i = 0; i < listOfTransDetail.Count; i++)
                {
                    det = (TTransactionDetail)listOfTransDetail[i];
                    DataMaster.Delete(det);
                }

                TDesk t = (TDesk)DataMaster.GetObjectByProperty(typeof(TDesk), TDesk.ColumnNames.DeskTransactionId, Convert.ToDecimal(txt_TransactionId.Text));
                if (t != null)
                {
                    t.DeskStatus   = ListOfBilliardPaymentStatus.Paid.ToString();
                    t.ModifiedBy   = lbl_UserName.Text;
                    t.ModifiedDate = DateTime.Now;
                    DataMaster.UpdatePersistence(t);
                }
            }

            bool    AddStok = true;
            decimal saldo   = 0;

            if (lbl_TempTransaction.Text.Equals(ListOfTransaction.Sales.ToString()) || lbl_TempTransaction.Text.Equals(ListOfTransaction.ReturPurchase.ToString()) || lbl_TempTransaction.Text.Equals(ListOfTransaction.SalesVIP.ToString()))
            {
                AddStok = false;
            }
            else
            {
                AddStok = true;
            }

            for (int i = 0; i < grid_Trans.Rows.Count; i++)
            {
                saldo = 0;

                det          = new TTransactionDetail();
                det.Disc     = Convert.ToDecimal(grid_Trans.Rows[i].Cells[5].Value);
                det.ItemId   = grid_Trans.Rows[i].Cells[0].Value.ToString();
                det.Ppn      = 0;
                det.Price    = Convert.ToDecimal(grid_Trans.Rows[i].Cells[3].Value);
                det.Quantity = Convert.ToDecimal(grid_Trans.Rows[i].Cells[2].Value);

                //if corection, save item quantity for detail total
                if (lbl_TempTransaction.Text.Equals(ListOfTransaction.Correction.ToString()))
                {
                    det.Total = Convert.ToDecimal(grid_Trans.Rows[i].Cells[2].Value);
                }
                else
                {
                    det.Total = Convert.ToDecimal(grid_Trans.Rows[i].Cells[6].Value);
                }

                det.TransactionId = Convert.ToDecimal(txt_TransactionId.Text);
                det.Jumlah        = Convert.ToDecimal(grid_Trans.Rows[i].Cells[4].Value);

                det.ModifiedBy   = lbl_UserName.Text;
                det.ModifiedDate = DateTime.Now;
                DataMaster.SavePersistence(det);

                item = (MItem)DataMaster.GetObjectByProperty(typeof(MItem), MItem.ColumnNames.ItemId, grid_Trans.Rows[i].Cells[0].Value.ToString());
                if (item != null)
                {
                    //if item == barang
                    if (item.ItemTypeId == 1)
                    {
                        //change stok
                        stok = (ItemGudangStok)DataMaster.GetObjectByProperty(typeof(ItemGudangStok), ItemGudangStok.ColumnNames.ItemId, grid_Trans.Rows[i].Cells[0].Value.ToString());
                        if (stok != null)
                        {
                            if (AddStok)
                            {
                                saldo = stok.ItemStok + Convert.ToDecimal(grid_Trans.Rows[i].Cells[2].Value);
                            }
                            else
                            {
                                saldo = stok.ItemStok - Convert.ToDecimal(grid_Trans.Rows[i].Cells[2].Value);
                            }

                            stok.ItemStok     = saldo;
                            stok.ModifiedBy   = lbl_UserName.Text;
                            stok.ModifiedDate = DateTime.Now;
                            DataMaster.UpdatePersistence(stok);
                        }
                        else
                        {
                            stok             = new ItemGudangStok();
                            stok.GudangId    = 1;
                            stok.ItemId      = det.ItemId;
                            stok.ItemMaxStok = 0;
                            stok.ItemMinStok = 0;
                            if (AddStok)
                            {
                                stok.ItemStok = det.Quantity;
                            }
                            else
                            {
                                stok.ItemStok = det.Quantity * -1;
                            }
                            stok.ModifiedBy   = lbl_UserName.Text;
                            stok.ModifiedDate = DateTime.Now;
                            DataMaster.SavePersistence(stok);
                        }
                    }
                }

                krt                  = new TStokCard();
                krt.ItemId           = grid_Trans.Rows[i].Cells[0].Value.ToString();
                krt.StokCardDate     = DateTime.Now;
                krt.StokCardPic      = lbl_UserName.Text;
                krt.StokCardQuantity = Convert.ToDecimal(grid_Trans.Rows[i].Cells[2].Value);
                krt.StokCardSaldo    = saldo;
                krt.StokCardStatus   = AddStok;
                krt.TransactionId    = Convert.ToDecimal(txt_TransactionId.Text);
                krt.ModifiedBy       = lbl_UserName.Text;
                krt.ModifiedDate     = DateTime.Now;
                DataMaster.SavePersistence(krt);
            }
        }