Esempio n. 1
0
        private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                if (Control())
                {
                    db.AddParameterValue("@ref", this._Ref);
                    db.AddParameterValue("@code", code);
                    db.AddParameterValue("@name", name);
                    db.AddParameterValue("@desc", txtDesc.GetString());


                    db.RunCommand("sp_sysRole_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);
            }
        }
Esempio n. 2
0
        private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                if (Control())
                {
                    Path = helper.TextSifrele(str);
                    db.AddParameterValue("@ref", this._Ref);
                    db.AddParameterValue("@dbno", dbNo);
                    db.AddParameterValue("@name", dbName);
                    db.AddParameterValue("@path", Path, SqlDbType.NVarChar, 1000);
                    db.AddParameterValue("@type", dbType);
                    db.AddParameterValue("@username", Username);
                    db.AddParameterValue("@password", Pass);
                    db.AddParameterValue("@timeout", int.Parse(txtTimeOut.GetString()));

                    db.RunCommand("sp_sysDatabase_AddOrUp", CommandType.StoredProcedure);

                    XtraMessageBox.Show("Kayıt başarıyla tamamlandı.", "Başarılı İşlem!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    c.StateStabil(this);
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
                else
                {
                    FrmErrorForm eForm = new FrmErrorForm();
                    eForm.flashMemoEdit1.SetString(stb.ToString());
                    eForm.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                helper.WriteLog(ex);
            }
        }
Esempio n. 3
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\\User\\";
                        newName = GuidKey + "." + words[1].ToString();
                        File.Copy(pictureEdit1.GetLoadedImageLocation().ToString(), goal + newName);
                    }
                    NormalPass = txtPassword.GetString();
                    if (NormalPass.Length > 0)
                    {
                        HashedPass = helper.TextSifrele(NormalPass);
                    }


                    db.AddParameterValue("@ref", this._Ref);
                    db.AddParameterValue("@active", chkActive.GetBoolValue());
                    db.AddParameterValue("@code", txtCode.GetString());
                    db.AddParameterValue("@name", txtName.GetString());
                    db.AddParameterValue("@username", txtUsername.GetString());
                    db.AddParameterValue("@password", HashedPass);
                    db.AddParameterValue("@roleRef", roleRef);
                    db.AddParameterValue("@groupRef", groupRef);
                    db.AddParameterValue("@phoneNo1", txtTel1.GetString());
                    db.AddParameterValue("@phoneNo2", txtTel2.GetString());
                    db.AddParameterValue("@eMail", txtMail.GetString());
                    db.AddParameterValue("@defualtDB", dbRef);
                    db.AddParameterValue("@path", newName);


                    db.RunCommand("sp_sysUser_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);
                db.parameterDelete();
            }
        }
Esempio n. 4
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("@no", no);
                    db.AddParameterValue("@active", chkActive.GetBoolValue());
                    db.AddParameterValue("@code", code);
                    db.AddParameterValue("@name", name);
                    db.AddParameterValue("@address", txtAddress.GetString());
                    db.AddParameterValue("@cityRef", ledCity.GetValue());
                    db.AddParameterValue("@phoneNo1", txtTel1.GetString());
                    db.AddParameterValue("@phoneNo2", txtTel2.GetString());
                    db.AddParameterValue("@faxNo", txtTel3.GetString());
                    db.AddParameterValue("@eMail", txtMail.GetString());

                    db.RunCommand("sp_sysBranch_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);
            }
        }