示例#1
0
        private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                if (Control())
                {
                    db.AddParameterValue("@ref", this._Ref);
                    db.AddParameterValue("@firmRef", firmRef);
                    db.AddParameterValue("@branchRef", branchRef);
                    db.AddParameterValue("@no", no);
                    db.AddParameterValue("@code", code);
                    db.AddParameterValue("@name", name);
                    db.AddParameterValue("@desc", txtDesc.GetString());
                    db.AddParameterValue("@area", txtArea.GetString());

                    db.RunCommand("sp_sysWhouse_AddOrUp", CommandType.StoredProcedure);
                    XtraMessageBox.Show("İşlem başarıyla tamamlandı.", "Başarılı İşlem!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    c.StateStabil(this);
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
                else
                {
                    FrmErrorForm error = new FrmErrorForm();
                    error.flashMemoEdit1.SetString(stb.ToString());
                    error.ShowDialog();
                    db.parameterDelete();
                }
            }
            catch (Exception ex)
            {
                helper.WriteLog(ex);
            }
        }
示例#2
0
        private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                if (Control())
                {
                    if (!string.IsNullOrEmpty(pictureEdit1.GetLoadedImageLocation().ToString()))
                    {
                        string   MainPath = pictureEdit1.GetLoadedImageLocation().ToString();
                        string   GuidKey  = Guid.NewGuid().ToString();
                        string[] words    = MainPath.Split('.');
                        string   goal     = Application.StartupPath + @"\\Images\\Firm\\";
                        newName = GuidKey + "." + words[1].ToString();
                        File.Copy(pictureEdit1.GetLoadedImageLocation().ToString(), goal + newName);
                    }

                    db.AddParameterValue("@ref", this._Ref);
                    db.AddParameterValue("@dbRef", dbRef);
                    db.AddParameterValue("@no", no);
                    db.AddParameterValue("@active", chkActive.GetBoolValue());
                    db.AddParameterValue("@code", code);
                    db.AddParameterValue("@name", name);
                    db.AddParameterValue("@address", txtAddress.GetString());
                    db.AddParameterValue("@cityRef", ledSehir.GetValue());
                    db.AddParameterValue("@countrRef", ledUlke.GetValue());
                    db.AddParameterValue("@taxOffice", txtTaxName.GetString());
                    db.AddParameterValue("@taxNo", txtTax.GetString());
                    db.AddParameterValue("@phoneNo1", txtTel1.GetString());
                    db.AddParameterValue("@phoneNo2", txtTel2.GetString());
                    db.AddParameterValue("@faxNo", txtTel3.GetString());
                    db.AddParameterValue("@eMail", txtMail.GetString());
                    db.AddParameterValue("@web", txtWeb.GetString());
                    db.AddParameterValue("@path", newName);
                    db.RunCommand("sp_sysFirm_AddOrUp", CommandType.StoredProcedure);
                    XtraMessageBox.Show("İşlem başarıyla tamamlandı.", "Başarılı İşlem!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    c.StateStabil(this);
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
                else
                {
                    FrmErrorForm error = new FrmErrorForm();
                    error.flashMemoEdit1.SetString(stb.ToString());
                    error.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                helper.WriteLog(ex);
            }
        }
示例#3
0
 private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         if (Control())
         {
             db.AddParameterValue("@ref", this._Ref);
             db.AddParameterValue("@active", chkActive.GetBoolValue());
             db.AddParameterValue("@nationality", flashCheckEdit1.GetBoolValue());
             db.AddParameterValue("@person", chkPerson.GetBoolValue());
             db.AddParameterValue("@type", ledType.GetValue());
             db.AddParameterValue("@code", txtCode.GetString());
             db.AddParameterValue("@name", txtName.GetString());
             db.AddParameterValue("@country", txtCountry.GetString());
             db.AddParameterValue("@city", txtCity.GetString());
             db.AddParameterValue("@district", txtDistirct.GetString());
             db.AddParameterValue("@gsm", txtGsm.GetString());
             db.AddParameterValue("@tel", txtTel.GetString());
             db.AddParameterValue("@mail", txtMail.GetString(), SqlDbType.NVarChar);
             db.AddParameterValue("@address", txtAdress.GetString(), SqlDbType.NVarChar);
             db.AddParameterValue("@Ftax", txtVD.GetString());
             db.AddParameterValue("@ftaxNo", txtVNo.GetString());
             db.AddParameterValue("@Fcountry", txtFCountry.GetString());
             db.AddParameterValue("@Fcity", txtFCity.GetString());
             db.AddParameterValue("@Fdistrict", txtFDistirct.GetString());
             db.AddParameterValue("@Fgsm", txtFGsm.GetString());
             db.AddParameterValue("@Ftel", txtFTel.GetString());
             db.AddParameterValue("@Fmail", txtFMail.GetString(), SqlDbType.NVarChar);
             db.AddParameterValue("@Faddress", txtFAdress.GetString(), SqlDbType.NVarChar);
             db.RunCommand("sp_Customer", CommandType.StoredProcedure);
             XtraMessageBox.Show("İşlem başarıyla tamamlandı.", "Başarılı İşlem!", MessageBoxButtons.OK, MessageBoxIcon.Information);
             helper.ClearForm(this);
             c.StateStabil(this);
             this.DialogResult = DialogResult.OK;
             this.Close();
         }
         else
         {
             FrmErrorForm form = new FrmErrorForm();
             form.flashMemoEdit1.SetString(stb.ToString());
             form.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         helper.WriteLog(ex);
     }
 }
