Example #1
0
 private void gvOTTOContact_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         GridView    view = (GridView)sender;
         Point       pt   = view.GridControl.PointToClient(Control.MousePosition);
         GridHitInfo info = view.CalcHitInfo(pt);
         if (info.InRow || info.InRowCell)
         {
             if (ObjEOTTO == null)
             {
                 ObjEOTTO = new EOTTO();
             }
             GetContactDetails();
             frmOTTOMaster frm = new frmOTTOMaster(ObjEOTTO);
             frm.ObjEOtto = ObjEOTTO;
             frm.ShowDialog();
             if (frm.DialogResult == DialogResult.OK)
             {
                 BindContactData();
                 Setfocus(gvOTTOContact, "ContactID", ObjEOTTO.ContactID);
             }
         }
     }
     catch (Exception ex)
     {
         Utility.ShowError(ex);
     }
 }
Example #2
0
 private void btnAddContact_Click(object sender, EventArgs e)
 {
     try
     {
         if (ObjEOTTO == null)
         {
             ObjEOTTO = new EOTTO();
         }
         ObjEOTTO.ContactID = -1;
         frmOTTOMaster frm = new frmOTTOMaster(ObjEOTTO);
         frm.ShowDialog();
         if (frm.DialogResult == DialogResult.OK)
         {
             BindContactData();
             Setfocus(gvOTTOContact, "ContactID", ObjEOTTO.ContactID);
             if (Utility._IsGermany == true)
             {
                 frmOTTOPro.UpdateStatus("Vorgang abgeschlossen: Speichern der Kontakte zu OTTO Stammdaten");
             }
             else
             {
                 frmOTTOPro.UpdateStatus("OTTO contact saved successfully");
             }
         }
     }
     catch (Exception ex) { Utility.ShowError(ex); }
 }
Example #3
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (!dxValidationProvider1.Validate())
         {
             return;
         }
         if (ObjEOTTO == null)
         {
             ObjEOTTO = new EOTTO();
         }
         if (ObjBOTTO == null)
         {
             ObjBOTTO = new BOTTO();
         }
         ParseOTTODetails();
         ObjEOTTO = ObjBOTTO.SaveOTTODetails(ObjEOTTO);
         BindOTTOData();
         cmbOTTO.EditValue = ObjEOTTO.OTTOID;
         if (Utility._IsGermany == true)
         {
             frmOTTOPro.UpdateStatus("Vorgang abgeschlossen: Speichern der OTTO Stammdaten");
         }
         else
         {
             frmOTTOPro.UpdateStatus("OTTO Data saved successfully");
         }
     }
     catch (Exception ex) { Utility.ShowError(ex); }
 }
Example #4
0
        /// <summary>
        /// Code to get save Organization details
        /// </summary>
        /// <param name="ObjEOTTO"></param>
        /// <returns></returns>
        public EOTTO SaveOTTODetails(XmlDocument XmlDoc, EOTTO ObjEOTTO)
        {
            int     OTTOID = -1;
            DataSet dsOTTO = new DataSet();

            try
            {
                string innerxml = XmlDoc.InnerXml;
                using (SqlCommand cmd = new SqlCommand())
                {
                    cmd.Connection  = SQLCon.Sqlconn();
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.CommandText = "[P_Ins_OTTODetails]";
                    SqlParameter param = new SqlParameter("@XMLOTTO", SqlDbType.Xml);
                    param.Value = innerxml;
                    cmd.Parameters.Add(param);
                    using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                    {
                        da.Fill(dsOTTO);
                    }
                    if (dsOTTO != null && dsOTTO.Tables.Count > 0)
                    {
                        string str = Convert.ToString(dsOTTO.Tables[0].Rows[0][0]);
                        if (int.TryParse(str, out OTTOID))
                        {
                            ObjEOTTO.OTTOID = OTTOID;
                            if (dsOTTO.Tables.Count > 1)
                            {
                                ObjEOTTO.dtOTTO = dsOTTO.Tables[1];
                            }
                        }
                        else
                        {
                            if (str.Contains("duplicate"))
                            {
                                if (System.Threading.Thread.CurrentThread.CurrentCulture.Name.ToString() == "de-DE")
                                {
                                    throw new Exception("Dieser Kurzname ist bereits vergeben");
                                }
                                else
                                {
                                    throw new Exception("ShortName is already exists.!");
                                }
                            }
                            else
                            {
                                throw new Exception("Fehler beim Speichern von Daten zu OTTO");
                            }
                        }
                    }
                }
            }
            catch (Exception ex) { throw; }
            finally{ SQLCon.Close(); }
            return(ObjEOTTO);
        }
