Exemplo n.º 1
0
 private void DeleteLogPel(string LogPelID)
 {
     try
     {
         using (sinarekDataSetTableAdapters.logpelTableAdapter tbl = new sinarekDataSetTableAdapters.logpelTableAdapter())
         {
             tbl.DeleteLogPel(int.Parse(LogPelID));
         }
     }
     catch (Exception ex)
     {
         helper.SysLog(this.GetType().Name, this.Text, "DeleteLogPel : " + ex.Message);
     }
 }
Exemplo n.º 2
0
        private void SaveNewItem()
        {
            string logpelid;

            try
            {
                //SaveItem
                using (sinarekDataSetTableAdapters.logpelTableAdapter tbl = new sinarekDataSetTableAdapters.logpelTableAdapter())
                {
                    logpelid = tbl.pDataPenjPelanggan(int.Parse(rddPel.SelectedValue.ToString())
                                                      , int.Parse(logid_)
                                                      , dtpTanggal.Value
                                                      , int.Parse(salesid_)
                                                      , (chkCredit.Checked ? 1 : 0)
                                                      , NBConfig.ValidUserName).ToString();
                }

                if (chkKunjungan.ToggleState == Telerik.WinControls.Enumerations.ToggleState.Off)
                {
                    using (sinarekDataSetTableAdapters.logotherTableAdapter tbl = new sinarekDataSetTableAdapters.logotherTableAdapter())
                    {
                        foreach (GridViewRowInfo item in radGridView1.Rows)
                        {
                            tbl.InsertDataPenjualan(long.Parse(logid_)
                                                    , int.Parse(logpelid)
                                                    , int.Parse(lappenid_)
                                                    , dtpTanggal.Value
                                                    , (item.Cells["keterangan"].Value == null ? "" : item.Cells["keterangan"].Value.ToString())
                                                    , 0
                                                    , short.Parse(item.Cells["statusid"].Value.ToString())
                                                    , null
                                                    , decimal.Parse(item.Cells["quantity"].Value.ToString())
                                                    , int.Parse(item.Cells["productid"].Value.ToString())
                                                    , decimal.Parse(item.Cells["harga"].Value.ToString())
                                                    , int.Parse(item.Cells["kotaid"].Value.ToString())
                                                    , item.Cells["nota"].Value.ToString()
                                                    , ""
                                                    , ""
                                                    , NBConfig.ValidUserName);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                helper.ErrorMessage("Error menyimpan data penjualan");
                helper.SysLog(this.GetType().Name, this.Text, ex.Message + " : " + ex.StackTrace);
            }
        }