示例#4
0
        void Save()
        {
            if (Control())
            {
                db.AddParameterValue("@ref", this._Ref);
                db.AddParameterValue("@code", txtCode.GetString());
                db.AddParameterValue("@name", txtName.GetString());
                db.AddParameterValue("@date", dtpPlugDate.GetDate().ToShortDateString(), SqlDbType.Date);
                db.AddParameterValue("@branch", branch);
                db.AddParameterValue("@whouse", wHouse);
                db.AddParameterValue("@desc", txtDesc.GetString());
                db.AddParameterValue("@state", true);
                db.AddParameterValue("@totalPrice", allTotal, SqlDbType.Decimal);
                db.AddParameterValue("@customerRef", ledCustomer.GetValue());
                db.RunCommand("sp_BuyOrder", CommandType.StoredProcedure);
                db.parameterDelete();



                if (this._FormMod == Enums.enmFormMod.Yeni)
                {
                    this._Ref = int.Parse(db.GetScalarValue("select MAX(Ref) from StBuyOrder").ToString());
                }


                grdGrid.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.None;
                grdGrid.OptionsView.ShowAutoFilterRow  = false;

                for (int i = 0; i < grdGrid.RowCount; i++)
                {
                    if (string.IsNullOrEmpty(grdGrid.GetRowCellValue(i, "Ref").ToString()))
                    {
                        REf = 0;
                    }
                    else
                    {
                        REf = int.Parse(grdGrid.GetRowCellValue(i, "Ref").ToString());
                    }


                    int     cardRef   = int.Parse(grdGrid.GetRowCellValue(i, "Kart Ref").ToString());
                    string  cardCode  = grdGrid.GetRowCellValue(i, "Kart Kodu").ToString();
                    string  barcode   = grdGrid.GetRowCellValue(i, "Barkod").ToString();
                    int     unitRef   = int.Parse(grdGrid.GetRowCellValue(i, "Birim Ref").ToString());
                    int     quantity  = int.Parse(grdGrid.GetRowCellValue(i, "Miktar").ToString());
                    string  lineDesc  = grdGrid.GetRowCellValue(i, "Satır Açıklaması").ToString();
                    decimal unitPrice = decimal.Parse(grdGrid.GetRowCellValue(i, "Birim Fiyat").ToString());
                    decimal linePrice = decimal.Parse(grdGrid.GetRowCellValue(i, "Toplam Tutar").ToString());

                    db.AddParameterValue("@ref", REf);
                    db.AddParameterValue("@orderRef", this._Ref);
                    db.AddParameterValue("@cardRef", cardRef);
                    db.AddParameterValue("@cardCode", cardCode);
                    db.AddParameterValue("@barcode", barcode);
                    db.AddParameterValue("@unitRef", unitRef);
                    db.AddParameterValue("@quantity", quantity);
                    db.AddParameterValue("@unitPrice", unitPrice, SqlDbType.Decimal);
                    db.AddParameterValue("@linePrice", linePrice, SqlDbType.Decimal);
                    db.AddParameterValue("@direc", direc);
                    db.AddParameterValue("@desc", lineDesc);
                    db.RunCommand("sp_BuyOrderDetails", CommandType.StoredProcedure);
                }
                XtraMessageBox.Show("İşlem başarılı bir şekilde kaydedildi.", "Başarılı işlem!", MessageBoxButtons.OK, MessageBoxIcon.Information);

                ok = true;
            }
            else
            {
                FrmErrorForm form = new FrmErrorForm();
                form.flashMemoEdit1.SetString(stb.ToString());
                form.ShowDialog();
            }
        }