Example #5
0
 /// <summary>
 /// Code to get Organization details
 /// </summary>
 /// <param name="ObjEOTTO"></param>
 /// <returns></returns>
 public EOTTO GetOTTODetails(EOTTO ObjEOTTO)
 {
     try
     {
         if (ObjEOTTO != null)
         {
             ObjEOTTO = ObjDOTTO.GetOTTODetails(ObjEOTTO);
         }
     }
     catch (Exception ex) { throw; }
     return(ObjEOTTO);
 }
Example #6
0
        private void cmbOTTO_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                int IValue = 0;
                if (int.TryParse(Convert.ToString(cmbOTTO.EditValue), out IValue))
                {
                    if (ObjEOTTO == null)
                    {
                        ObjEOTTO = new EOTTO();
                    }
                    DataRow dr = (cmbOTTO.GetSelectedDataRow() as DataRowView).Row;
                    ObjEOTTO.OTTOID = IValue;

                    txtShortName.Text           = Convert.ToString(dr["ShortName"]);
                    txtFullName.Text            = Convert.ToString(dr["FullName"]);
                    txtStreet.Text              = Convert.ToString(dr["Street"]);
                    txtPostalCode.Text          = Convert.ToString(dr["PostalCode"]);
                    txtCity.Text                = Convert.ToString(dr["City"]);
                    txtCountry.Text             = Convert.ToString(dr["Country"]);
                    txtILN.Text                 = Convert.ToString(dr["ILN"]);
                    txtBankName.Text            = Convert.ToString(dr["BankName"]);
                    txtBankPCode.Text           = Convert.ToString(dr["BankPostalCode"]);
                    txtBankAccNo.Text           = Convert.ToString(dr["BankAccNo"]);
                    txtDVNr.Text                = Convert.ToString(dr["DVNr"]);
                    txtTenderNo.Text            = Convert.ToString(dr["TenderNo"]);
                    txtDebtorNo.Text            = Convert.ToString(dr["DebtorNo"]);
                    txtCountryType.Text         = Convert.ToString(dr["CountryType"]);
                    txtIndustry.Text            = Convert.ToString(dr["Industry"]);
                    txtArtBevBew.Text           = Convert.ToString(dr["ArtBevBew"]);
                    txtArtNU.Text               = Convert.ToString(dr["ArtNU"]);
                    txtBGBez.Text               = Convert.ToString(dr["BGBez"]);
                    txtBGDatum.Text             = Convert.ToString(dr["BGDatum"]);
                    txtBGNr.Text                = Convert.ToString(dr["BGNr"]);
                    txtOTTOTelefone.Text        = Convert.ToString(dr["Telefon"]);
                    txtTelefax.Text             = Convert.ToString(dr["Telefax"]);
                    txtWebsite.Text             = Convert.ToString(dr["Website"]);
                    txtHotline.Text             = Convert.ToString(dr["HotLine"]);
                    txtIBAN.Text                = Convert.ToString(dr["IBAN"]);
                    txtBIC.Text                 = Convert.ToString(dr["BIC"]);
                    txtUSTNr.Text               = Convert.ToString(dr["USTIDNr"]);
                    txtseatofcompany.Text       = Convert.ToString(dr["SeatofCompany"]);
                    txtMD.Text                  = Convert.ToString(dr["ManagingDirector"]);
                    txtComplementary.Text       = Convert.ToString(dr["Complementary"]);
                    checkEditIsBranch.EditValue = Convert.ToBoolean(dr["IsBranch"]);
                    BindContactData();
                }
            }
            catch (Exception ex) { Utility.ShowError(ex); }
        }
Example #7
0
 private void btnSaveContact_Click(object sender, EventArgs e)
 {
     try
     {
         if (ObjEOTTO == null)
         {
             ObjEOTTO = new EOTTO();
         }
         ParseOTTOContactsDetails();
         ObjBOTTO          = new BOTTO();
         ObjEOTTO          = ObjBOTTO.SaveOTTOContactDetails(ObjEOTTO);
         this.DialogResult = DialogResult.OK;
     }
     catch (Exception ex) { Utility.ShowError(ex); }
 }
