Пример #1
0
        private void SaveNewItem()
        {
            int sign = 1;

            if ((bool)rddProduct.Tag)
            {
                sign = -1;
            }
            //SaveItem
            using (sinarekDataSetTableAdapters.logotherTableAdapter tbl = new sinarekDataSetTableAdapters.logotherTableAdapter())
            {
                tbl.InsertDataPenjualan(long.Parse(logid_)
                                        , int.Parse(ujid_)
                                        , int.Parse(lappenid_)
                                        , dtpTanggal.Value
                                        , txtKeterangan.Text
                                        , 0
                                        , -1
                                        , dtpTanggal.Value
                                        , (sign * decimal.Parse(txtQuantity.Text))
                                        , int.Parse(rddProduct.SelectedValue.ToString())
                                        , decimal.Parse(txtPrice.Text)
                                        , int.Parse(rddKota.SelectedValue.ToString())
                                        , ""
                                        , txtDetail2.Text
                                        , txtTime.Text
                                        , NBConfig.ValidUserName);
            }
        }
Пример #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);
            }
        }