示例#5
0
        private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                if (Control())
                {
                    db.AddParameterValue("@ref", this._Ref);
                    db.AddParameterValue("@active", chkActive.GetBoolValue());
                    db.AddParameterValue("@code", txtCode.GetString());
                    db.AddParameterValue("@name", txtName.GetString());
                    db.AddParameterValue("@currencyRef", ledCurr.GetValue());
                    db.AddParameterValue("@start", dtpStart.GetDate(), SqlDbType.Date);
                    db.AddParameterValue("@finish", dtpFinish.GetDate(), SqlDbType.Date);
                    db.RunCommand("sp_SellPriceList", CommandType.StoredProcedure);
                    db.parameterDelete();

                    if (this._FormMod == Enums.enmFormMod.Yeni)
                    {
                        this._Ref = int.Parse(db.GetScalarValue("select MAX(ref) from StSellPriceList").ToString());
                    }


                    for (int a = 0; a < grdGrid.RowCount - 1; a++)
                    {
                        if (string.IsNullOrEmpty(grdGrid.GetRowCellValue(a, "Ref").ToString()))
                        {
                            REf = 0;
                        }
                        else
                        {
                            REf = int.Parse(grdGrid.GetRowCellValue(a, "Ref").ToString());
                        }


                        decimal price = decimal.Parse(grdGrid.GetRowCellValue(a, "Fiyat").ToString());
                        db.AddParameterValue("@ref", REf);
                        db.AddParameterValue("@listRef", this._Ref);
                        db.AddParameterValue("@cardRef", grdGrid.GetRowCellValue(a, "Kart Ref"));
                        db.AddParameterValue("@unitRef", grdGrid.GetRowCellValue(a, "Birim Ref"));
                        db.AddParameterValue("@barcode", grdGrid.GetRowCellValue(a, "Barkod"));
                        db.AddParameterValue("@price", price, SqlDbType.Decimal);
                        db.RunCommand("sp_SellPriceListDetails", CommandType.StoredProcedure);
                        db.parameterDelete();
                    }

                    for (int i = 0; i < grdBranch.RowCount - 1; i++)
                    {
                        if (string.IsNullOrEmpty(grdBranch.GetRowCellValue(i, "Ref").ToString()))
                        {
                            REf = 0;
                        }
                        else
                        {
                            REf = int.Parse(grdBranch.GetRowCellValue(i, "Ref").ToString());
                        }

                        db.AddParameterValue("@ref", REf);
                        db.AddParameterValue("@listRef", this._Ref);
                        db.AddParameterValue("@branchRef", grdBranch.GetRowCellValue(i, "branchRef"));
                        db.RunCommand("sp_SellPriceListBranch", CommandType.StoredProcedure);
                        db.parameterDelete();
                    }

                    XtraMessageBox.Show("İşlem başarıyla tamamlandı.", "Başarılı İşlem!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    helper.ClearForm(this);
                    c.StateStabil(this);
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
                else
                {
                    FrmErrorForm form = new FrmErrorForm();
                    form.flashMemoEdit1.SetString(stb.ToString());
                    form.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                helper.WriteLog(ex);
            }
        }
示例#6
0
        private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                if (Control())
                {
                    db.AddParameterValue("@ref", this._Ref);
                    db.AddParameterValue("@serial", txtPlugSeri.GetString());
                    db.AddParameterValue("@plugNo", txtPlugNo.GetString());
                    db.AddParameterValue("@type", ledPlugType.GetValue());
                    db.AddParameterValue("@date", dtpPlugDate.GetDate().ToShortDateString(), SqlDbType.Date);
                    db.AddParameterValue("@branch", branch);
                    db.AddParameterValue("@whouse", wHouse);
                    db.AddParameterValue("@desc", txtDesc.GetString());
                    db.RunCommand("sp_Plug", CommandType.StoredProcedure);
                    db.parameterDelete();



                    if (this._FormMod == Enums.enmFormMod.Yeni)
                    {
                        this._Ref = int.Parse(db.GetScalarValue("select MAX(Ref) from StPlug").ToString());
                    }


                    grdGrid.OptionsView.NewItemRowPosition = NewItemRowPosition.None;
                    grdGrid.OptionsView.ShowAutoFilterRow  = false;

                    for (int i = 0; i < grdGrid.RowCount; i++)
                    {
                        if (string.IsNullOrEmpty(grdGrid.GetRowCellValue(i, "Ref").ToString()))
                        {
                            REf = 0;
                        }
                        else
                        {
                            REf = int.Parse(grdGrid.GetRowCellValue(i, "Ref").ToString());
                        }


                        int    cardRef  = int.Parse(grdGrid.GetRowCellValue(i, "Kart Ref").ToString());
                        string cardCode = grdGrid.GetRowCellValue(i, "Kart Kodu").ToString();
                        string barcode  = grdGrid.GetRowCellValue(i, "Barkod").ToString();
                        int    unitRef  = int.Parse(grdGrid.GetRowCellValue(i, "Birim Ref").ToString());
                        int    quantity = int.Parse(grdGrid.GetRowCellValue(i, "Miktar").ToString());
                        string lineDesc = grdGrid.GetRowCellValue(i, "Satır Açıklaması").ToString();

                        db.AddParameterValue("@ref", REf);
                        db.AddParameterValue("@plugRef", this._Ref);
                        db.AddParameterValue("@cardRef", cardRef);
                        db.AddParameterValue("@cardCode", cardCode);
                        db.AddParameterValue("@barcode", barcode);
                        db.AddParameterValue("@unitRef", unitRef);
                        db.AddParameterValue("@quantity", quantity);
                        db.AddParameterValue("@direc", direc);
                        db.AddParameterValue("@desc", lineDesc);
                        db.RunCommand("sp_PlugDetails", CommandType.StoredProcedure);
                    }
                    XtraMessageBox.Show("İşlem başarılı bir şekilde kaydedildi.", "Başarılı işlem!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.DialogResult = DialogResult.OK;
                    helper.ClearForm(this);
                    c.StateStabil(this);
                    this.Close();
                }
                else
                {
                    FrmErrorForm form = new FrmErrorForm();
                    form.flashMemoEdit1.SetString(stb.ToString());
                    form.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                helper.WriteLog(ex);
            }
        }
示例#7
0
        private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            REf = 0;
            if (Control())
            {
                db.AddParameterValue("@ref", this._Ref);
                db.AddParameterValue("@firmRef", ledFirm.GetValue());
                db.AddParameterValue("@userRef", ledUser.GetValue());
                db.AddParameterValue("@authRef", ledPackage.GetValue());
                db.RunCommand("sp_sysUserAuth_AddOrUp", CommandType.StoredProcedure);

                if (this._FormMod == Enums.enmFormMod.Yeni)
                {
                    this._Ref = int.Parse(db.GetScalarValue("select MAX(ref) from SysAuthUser").ToString());
                }


                for (int i = 0; i < grdBranch.RowCount; i++)
                {
                    db.AddParameterValue("@ref1", ledUser.GetValue());
                    db.AddParameterValue("@ref2", grdBranch.GetRowCellValue(i, "Ref"));
                    if (int.Parse(db.GetScalarValue("select count(*) from sysAuthUserBranch where userRef=@ref1 and branchRef=@ref2").ToString()) > 0)
                    {
                        db.AddParameterValue("@ref1", ledUser.GetValue());
                        db.AddParameterValue("@ref2", grdBranch.GetRowCellValue(i, "Ref"));
                        REf = int.Parse(db.GetScalarValue("select Ref from sysAuthUserBranch where userRef=@ref1 and branchRef=@ref2").ToString());
                    }
                    if (grdBranch.GetRowCellValue(i, "Seçim").ToString() == "True")
                    {
                        db.AddParameterValue("@ref", REf);
                        db.AddParameterValue("@userRef", ledUser.GetValue());
                        db.AddParameterValue("@branchRef", grdBranch.GetRowCellValue(i, "Ref"));
                        db.RunCommand("sp_sysAuthUserBranch_AddOrUp", CommandType.StoredProcedure);
                    }
                    else if (grdBranch.GetRowCellValue(i, "Seçim").ToString() == "False")
                    {
                        db.AddParameterValue("@ref", REf);
                        db.RunCommand("delete from sysAutUserBranch where Ref=@ref ");
                    }
                }


                for (int a = 0; a < grdDb.RowCount; a++)
                {
                    REf = 0;
                    db.AddParameterValue("@ref1", ledUser.GetValue());
                    db.AddParameterValue("@ref2", grdDb.GetRowCellValue(a, "Ref"));
                    if (int.Parse(db.GetScalarValue("select count(*) from sysAuthUserWhouse where userRef=@ref1 and whouseRef=@ref2").ToString()) > 0)
                    {
                        db.AddParameterValue("@ref1", ledUser.GetValue());
                        db.AddParameterValue("@ref2", grdDb.GetRowCellValue(a, "Ref"));
                        REf = int.Parse(db.GetScalarValue("select Ref from sysAuthUserWhouse where userRef=@ref1 and whouseRef=@ref2").ToString());
                    }

                    if (grdDb.GetRowCellValue(a, "Seçim").ToString() == "True")
                    {
                        db.AddParameterValue("@ref", REf);
                        db.AddParameterValue("@userRef", ledUser.GetValue());
                        db.AddParameterValue("@whouseRef", grdDb.GetRowCellValue(a, "Ref"));
                        db.RunCommand("sp_sysAuthUserWhouse_AddOrUp", CommandType.StoredProcedure);
                    }
                    else if (grdDb.GetRowCellValue(a, "Seçim").ToString() == "False")
                    {
                        db.AddParameterValue("@ref", REf);
                        db.RunCommand("delete from sysAuthUserWhouse where Ref=@ref ");
                    }
                }

                XtraMessageBox.Show("İşlem başarıyla tamamlandı.", "Başarılı İşlem!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                helper.ClearForm(this);
                c.StateStabil(this);
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                FrmErrorForm error = new FrmErrorForm();
                error.flashMemoEdit1.SetString(stb.ToString());
                error.ShowDialog();
            }
        }