Example #8
0
 private void frmLoadOTTOMaster_Load(object sender, EventArgs e)
 {
     try
     {
         if (Utility.OTTODataAccess == "7")
         {
             btnAddContact.Enabled = false;
             btnSave.Enabled       = false;
         }
         ObjEOTTO = ObjBOTTO.GetOTTODetails(ObjEOTTO);
         BindOTTOData();
         if (ObjEOTTO.dtOTTO != null && ObjEOTTO.dtOTTO.Rows.Count > 0)
         {
             cmbOTTO.EditValue = ObjEOTTO.dtOTTO.Rows[0][0];
         }
     }
     catch (Exception ex) { Utility.ShowError(ex); }
 }
Example #9
0
 /// <summary>
 /// Code to save Organzition contacts
 /// </summary>
 /// <param name="ObjEOTTO"></param>
 /// <returns></returns>
 public EOTTO SaveOTTOContactDetails(EOTTO ObjEOTTO)
 {
     try
     {
         XmlDocument Xdoc  = new XmlDocument();
         string      XPath = "/Nouns/OTTOContact";
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "OttoID", ObjEOTTO.OTTOID.ToString());
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "ContactID", ObjEOTTO.ContactID.ToString());
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "ContactPerson", ObjEOTTO.ContactPerson);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "Telephone", ObjEOTTO.Cont_Telephone);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "Fax", ObjEOTTO.Fax);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "EmailID", ObjEOTTO.EmailID);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "TaxNo", ObjEOTTO.TaxNo);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "DefaultContact", ObjEOTTO.DefaultContact.ToString());
         ObjEOTTO = ObjDOTTO.SaveOTTOContactDetails(Xdoc, ObjEOTTO);
     }
     catch (Exception ex) { throw; }
     return(ObjEOTTO);
 }
Example #10
0
 /// <summary>
 /// Code to get save Organization details
 /// </summary>
 /// <param name="ObjEOTTO"></param>
 /// <returns></returns>
 public EOTTO SaveOTTODetails(EOTTO ObjEOTTO)
 {
     try
     {
         XmlDocument Xdoc  = new XmlDocument();
         string      XPath = "/Nouns/OTTO";
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "OttoID", ObjEOTTO.OTTOID.ToString());
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "ShortName", ObjEOTTO.ShortName);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "FullName", ObjEOTTO.FullName);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "IsBranch", ObjEOTTO.IsBranch.ToString());
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "Street", ObjEOTTO.Street);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "PostalCode", ObjEOTTO.PostalCode);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "City", ObjEOTTO.City);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "Country", ObjEOTTO.Country);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "ILN", ObjEOTTO.ILN);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "BankName", ObjEOTTO.BankName);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "BankPostalCode", ObjEOTTO.BankPostalCode);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "BankAccNo", ObjEOTTO.BankAccNo);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "DVNr", ObjEOTTO.DVNr);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "TenderNo", ObjEOTTO.TenderNo);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "DebtorNo", ObjEOTTO.DebtorNo);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "CountryType", ObjEOTTO.CountryType);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "Industry", ObjEOTTO.Industry);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "ArtBevBew", ObjEOTTO.ArtBevBew);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "ArtNU", ObjEOTTO.ArtNU);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "BGBez", ObjEOTTO.BGBez);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "BGDatum", ObjEOTTO.BGDatum);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "BGNr", ObjEOTTO.BGNr);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "Telefon", ObjEOTTO.Telefon);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "Telefax", ObjEOTTO.Telefax);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "Website", ObjEOTTO.Website);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "HotLine", ObjEOTTO.HotLine);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "IBAN", ObjEOTTO.IBAN);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "BIC", ObjEOTTO.BIC);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "USTIDNr", ObjEOTTO.USTIDNr);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "SeatofCompany", ObjEOTTO.SeatofCompany);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "ManagingDirector", ObjEOTTO.ManagingDirector);
         Xdoc     = XMLBuilder.XmlConstruct(Xdoc, XPath, "Complementary", ObjEOTTO.Complementary);
         ObjEOTTO = ObjDOTTO.SaveOTTODetails(Xdoc, ObjEOTTO);
     }
     catch (Exception ex) { throw; }
     return(ObjEOTTO);
 }
