هل يمكنك شرح الكود التالي بالعربي وبالتفصيل      public static void smethod_3()
  {
    string str1 = PathingVars.customDBTemp != "" ? PathingVars.customDBTemp : Class67.smethod_59(Class67.smethod_122(FoldersPaths.ConnFilePath, 3));
    Class67.smethod_59(Class67.smethod_122(FoldersPaths.ConnFilePath, 4));
    string connectionString = ConnectionTools.ReturnTheConnectionFromAppConfigFile().ConnectionString;
    mrsalesdbEntities mrsalesdbEntities = ConnectionTools.OpenConn();
    mrsalesdbEntities.emp_usercat_prems.Find(new object[1]
    {
      (object) 4
    }).ucperm_Show = new int?(1);
    mrsalesdbEntities.SaveChanges();
    using (MySqlConnection connection1 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand1 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'accounts_detials' AND COLUMN_NAME = 'accdet_DebitOrCredit';"), connection1);
      connection1.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand1.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection2 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand2 = new MySqlCommand(string.Format(" ALTER TABLE accounts_detials ADD COLUMN accdet_DebitOrCredit INT(11);"), connection2);
          connection2.Open();
          mySqlCommand2.ExecuteNonQuery();
          connection2.Close();
        }
      }
    }
    using (MySqlConnection connection3 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand3 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'accounts_detials' AND COLUMN_NAME = 'accdet_CostCenterStatus';"), connection3);
      connection3.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand3.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection4 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand4 = new MySqlCommand(string.Format(" ALTER TABLE accounts_detials ADD COLUMN accdet_CostCenterStatus INT(11);"), connection4);
          connection4.Open();
          mySqlCommand4.ExecuteNonQuery();
          connection4.Close();
        }
      }
    }
    using (MySqlConnection connection5 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand5 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'accounts_detials' AND COLUMN_NAME = 'accdet_FinalAccountType';"), connection5);
      connection5.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand5.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection6 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand6 = new MySqlCommand(string.Format(" ALTER TABLE accounts_detials ADD COLUMN accdet_FinalAccountType INT(11);"), connection6);
          connection6.Open();
          mySqlCommand6.ExecuteNonQuery();
          connection6.Close();
        }
      }
    }
    using (MySqlConnection connection7 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand7 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'account_items' AND COLUMN_NAME = 'accitem_CostCenter';"), connection7);
      connection7.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand7.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection8 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand8 = new MySqlCommand(string.Format(" ALTER TABLE account_items ADD COLUMN accitem_CostCenter INT(11);"), connection8);
          connection8.Open();
          mySqlCommand8.ExecuteNonQuery();
          connection8.Close();
        }
      }
    }
    using (MySqlConnection connection9 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand9 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'account_main' AND COLUMN_NAME = 'accitem_RecordNum';"), connection9);
      connection9.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand9.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection10 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand10 = new MySqlCommand(string.Format(" ALTER TABLE account_main ADD COLUMN accitem_RecordNum INT(11);"), connection10);
          connection10.Open();
          mySqlCommand10.ExecuteNonQuery();
          connection10.Close();
        }
      }
    }
    using (MySqlConnection connection11 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand11 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'account_main' AND COLUMN_NAME = 'accitem_notes';"), connection11);
      connection11.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand11.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection12 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand12 = new MySqlCommand(string.Format(" ALTER TABLE account_main ADD COLUMN accitem_notes VARCHAR(245);"), connection12);
          connection12.Open();
          mySqlCommand12.ExecuteNonQuery();
          connection12.Close();
        }
      }
    }
    using (MySqlConnection connection13 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand13 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'account_items' AND COLUMN_NAME = 'accitem_PeplType';"), connection13);
      connection13.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand13.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection14 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand14 = new MySqlCommand(string.Format(" ALTER TABLE account_items ADD COLUMN accitem_PeplType VARCHAR(45);"), connection14);
          connection14.Open();
          mySqlCommand14.ExecuteNonQuery();
          connection14.Close();
        }
      }
    }
    using (MySqlConnection connection15 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand15 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'account_items' AND COLUMN_NAME = 'accitem_PeplID';"), connection15);
      connection15.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand15.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection16 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand16 = new MySqlCommand(string.Format(" ALTER TABLE account_items ADD COLUMN accitem_PeplID INT(11);"), connection16);
          connection16.Open();
          mySqlCommand16.ExecuteNonQuery();
          connection16.Close();
        }
      }
    }
    using (MySqlConnection connection17 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand17 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'accounts_cost_centers' AND COLUMN_NAME = 'id';"), connection17);
      connection17.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand17.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection18 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand18 = new MySqlCommand(string.Format("CREATE TABLE IF NOT EXISTS accounts_cost_centers(id INT AUTO_INCREMENT,name VARCHAR(45) NOT NULL,notes VARCHAR(245), PRIMARY KEY(id))  ENGINE = INNODB; "), connection18);
          connection18.Open();
          mySqlCommand18.ExecuteNonQuery();
          connection18.Close();
        }
      }
    }
    using (MySqlConnection mySqlConnection = new MySqlConnection(connectionString))
    {
      mySqlConnection.Open();
      MySqlConnection connection = new MySqlConnection(connectionString);
      MySqlCommand mySqlCommand = new MySqlCommand(string.Format("UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='الاصول المتداولة', `accdet_DebitOrCredit`='2', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='56';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='الاصول غير الملموسة', `accdet_DebitOrCredit`='2', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='68';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='الخصوم المتداولة', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='9';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='المخصصات', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='21';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='الخصوم طويلة الاجل', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='24';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='حقوق الملكية', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='7';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='الايرادات', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='32';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مصروفات المتاجرة', `accdet_DebitOrCredit`='2', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='43';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مصروفات اخري', `accdet_DebitOrCredit`='2', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='71';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='رآس المال', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='29';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='الزيادة في رآس المال', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='30';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='جاري الشركاء', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='31';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='العقارات والمباني', `accdet_DebitOrCredit`='2', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='52';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='المعدات', `accdet_DebitOrCredit`='2', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='53';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='الاجهزة والآثاث', `accdet_DebitOrCredit`='2', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='54';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='الحواسب والطابعات', `accdet_DebitOrCredit`='2', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='55';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='القروض البنكية', `accdet_Statues`='1', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='11';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='الإئتمانات البنكية', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='12';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='العملاء المختلطين', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='13';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='ارصدة دائنة اخري', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='14';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='اوراق دفع', `accdet_Statues`='1', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='15';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='ضريبة المبيعات', `accdet_Statues`='1', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='16';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='ضريبة الخصم والاضافة', `accdet_Statues`='1', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='17';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='ضريبة العمالة', `accdet_Statues`='1', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='18';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='التأمينات الاجتماعية', `accdet_Statues`='1', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='19';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='الرواتب المتأخرة', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='20';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='اصلاح مجمع الاصول الثابتة', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='22';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مخصص الديون المشكوك في تحصيلها', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='23';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='القروض البنكية', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='25';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='قروض', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='26';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='خصوم اخري', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='27';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='خدمات التحويل البنكي', `accdet_DebitOrCredit`='2', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='28';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='دخل المتاجرة', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='33';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='ايرادات اخري', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='41';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='المبيعات', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='34';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='ايرادات الشحن', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='35';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='خصم مكتسب', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='36';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='خصم اصناف مكتسب', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='37';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='التشغيل', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='38';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='خصم بونص مكتسب علي الاصناف', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='39';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='دخل المتاجرة في الفوركس', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='40';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='دخل متنوع', `accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='42';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='تكلفة البضاعة المُباعة', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='44';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='الخصم المسموح به', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='45';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='خصم الاصناف المسموح به', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='46';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='نقل البضاعة', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='47';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مصاريف الشحنن من الخارج', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='48';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='هالك المخزون', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='49';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='خصم بونص علي الاصناف مسموح به', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='50';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='التسويات الجردية', `accdet_DebitOrCredit`='2', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='51';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مخزون البضاعة', `accdet_DebitOrCredit`='2', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='2' WHERE `accdet_ID`='57';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='البنوك', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='58';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='العملاء', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='59';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='الخزائن', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='60';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='سلفة الموظفين', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='61';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='ارصدة مدينة اخري', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='62';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='أوراق قبض', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='63';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='بطاقات المدفوعات', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='105';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مقدمي التأمين', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='64';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مصلحة الضرائب', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='65';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='تأمينات لدي الغير', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='66';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='سلفة الموظفين', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='67';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='تسويق المؤسسة', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='69';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='حقوق الملكية', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='70';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مصروفات التسويق', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='72';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مصروفات تمويلية', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='79';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مصروفات ادارية وعمومية', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='85';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مصروفات خيرية', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='104';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='الدعاية والاعلان', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='73';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='هدايا تسويقية', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='74';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='عقوبات التأخير', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='75';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مؤتمرات', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='76';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='كراسات الشروط', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='77';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='اكراميات تسويقية', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='78';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مصروفات بنكية', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='80';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مصروفات خضابات الضمان', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='81';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='عمولات وخصومات بنكية', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='82';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مصروفات كشف الحساب البنكي', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='83';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مصروفات الاصول الثابتة', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='84';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مرتبات الموظفين', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='86';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مصروفات انتقالات', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='87';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='اتصالات وانترنت', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='88';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='ايجارات', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='89';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='ضيافة', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='90';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='ثوابت', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='91';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='كهرباء ، مياه وجاز', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='92';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='الخصومات', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='93';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='أوراق قبض', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='94';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='اقامة فندقية', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='95';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مصروفات نثرية', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='96';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='اكراميات ادارية', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='97';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='حوافز موظفين', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='98';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='العمل الاضافي', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='99';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='حافز نسب التوزيع للموظفين', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='100';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='حافز انتاج العمل', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='101';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='خصومات الموظفين', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='102';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='مخصصات اهلاك الأصول الثابتة', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='103';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='الاصول', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='1';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='الخصوم', `accdet_DebitOrCredit`='0', `accdet_CostCenterStatus`='0' WHERE `accdet_ID`='2';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_DebitOrCredit`='2', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='4';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='المصروفات',`accdet_DebitOrCredit`='2', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='1' WHERE `accdet_ID`='6';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='الاصول الثابتة',`accdet_DebitOrCredit`='2', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='8';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='بطاقات  المدفوعات' WHERE `accdet_ID`='105';UPDATE `" + str1 + "`.`accounts_detials` SET `accdet_LangAccName`='الموردين',`accdet_DebitOrCredit`='1', `accdet_CostCenterStatus`='0', `accdet_FinalAccountType`='0' WHERE `accdet_ID`='10';"), connection);
      connection.Open();
      mySqlCommand.ExecuteNonQuery();
      connection.Close();
    }
    int accdetId;
    if (!mrsalesdbEntities.accounts_detials.Any<accounts_detials>((Expression<Func<accounts_detials, bool>>) (u => u.accdet_LangAccName == "الارصدة الافتتاحية")))
    {
      accounts_detials entity = new accounts_detials();
      entity.accdet_Type = new int?(7);
      entity.accdet_Cat = new int?(7);
      entity.accdet_AccountCode = new int?(44);
      entity.accdet_LangAccName = "الارصدة الافتتاحية";
      entity.accdet_DebitOrCredit = new int?(2);
      entity.accdet_FinalAccountType = new int?(0);
      entity.accdet_CostCenterStatus = new int?(0);
      mrsalesdbEntities.accounts_detials.Add(entity);
      mrsalesdbEntities.SaveChanges();
      accdetId = entity.accdet_ID;
    }
    else
      accdetId = mrsalesdbEntities.accounts_detials.Where<accounts_detials>((Expression<Func<accounts_detials, bool>>) (u => u.accdet_LangAccName == "الارصدة الافتتاحية")).FirstOrDefault<accounts_detials>().accdet_ID;
    using (MySqlConnection connection19 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand19 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'accounts_settings' AND COLUMN_NAME = 'id';"), connection19);
      connection19.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand19.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection20 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand20 = new MySqlCommand(string.Format("CREATE TABLE IF NOT EXISTS accounts_settings(id INT AUTO_INCREMENT,VENDOR INT(11), CUSTOMERS INT(11),TREASURY INT(11),BANKS INT(11),PAYMENTS_CARDS INT(11),Banks_fee INT(11),Capital_account INT(11),Stock_OF_Goods INT(11),Earned_discount INT(11),Item_Earned_discount INT(11),Bonus_Earned_discount INT(11),Allowed_discount INT(11),Item_Allowed_discount INT(11),Bonus_Allowed_discount INT(11),Tax_account INT(11),Goods_Transfere INT(11),Sold_Stocks_Cost INT(11),Sales INT(11),INVENTORY_ADJUSTMENTS INT(11),Init_Balance INT(11),Installment_profits INT(11),Installment_expensess INT(11),PRIMARY KEY(id))  ENGINE = INNODB; "), connection20);
          connection20.Open();
          mySqlCommand20.ExecuteNonQuery();
          connection20.Close();
        }
      }
    }
    if (mrsalesdbEntities.accounts_settings.Count<accounts_settings>() == 0)
    {
      mrsalesdbEntities.accounts_settings.Add(new accounts_settings()
      {
        VENDOR = new int?(10),
        CUSTOMERS = new int?(59),
        TREASURY = new int?(60),
        BANKS = new int?(58),
        PAYMENTS_CARDS = new int?(105),
        Banks_fee = new int?(82),
        Capital_account = new int?(29),
        Stock_OF_Goods = new int?(57),
        Earned_discount = new int?(36),
        Item_Earned_discount = new int?(37),
        Bonus_Earned_discount = new int?(39),
        Allowed_discount = new int?(45),
        Item_Allowed_discount = new int?(46),
        Bonus_Allowed_discount = new int?(50),
        Tax_account = new int?(16),
        Goods_Transfere = new int?(47),
        Sold_Stocks_Cost = new int?(44),
        Sales = new int?(34),
        INVENTORY_ADJUSTMENTS = new int?(51),
        Init_Balance = new int?(accdetId)
      });
      mrsalesdbEntities.SaveChanges();
    }
    List<string> stringList1 = new List<string>();
    stringList1.AddRange((IEnumerable<string>) mrsalesdbEntities.ad_country.Select<ad_country, string>((Expression<Func<ad_country, string>>) (s => s.country_Name)).ToList<string>());
    List<string> stringList2 = new List<string>();
    stringList2.AddRange((IEnumerable<string>) mrsalesdbEntities.ad_city.Select<ad_city, string>((Expression<Func<ad_city, string>>) (s => s.city_Name)).ToList<string>());
    string[] strArray1 = new string[16]
    {
      "ليبيا",
      "المغرب",
      "البحرين",
      "قطر",
      "الصومال",
      "فلسطين",
      "العراق",
      "لبنان",
      "سوريا",
      "تونس",
      "السودان",
      "موريتانيا",
      "عمان",
      "اليمن",
      "جيبوتى",
      "جزر القمر"
    };
    foreach (string str2 in strArray1)
    {
      if (!stringList1.Contains(str2))
        mrsalesdbEntities.ad_country.Add(new ad_country()
        {
          country_Name = str2
        });
    }
    mrsalesdbEntities.SaveChanges();
    string[] strArray2 = new string[24]
    {
      "السويس",
      "الجيزة",
      "الأقصر",
      "بورسعيد",
      "دمياط",
      "أسوان",
      "القليوبية",
      "بني سويف",
      "الإسماعيلية",
      "سوهاج",
      "البحر الأحمر",
      "البحيرة",
      "الدقهلية",
      "الغربية",
      "الفيوم",
      "قنا",
      "كفر الشيخ",
      "مطروح",
      "المنوفية",
      "الوادي الجديد",
      "السادس من أكتوبر",
      "شمال سيناء",
      "جنوب سيناء",
      "الشرقية"
    };
    string[] strArray3 = new string[10]
    {
      "إربد",
      "البلقاء",
      "جرش",
      "الزرقاء",
      "الطفيلة",
      "عجلون",
      "العقبة",
      "مادبا",
      "معان",
      "المفرق"
    };
    string[] strArray4 = new string[5]
    {
      "الجهراء",
      "الفروانية",
      "حولي",
      "مبارك الكبير",
      "الأحمدي"
    };
    string[] strArray5 = new string[6]
    {
      "أبوظبي",
      "الشارقة",
      "عجمان",
      "أم القيوين",
      "رأس الخيمة",
      "الفجيرة"
    };
    string[] strArray6 = new string[11]
    {
      "المدينة المنورة",
      "القصيم",
      "الشرقية",
      "عسير",
      "تبوك",
      "حائل",
      "الحدود الشمالية",
      "جازان",
      "نجران",
      "الباحة",
      "الجوف"
    };
    string[] strArray7 = new string[48]
    {
      "أدرار",
      "الشلف",
      "الأغواط",
      "أم البواقي",
      "باتنة",
      "بجاية",
      "بسكرة",
      "بشار",
      "البليدة",
      "البويرة",
      "تمنراست",
      "تبسة",
      "تلمسان",
      "تيارت",
      "تيزي وزو",
      "الجزائر",
      "الجلفة",
      "جيجل",
      "سطيف",
      "سعيدة",
      "سكيكدة",
      "سيدي بلعباس",
      "عنابة",
      "قالمة",
      "قسنطينة",
      "المدية",
      "مستغانم",
      "المسيلة",
      "معسكر",
      "ورقلة",
      "وهران",
      "البيض",
      "اليزي",
      "برج بوعريريج",
      "بومرداس",
      "الطارف",
      "تندوف",
      "تسمسيلت",
      "الوادي",
      "خنشلة",
      "سوق أهراس",
      "تيبازة",
      "ميلة",
      "عين الدفلى",
      "النعامة",
      "عين تموشنت",
      "غرداية",
      "غليزان"
    };
    string[] strArray8 = new string[25]
    {
      "طرابلس",
      "بنغازي",
      "مصراتة",
      "البيضاء",
      "الخمس",
      "الزاوية",
      "المرج",
      "زوارة",
      "إجدابيا",
      "سرت",
      "سبها",
      "طبرق",
      "العزيزية",
      "صبراتة",
      "زليطن",
      "ترهونة",
      "غريان",
      "درنة",
      "يفرن",
      "نالوت",
      "صرمان",
      "القبة",
      "بني وليد",
      "الجوف",
      "مرزق"
    };
    string[] strArray9 = new string[12]
    {
      "طنجة تطوان الحسيمة",
      "الشرق",
      "فاس مكناس",
      "الرباط سلا القنيطرة",
      "بني ملال خنيفرة",
      "الدار البيضاء سطات",
      "مراكش آسفي",
      "درعة تافيلالت",
      "سوس ماسة",
      "كلميم واد نون",
      "العيون الساقية الحمراء",
      "الداخلة وادي الذهب"
    };
    string[] strArray10 = new string[4]
    {
      "العاصمة",
      "المحرق",
      "الشمالية",
      "الجنوبية"
    };
    string[] strArray11 = new string[7]
    {
      "الريان",
      "الدوحة",
      "الخور",
      "الوكرة",
      "الشمال",
      "أم صلال",
      "الضعاين"
    };
    string[] strArray12 = new string[10]
    {
      "مقديشو",
      "هرجيسا",
      "بوساسو",
      "جالكعيو",
      "بربرة",
      "مركة",
      "جمامة",
      "كيسمايو",
      "بيدوا",
      "برعو"
    };
    string[] strArray13 = new string[15]
    {
      "القدس",
      "بيت لحم",
      "الخليل",
      "رام الله والبيرة",
      "نابلس",
      "سلفيت",
      "قلقيلية",
      "طولكرم",
      "طوباس",
      "جنين",
      "أريحا والأغوار",
      "شمال غزة",
      "غزة",
      "الوسطى",
      "خان يونس"
    };
    string[] strArray14 = new string[19]
    {
      "أربيل",
      "الأنبار",
      "بابل",
      "بغداد",
      "البصرة",
      "حلبجة",
      "دهوك",
      "القادسية",
      "ديالى",
      "ذي قار",
      "السليمانية",
      "صلاح الدين",
      "كركوك",
      "كربلاء",
      "المثنى",
      "ميسان",
      "النجف",
      "نينوى",
      "واسط"
    };
    string[] strArray15 = new string[8]
    {
      "بيروت",
      "جبل لبنان",
      "لبنان الشمالي",
      "لبنان الجنوبي",
      "البقاع",
      "النبطية",
      "بعلبك الهرمل",
      "عكار"
    };
    string[] strArray16 = new string[14]
    {
      "درعا",
      "دير الزور",
      "حلب",
      "حماة",
      "الحسكة",
      "حمص",
      "ادلب",
      "القنيطرة",
      "اللاذقية",
      "الرقة",
      "ريف دمشق",
      "السويداء",
      "دمشق",
      "طرطوس"
    };
    string[] strArray17 = new string[24]
    {
      "تونس",
      "تطاوين",
      "قبلي",
      "قفصة",
      "مدنين",
      "القصرين",
      "صفاقس",
      "قابس",
      "سيدي بوزيد",
      "القيروان",
      "الكاف",
      "توزر",
      "سليانة",
      "بنزرت",
      "باجة",
      "جندوبة",
      "المهدية",
      "نابل",
      "زغوان",
      "سوسة",
      "منوبة",
      "المنستير",
      "بن عروس",
      "أريانة"
    };
    string[] strArray18 = new string[26]
    {
      "الخرطوم",
      "أم درمان",
      "خرطوم بحري",
      "نيالا",
      "بورتسودان",
      "كسلا",
      "الأبيض",
      "كوستي",
      "ود مدنى",
      "\tالقضارف",
      "الفاشر",
      "الضعين",
      "الدمازين",
      "الجنينة",
      "ربك",
      "سنار",
      "المناقل",
      "النهود",
      "الدامر",
      "عطبرة",
      "كادقلى",
      "الدويم",
      "حلفا الجديدة",
      "أم روابة",
      "شندي",
      "سنجة"
    };
    string[] strArray19 = new string[14]
    {
      "أدرار",
      "العصابة",
      "البراكنة",
      "داخلة نواذيبو",
      "كوركول",
      "غيديماغا",
      "الحوض الشرقي",
      "الحوض الغربي",
      "\tإينشيري",
      "نواكشوط الشمالية",
      "نواكشوط الجنوبية",
      "تكانت",
      "تيرس زمور",
      "الترارزة"
    };
    string[] strArray20 = new string[11]
    {
      "مسقط",
      "الظاهرة",
      "شمال الباطنة",
      "جنوب الباطنة",
      "البريمي",
      "الوسطى",
      "شمال الشرقية",
      "جنوب الشرقية",
      "ظفار",
      "الداخلية",
      "مسندم"
    };
    string[] strArray21 = new string[21]
    {
      "صنعاء",
      "\tالحديدة",
      "إب",
      "ذمار",
      "حجة",
      "تعز",
      "المكلا",
      " عمران",
      "عتق",
      "البيضاء",
      "الحزم",
      "المحويت",
      "مأرب",
      "الجبين ",
      "صعدة",
      "عدن",
      "زنجبار",
      "الضالع",
      "\tالغيظة",
      "حديبو ",
      "الحوطة"
    };
    string[] strArray22 = new string[11]
    {
      "جيبوتي",
      "علي صبيح",
      "تاجورة",
      "أوبوك",
      "دخيل",
      "أرتا",
      "هلهول",
      "درة",
      "غالافي",
      "لويادا",
      "علايلي دادا"
    };
    string[] strArray23 = new string[4]
    {
      "جزيرة حنزوان",
      "جزيرة القمر الكبرى",
      " جزيرة موحيلي",
      "أوبوك"
    };
    using (IEnumerator<ad_country> enumerator = ((IEnumerable<ad_country>) mrsalesdbEntities.ad_country).GetEnumerator())
    {
label_244:
      while (enumerator.MoveNext())
      {
        ad_country current = enumerator.Current;
        int countryId = current.country_ID;
        string countryName = current.country_Name;
        // ISSUE: reference to a compiler-generated method
        uint stringHash = \u003CPrivateImplementationDetails\u003E.ComputeStringHash(countryName);
        if (stringHash > 2238183782U)
        {
          if (stringHash <= 3347051568U)
          {
            if (stringHash > 2571770919U)
            {
              switch (stringHash)
              {
                case 3152990213:
                  if (countryName == "قطر")
                  {
                    string[] strArray24 = strArray11;
                    int index = 0;
                    while (true)
                    {
                      if (index < strArray24.Length)
                      {
                        string str3 = strArray24[index];
                        if (!stringList2.Contains(str3))
                          mrsalesdbEntities.ad_city.Add(new ad_city()
                          {
                            country_ID = new int?(countryId),
                            city_Name = str3
                          });
                        ++index;
                      }
                      else
                        goto label_244;
                    }
                  }
                  else
                    continue;
                case 3239406778:
                  if (countryName == "ليبيا")
                  {
                    string[] strArray25 = strArray8;
                    int index = 0;
                    while (true)
                    {
                      if (index < strArray25.Length)
                      {
                        string str4 = strArray25[index];
                        if (!stringList2.Contains(str4))
                          mrsalesdbEntities.ad_city.Add(new ad_city()
                          {
                            country_ID = new int?(countryId),
                            city_Name = str4
                          });
                        ++index;
                      }
                      else
                        goto label_244;
                    }
                  }
                  else
                    continue;
                case 3347051568:
                  if (countryName == "المغرب")
                  {
                    string[] strArray26 = strArray9;
                    int index = 0;
                    while (true)
                    {
                      if (index < strArray26.Length)
                      {
                        string str5 = strArray26[index];
                        if (!stringList2.Contains(str5))
                          mrsalesdbEntities.ad_city.Add(new ad_city()
                          {
                            country_ID = new int?(countryId),
                            city_Name = str5
                          });
                        ++index;
                      }
                      else
                        goto label_244;
                    }
                  }
                  else
                    continue;
                default:
                  continue;
              }
            }
            else
            {
              switch (stringHash)
              {
                case 2350499990:
                  if (countryName == "سوريا")
                  {
                    string[] strArray27 = strArray16;
                    int index = 0;
                    while (true)
                    {
                      if (index < strArray27.Length)
                      {
                        string str6 = strArray27[index];
                        if (!stringList2.Contains(str6))
                          mrsalesdbEntities.ad_city.Add(new ad_city()
                          {
                            country_ID = new int?(countryId),
                            city_Name = str6
                          });
                        ++index;
                      }
                      else
                        goto label_244;
                    }
                  }
                  else
                    continue;
                case 2571770919:
                  if (countryName == "الامارات")
                  {
                    foreach (string str7 in strArray5)
                    {
                      if (!stringList2.Contains(str7))
                        mrsalesdbEntities.ad_city.Add(new ad_city()
                        {
                          country_ID = new int?(countryId),
                          city_Name = str7
                        });
                    }
                    continue;
                  }
                  continue;
                default:
                  continue;
              }
            }
          }
          else if (stringHash > 4130876961U)
          {
            switch (stringHash)
            {
              case 4210274686:
                if (countryName == "عمان")
                {
                  string[] strArray28 = strArray20;
                  int index = 0;
                  while (true)
                  {
                    if (index < strArray28.Length)
                    {
                      string str8 = strArray28[index];
                      if (!stringList2.Contains(str8))
                        mrsalesdbEntities.ad_city.Add(new ad_city()
                        {
                          country_ID = new int?(countryId),
                          city_Name = str8
                        });
                      ++index;
                    }
                    else
                      goto label_244;
                  }
                }
                else
                  continue;
              case 4246621797:
                if (countryName == "الكويت")
                {
                  foreach (string str9 in strArray4)
                  {
                    if (!stringList2.Contains(str9))
                      mrsalesdbEntities.ad_city.Add(new ad_city()
                      {
                        country_ID = new int?(countryId),
                        city_Name = str9
                      });
                  }
                  continue;
                }
                continue;
              case 4281877966:
                if (countryName == "جيبوتى")
                {
                  foreach (string str10 in strArray22)
                  {
                    if (!stringList2.Contains(str10))
                      mrsalesdbEntities.ad_city.Add(new ad_city()
                      {
                        country_ID = new int?(countryId),
                        city_Name = str10
                      });
                  }
                  continue;
                }
                continue;
              default:
                continue;
            }
          }
          else
          {
            switch (stringHash)
            {
              case 3798769295:
                if (countryName == "اليمن")
                {
                  foreach (string str11 in strArray21)
                  {
                    if (!stringList2.Contains(str11))
                      mrsalesdbEntities.ad_city.Add(new ad_city()
                      {
                        country_ID = new int?(countryId),
                        city_Name = str11
                      });
                  }
                  continue;
                }
                continue;
              case 3806482231:
                if (countryName == "الاردن")
                {
                  string[] strArray29 = strArray3;
                  int index = 0;
                  while (true)
                  {
                    if (index < strArray29.Length)
                    {
                      string str12 = strArray29[index];
                      if (!stringList2.Contains(str12))
                        mrsalesdbEntities.ad_city.Add(new ad_city()
                        {
                          country_ID = new int?(countryId),
                          city_Name = str12
                        });
                      ++index;
                    }
                    else
                      goto label_244;
                  }
                }
                else
                  continue;
              case 4130876961:
                if (countryName == "الصومال")
                {
                  foreach (string str13 in strArray12)
                  {
                    if (!stringList2.Contains(str13))
                      mrsalesdbEntities.ad_city.Add(new ad_city()
                      {
                        country_ID = new int?(countryId),
                        city_Name = str13
                      });
                  }
                  continue;
                }
                continue;
              default:
                continue;
            }
          }
        }
        else if (stringHash <= 1195010912U)
        {
          if (stringHash > 905869482U)
          {
            switch (stringHash)
            {
              case 1000799241:
                if (countryName == "موريتانيا")
                {
                  string[] strArray30 = strArray19;
                  int index = 0;
                  while (true)
                  {
                    if (index < strArray30.Length)
                    {
                      string str14 = strArray30[index];
                      if (!stringList2.Contains(str14))
                        mrsalesdbEntities.ad_city.Add(new ad_city()
                        {
                          country_ID = new int?(countryId),
                          city_Name = str14
                        });
                      ++index;
                    }
                    else
                      goto label_244;
                  }
                }
                else
                  continue;
              case 1018624391:
                if (countryName == "السودان")
                {
                  string[] strArray31 = strArray18;
                  int index = 0;
                  while (true)
                  {
                    if (index < strArray31.Length)
                    {
                      string str15 = strArray31[index];
                      if (!stringList2.Contains(str15))
                        mrsalesdbEntities.ad_city.Add(new ad_city()
                        {
                          country_ID = new int?(countryId),
                          city_Name = str15
                        });
                      ++index;
                    }
                    else
                      goto label_244;
                  }
                }
                else
                  continue;
              case 1195010912:
                if (countryName == "لبنان")
                {
                  string[] strArray32 = strArray15;
                  int index = 0;
                  while (true)
                  {
                    if (index < strArray32.Length)
                    {
                      string str16 = strArray32[index];
                      if (!stringList2.Contains(str16))
                        mrsalesdbEntities.ad_city.Add(new ad_city()
                        {
                          country_ID = new int?(countryId),
                          city_Name = str16
                        });
                      ++index;
                    }
                    else
                      goto label_244;
                  }
                }
                else
                  continue;
              default:
                continue;
            }
          }
          else
          {
            switch (stringHash)
            {
              case 160883944:
                if (countryName == "تونس")
                {
                  string[] strArray33 = strArray17;
                  int index = 0;
                  while (true)
                  {
                    if (index < strArray33.Length)
                    {
                      string str17 = strArray33[index];
                      if (!stringList2.Contains(str17))
                        mrsalesdbEntities.ad_city.Add(new ad_city()
                        {
                          country_ID = new int?(countryId),
                          city_Name = str17
                        });
                      ++index;
                    }
                    else
                      goto label_244;
                  }
                }
                else
                  continue;
              case 905869482:
                if (countryName == "فلسطين")
                {
                  foreach (string str18 in strArray13)
                  {
                    if (!stringList2.Contains(str18))
                      mrsalesdbEntities.ad_city.Add(new ad_city()
                      {
                        country_ID = new int?(countryId),
                        city_Name = str18
                      });
                  }
                  continue;
                }
                continue;
              default:
                continue;
            }
          }
        }
        else if (stringHash > 1651013319U)
        {
          switch (stringHash)
          {
            case 2092702836:
              if (countryName == "الجزائر")
              {
                string[] strArray34 = strArray7;
                int index = 0;
                while (true)
                {
                  if (index < strArray34.Length)
                  {
                    string str19 = strArray34[index];
                    if (!stringList2.Contains(str19))
                      mrsalesdbEntities.ad_city.Add(new ad_city()
                      {
                        country_ID = new int?(countryId),
                        city_Name = str19
                      });
                    ++index;
                  }
                  else
                    goto label_244;
                }
              }
              else
                continue;
            case 2186619697:
              if (countryName == "العراق")
              {
                foreach (string str20 in strArray14)
                {
                  if (!stringList2.Contains(str20))
                    mrsalesdbEntities.ad_city.Add(new ad_city()
                    {
                      country_ID = new int?(countryId),
                      city_Name = str20
                    });
                }
                continue;
              }
              continue;
            case 2238183782:
              if (countryName == "السعودية")
              {
                string[] strArray35 = strArray6;
                int index = 0;
                while (true)
                {
                  if (index < strArray35.Length)
                  {
                    string str21 = strArray35[index];
                    if (!stringList2.Contains(str21))
                      mrsalesdbEntities.ad_city.Add(new ad_city()
                      {
                        country_ID = new int?(countryId),
                        city_Name = str21
                      });
                    ++index;
                  }
                  else
                    goto label_244;
                }
              }
              else
                continue;
            default:
              continue;
          }
        }
        else
        {
          switch (stringHash)
          {
            case 1202969932:
              if (countryName == "البحرين")
              {
                foreach (string str22 in strArray10)
                {
                  if (!stringList2.Contains(str22))
                    mrsalesdbEntities.ad_city.Add(new ad_city()
                    {
                      country_ID = new int?(countryId),
                      city_Name = str22
                    });
                }
                continue;
              }
              continue;
            case 1537052538:
              if (countryName == "مصر")
              {
                foreach (string str23 in strArray2)
                {
                  if (!stringList2.Contains(str23))
                    mrsalesdbEntities.ad_city.Add(new ad_city()
                    {
                      country_ID = new int?(countryId),
                      city_Name = str23
                    });
                }
                continue;
              }
              continue;
            case 1651013319:
              if (countryName == "جزر القمر")
              {
                string[] strArray36 = strArray23;
                int index = 0;
                while (true)
                {
                  if (index < strArray36.Length)
                  {
                    string str24 = strArray36[index];
                    if (!stringList2.Contains(str24))
                      mrsalesdbEntities.ad_city.Add(new ad_city()
                      {
                        country_ID = new int?(countryId),
                        city_Name = str24
                      });
                    ++index;
                  }
                  else
                    goto label_244;
                }
              }
              else
                continue;
            default:
              continue;
          }
        }
      }
    }
    mrsalesdbEntities.SaveChanges();
    using (MySqlConnection connection21 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand21 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'ad_system_settinges' AND COLUMN_NAME = 'SendAminEmailsTo';"), connection21);
      connection21.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand21.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection22 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand22 = new MySqlCommand(string.Format(" ALTER TABLE ad_system_settinges ADD COLUMN SendAminEmailsTo INT(11);"), connection22);
          connection22.Open();
          mySqlCommand22.ExecuteNonQuery();
          connection22.Close();
        }
      }
    }
    using (MySqlConnection connection23 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand23 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'ad_system_settinges' AND COLUMN_NAME = 'Emails_Server';"), connection23);
      connection23.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand23.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection24 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand24 = new MySqlCommand(string.Format(" ALTER TABLE ad_system_settinges ADD COLUMN Emails_Server VARCHAR(45);"), connection24);
          connection24.Open();
          mySqlCommand24.ExecuteNonQuery();
          connection24.Close();
        }
      }
    }
    using (MySqlConnection connection25 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand25 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'ad_system_settinges' AND COLUMN_NAME = 'emails_Port';"), connection25);
      connection25.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand25.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection26 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand26 = new MySqlCommand(string.Format(" ALTER TABLE ad_system_settinges ADD COLUMN emails_Port INT(11);"), connection26);
          connection26.Open();
          mySqlCommand26.ExecuteNonQuery();
          connection26.Close();
        }
      }
    }
    using (MySqlConnection connection27 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand27 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'ad_system_settinges' AND COLUMN_NAME = 'Email_username';"), connection27);
      connection27.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand27.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection28 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand28 = new MySqlCommand(string.Format(" ALTER TABLE ad_system_settinges ADD COLUMN Email_username VARCHAR(45);"), connection28);
          connection28.Open();
          mySqlCommand28.ExecuteNonQuery();
          connection28.Close();
        }
      }
    }
    using (MySqlConnection connection29 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand29 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'ad_system_settinges' AND COLUMN_NAME = 'Email_Password';"), connection29);
      connection29.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand29.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection30 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand30 = new MySqlCommand(string.Format(" ALTER TABLE ad_system_settinges ADD COLUMN Email_Password VARCHAR(45);"), connection30);
          connection30.Open();
          mySqlCommand30.ExecuteNonQuery();
          connection30.Close();
        }
      }
    }
    using (MySqlConnection connection31 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand31 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'ad_system_settinges' AND COLUMN_NAME = 'Email_emailAddress';"), connection31);
      connection31.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand31.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection32 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand32 = new MySqlCommand(string.Format(" ALTER TABLE ad_system_settinges ADD COLUMN Email_emailAddress VARCHAR(45);"), connection32);
          connection32.Open();
          mySqlCommand32.ExecuteNonQuery();
          connection32.Close();
        }
      }
    }
    using (MySqlConnection connection33 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand33 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'ad_system_settinges' AND COLUMN_NAME = 'email_enableSSL';"), connection33);
      connection33.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand33.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection34 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand34 = new MySqlCommand(string.Format(" ALTER TABLE ad_system_settinges ADD COLUMN email_enableSSL INT(2);"), connection34);
          connection34.Open();
          mySqlCommand34.ExecuteNonQuery();
          connection34.Close();
        }
      }
    }
    using (MySqlConnection connection35 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand35 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'ad_system_settinges' AND COLUMN_NAME = 'Email_AutoDaily';"), connection35);
      connection35.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand35.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection36 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand36 = new MySqlCommand(string.Format(" ALTER TABLE ad_system_settinges ADD COLUMN Email_AutoDaily INT(2);"), connection36);
          connection36.Open();
          mySqlCommand36.ExecuteNonQuery();
          connection36.Close();
        }
      }
    }
    using (MySqlConnection connection37 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand37 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'ad_system_settinges' AND COLUMN_NAME = 'Email_Auto_Monthlly';"), connection37);
      connection37.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand37.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection38 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand38 = new MySqlCommand(string.Format(" ALTER TABLE ad_system_settinges ADD COLUMN Email_Auto_Monthlly INT(2);"), connection38);
          connection38.Open();
          mySqlCommand38.ExecuteNonQuery();
          connection38.Close();
        }
      }
    }
    using (MySqlConnection connection39 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand39 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'ad_system_settinges' AND COLUMN_NAME = 'Email_Auto_Weakly';"), connection39);
      connection39.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand39.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection40 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand40 = new MySqlCommand(string.Format(" ALTER TABLE ad_system_settinges ADD COLUMN Email_Auto_Weakly INT(2);"), connection40);
          connection40.Open();
          mySqlCommand40.ExecuteNonQuery();
          connection40.Close();
        }
      }
    }
    using (MySqlConnection connection41 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand41 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'ad_system_settinges' AND COLUMN_NAME = 'SMS_ServiceProvider';"), connection41);
      connection41.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand41.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection42 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand42 = new MySqlCommand(string.Format(" ALTER TABLE ad_system_settinges ADD COLUMN SMS_ServiceProvider VARCHAR(200);"), connection42);
          connection42.Open();
          mySqlCommand42.ExecuteNonQuery();
          connection42.Close();
        }
      }
    }
    using (MySqlConnection connection43 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand43 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'ad_system_settinges' AND COLUMN_NAME = 'SMS_Username';"), connection43);
      connection43.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand43.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection44 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand44 = new MySqlCommand(string.Format(" ALTER TABLE ad_system_settinges ADD COLUMN SMS_Username  VARCHAR(45);"), connection44);
          connection44.Open();
          mySqlCommand44.ExecuteNonQuery();
          connection44.Close();
        }
      }
    }
    using (MySqlConnection connection45 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand45 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'ad_system_settinges' AND COLUMN_NAME = 'SMS_Password';"), connection45);
      connection45.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand45.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection46 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand46 = new MySqlCommand(string.Format(" ALTER TABLE ad_system_settinges ADD COLUMN SMS_Password  VARCHAR(45);"), connection46);
          connection46.Open();
          mySqlCommand46.ExecuteNonQuery();
          connection46.Close();
        }
      }
    }
    using (MySqlConnection connection47 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand47 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'ad_system_settinges' AND COLUMN_NAME = 'SMS_SenderID';"), connection47);
      connection47.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand47.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection48 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand48 = new MySqlCommand(string.Format(" ALTER TABLE ad_system_settinges ADD COLUMN SMS_SenderID  VARCHAR(45);"), connection48);
          connection48.Open();
          mySqlCommand48.ExecuteNonQuery();
          connection48.Close();
        }
      }
    }
    using (MySqlConnection connection49 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand49 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'ad_auto_send_operations' AND COLUMN_NAME = 'id';"), connection49);
      connection49.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand49.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection50 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand50 = new MySqlCommand(string.Format("CREATE TABLE IF NOT EXISTS ad_auto_send_operations(id INT AUTO_INCREMENT, operation VARCHAR(45),InstantEmail_to_admin INT(1),InstantEmail_to_Customer INT(1),dailyEmail INT(1),WeaklyEmail INT(1),MonthlyEmail INT(1),InstantSMS_to_admin INT(1),InstantSMS_to_Customer INT(1),dailySMS INT(1),WeaklySMS INT(1),MonthlySMS INT(1),PRIMARY KEY(id))  ENGINE = INNODB; "), connection50);
          connection50.Open();
          mySqlCommand50.ExecuteNonQuery();
          connection50.Close();
        }
      }
    }
    using (MySqlConnection connection51 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand51 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'ad_auto_send_operations_actions' AND COLUMN_NAME = 'id';"), connection51);
      connection51.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand51.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection52 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand52 = new MySqlCommand(string.Format("CREATE TABLE IF NOT EXISTS ad_auto_send_operations_actions(id INT AUTO_INCREMENT, type INT(11),date DATETIME,PRIMARY KEY(id))  ENGINE = INNODB; "), connection52);
          connection52.Open();
          mySqlCommand52.ExecuteNonQuery();
          connection52.Close();
        }
      }
    }
    using (new MySqlConnection(connectionString))
    {
      MySqlConnection connection = new MySqlConnection(connectionString);
      MySqlCommand mySqlCommand = new MySqlCommand(string.Format("UPDATE `" + str1 + "`.`emp_data` SET `empdata_Job`='2', `empdata_Socialstaue`='1', `empdata_Sextype`='1', `empdata_Diseasehmax`='0', `empdata_Accidentalhmax`='0', `empdata_Annualhmax`='0', `empdata_salaryGroup`='1', `empdata_Absenceform`='0', `empdata_Extraworkhours`='0', `empdata_Salarytype`='0', `empdata_SaleryPayMethod`='0', `empdata_Workdaygroup`='1' WHERE `empdata_ID`='1';"), connection);
      connection.Open();
      mySqlCommand.ExecuteNonQuery();
      connection.Close();
    }
    using (MySqlConnection connection53 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand53 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'ad_operations' AND COLUMN_NAME = 'Operation_Type';"), connection53);
      connection53.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand53.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection54 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand54 = new MySqlCommand(string.Format(" ALTER TABLE ad_operations ADD COLUMN Operation_Type  VARCHAR(45);"), connection54);
          connection54.Open();
          mySqlCommand54.ExecuteNonQuery();
          connection54.Close();
        }
      }
    }
    using (MySqlConnection connection55 = new MySqlConnection(connectionString))
    {
      MySqlCommand mySqlCommand55 = new MySqlCommand(string.Format("SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + str1 + "' AND TABLE_NAME = 'ad_operations' AND COLUMN_NAME = 'Operation_ID';"), connection55);
      connection55.Open();
      MySqlDataReader mySqlDataReader = mySqlCommand55.ExecuteReader();
      while (mySqlDataReader.Read())
      {
        if (mySqlDataReader.GetInt32(0) == 0)
        {
          MySqlConnection connection56 = new MySqlConnection(connectionString);
          MySqlCommand mySqlCommand56 = new MySqlCommand(string.Format(" ALTER TABLE ad_operations ADD COLUMN Operation_ID  INT(11);"), connection56);
          connection56.Open();
          mySqlCommand56.ExecuteNonQuery();
          connection56.Close();
        }
      }
    }
    using (new MySqlConnection(connectionString))
    {
      MySqlConnection connection = new MySqlConnection(connectionString);
      MySqlCommand mySqlCommand = new MySqlCommand(string.Format("ALTER TABLE `" + str1 + "`.`sales_sreturned_main`  DROP FOREIGN KEY `ssm_pmain_ID`;  ALTER TABLE `" + str1 + "`.`sales_sreturned_main`   ADD CONSTRAINT `ssm_pmain_ID`   FOREIGN KEY(`pmain_ID`)    REFERENCES `" + str1 + "`.`sales_main` (`smain_ID`)    ON DELETE SET NULL   ON UPDATE CASCADE; "), connection);
      connection.Open();
      mySqlCommand.ExecuteNonQuery();
    }
    if (!File.ReadAllText(FoldersPaths.ConfigFilePath).Contains("ARABICFONT"))
      File.AppendAllText(FoldersPaths.ConfigFilePath, Environment.NewLine + "ARABICFONT = Tajawal$");
    if (!File.ReadAllText(FoldersPaths.ConfigFilePath).Contains("ARABIC_FONTSIZE"))
      File.AppendAllText(FoldersPaths.ConfigFilePath, Environment.NewLine + "ARABIC_FONTSIZE = 10$");
    if (!File.ReadAllText(FoldersPaths.ConfigFilePath).Contains("ENGLISHFONT"))
      File.AppendAllText(FoldersPaths.ConfigFilePath, Environment.NewLine + "ENGLISHFONT = Segoe UI$");
    if (!File.ReadAllText(FoldersPaths.ConfigFilePath).Contains("ENGLISH_FONTSIZE"))
      File.AppendAllText(FoldersPaths.ConfigFilePath, Environment.NewLine + "ENGLISH_FONTSIZE = 10$");
    CreateStoredProcedure.CreatePS_4500();
  }