Example #11
0
        /// <summary>
        /// Code to get Organization details
        /// </summary>
        /// <param name="ObjEOTTO"></param>
        /// <returns></returns>
        public EOTTO GetOTTODetails(EOTTO ObjEOTTO)
        {
            DataSet dsOTTO = new DataSet();

            try
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    cmd.Connection  = SQLCon.Sqlconn();
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.CommandText = "[P_Get_OTTODetails]";
                    using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                    {
                        da.Fill(dsOTTO);
                    }
                    if (dsOTTO != null && dsOTTO.Tables.Count > 0)
                    {
                        ObjEOTTO.dtOTTO = dsOTTO.Tables[0];
                        if (dsOTTO.Tables.Count > 1)
                        {
                            ObjEOTTO.dtContact = dsOTTO.Tables[1];
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                if (System.Threading.Thread.CurrentThread.CurrentCulture.Name.ToString() == "de-DE")
                {
                    throw new Exception("Fehler beim Laden der daten zu OTTO");
                }
                else
                {
                    throw new Exception("Error Occured While Retreiving OTTO details");
                }
            }
            finally
            {
                SQLCon.Close();
            }
            return(ObjEOTTO);
        }
Example #12
0
 private void btnNew_Click(object sender, EventArgs e)
 {
     if (ObjEOTTO == null)
     {
         ObjEOTTO = new EOTTO();
     }
     ObjEOTTO.OTTOID           = -1;
     txtShortName.Text         = string.Empty;
     txtFullName.Text          = string.Empty;
     txtStreet.Text            = string.Empty;
     txtPostalCode.Text        = string.Empty;
     txtCity.Text              = string.Empty;
     txtCountry.Text           = string.Empty;
     txtILN.Text               = string.Empty;
     txtBankName.Text          = string.Empty;
     txtBankPCode.Text         = string.Empty;
     txtBankAccNo.Text         = string.Empty;
     txtDVNr.Text              = string.Empty;
     txtTenderNo.Text          = string.Empty;
     txtDebtorNo.Text          = string.Empty;
     txtCountryType.Text       = string.Empty;
     txtIndustry.Text          = string.Empty;
     txtArtBevBew.Text         = string.Empty;
     txtArtNU.Text             = string.Empty;
     txtBGBez.Text             = string.Empty;
     txtBGDatum.Text           = string.Empty;
     txtBGNr.Text              = string.Empty;
     txtOTTOTelefone.Text      = string.Empty;
     txtTelefax.Text           = string.Empty;
     txtWebsite.Text           = string.Empty;
     txtHotline.Text           = string.Empty;
     txtIBAN.Text              = string.Empty;
     txtBIC.Text               = string.Empty;
     txtUSTNr.Text             = string.Empty;
     txtseatofcompany.Text     = string.Empty;
     txtMD.Text                = string.Empty;
     txtComplementary.Text     = string.Empty;
     checkEditIsBranch.Checked = false;
 }
Example #13
0
        /// <summary>
        /// Code to save Organzition contacts
        /// </summary>
        /// <param name="ObjEOTTO"></param>
        /// <returns></returns>
        public EOTTO SaveOTTOContactDetails(XmlDocument XmlDoc, EOTTO ObjEOTTO)
        {
            int     ContactID = -1;
            DataSet dsOTTO    = new DataSet();

            try
            {
                string innerxml = XmlDoc.InnerXml;
                using (SqlCommand cmd = new SqlCommand())
                {
                    cmd.Connection  = SQLCon.Sqlconn();
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.CommandText = "[P_Ins_OTTO_Contact]";
                    SqlParameter param = new SqlParameter("@XMLOTTOContact", SqlDbType.Xml);
                    param.Value = innerxml;
                    cmd.Parameters.Add(param);
                    using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                    {
                        da.Fill(dsOTTO);
                    }
                    if (dsOTTO != null && dsOTTO.Tables.Count > 0)
                    {
                        if (int.TryParse(Convert.ToString(dsOTTO.Tables[0].Rows[0][0]), out ContactID))
                        {
                            ObjEOTTO.ContactID = ContactID;
                            if (dsOTTO.Tables.Count > 1)
                            {
                                ObjEOTTO.dtContact = dsOTTO.Tables[1];
                            }
                        }
                    }
                }
            }
            catch (Exception ex) { throw; }
            finally{ SQLCon.Close(); }
            return(ObjEOTTO);
        }
Example #14
0
 public frmOTTOMaster(EOTTO ObjEOTTO1)
 {
     InitializeComponent();
     ObjEOTTO = ObjEOTTO1;
 }